/* https://github.com/lipis/flag-icons */


/* ========================================
   Flag Icon Base Styles (CDN Integration)
   ======================================== */
.fi {
  /* Base styles for flag-icons CDN */
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.125em;
  margin: 0;
  flex-shrink: 0;
}


/* ========================================
   Flag Icon Wrapper with Fixed Sizes
   ======================================== */
.flag-icon {
  /* Base wrapper for all flag icons */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  
  /* Create stacking context for proper z-index */
  position: relative;
}

.flag-icon > .fi {
  /* SVG from CDN - use full container dimension */
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

/* Extra small - 12px */
.flag-icon.flag-xs {
  width: 14px;
  height: 10px;
  font-size: 14px;
}

/* Small - 16px */
.flag-icon.flag-sm {
  width: 16px;
  height: 12px;
  font-size: 16px;
}

/* Medium - Default - 20px */
.flag-icon.flag-md {
  width: 20px;
  height: 15px;
  font-size: 20px;
}

/* Large - 28px */
.flag-icon.flag-lg {
  width: 28px;
  height: 21px;
  font-size: 28px;
}

/* Extra large - 36px */
.flag-icon.flag-xl {
  width: 36px;
  height: 27px;
  font-size: 36px;
}

/* Extra extra large - 48px */
.flag-icon.flag-xxl {
  width: 48px;
  height: 36px;
  font-size: 48px;
}

/* Extra extra extra large - 60px */
.flag-icon.flag-xxxl {
  width: 60px;
  height: 45px;
  font-size: 60px;
}


/* ========================================
   Club logo (badges para equipos de club)
   Usado por team_logo helper. Cuando no hay
   logo_url, cae al .-placeholder (círculo vacío).
   ======================================== */
.cl-logo {
  display: inline-block;
  flex-shrink: 0;
  object-fit: contain;
}

.cl-logo.-xs { width: 16px; height: 16px; border-radius: 50%; }
.cl-logo.-sm { width: 20px; height: 20px; border-radius: 50%; }
.cl-logo.-md { width: 28px; height: 28px; border-radius: 50%; }
.cl-logo.-lg { width: 40px; height: 40px; border-radius: 50%; }
.cl-logo.-xl { width: 56px; height: 56px; border-radius: 50%; }

.cl-logo.-placeholder {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}


/* ========================================
   Flag with Text Utility
   ======================================== */
.flag-with-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  vertical-align: middle;
}

.flag-with-text > .flag-icon {
  flex-shrink: 0;
}

.flag-with-text > .text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: inherit;
}

/* Compact variant */
.flag-with-text.-compact > .text {
  font-size: 0.8125rem;
  font-weight: 400;
}

/* Large variant */
.flag-with-text.-lg > .flag-icon {
  width: 28px;
  height: 21px;
}

.flag-with-text.-lg > .text {
  font-size: 1rem;
  font-weight: 600;
}


/* ========================================
   Badge with Flag
   ======================================== */
.badge-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
}

.badge-flag > .flag-icon {
  width: 16px;
  height: 12px;
  flex-shrink: 0;
}


/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
  .flag-with-text.-lg > .flag-icon {
    width: 20px;
    height: 15px;
  }

  .flag-with-text.-lg > .text {
    font-size: 0.9375rem;
  }
}

@media (max-width: 480px) {
  .flag-with-text.-lg > .flag-icon {
    width: 16px;
    height: 12px;
  }

  .flag-with-text.-lg > .text {
    font-size: 0.875rem;
  }
}
