/* ==========================================================================
   Premium Teams & Franchises Directory Styles — Expat World Cup
   ========================================================================== */

/* Teams Hero Banner Extension */
.page-hero-teams {
  position: relative;
  background: linear-gradient(135deg, #030a1c 0%, var(--color-navy) 50%, #002b66 100%);
  border-bottom: 2px solid var(--color-emerald);
  overflow: hidden;
  padding: calc(var(--header-h) + 5.5rem) 0 4rem;
}

.page-hero-teams .crumbs {
  color: rgba(244, 241, 234, 0.78);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.page-hero-teams .crumbs a {
  color: var(--color-yellow) !important;
  font-weight: 700;
  text-decoration: none;
}
.page-hero-teams .crumbs a:hover {
  color: #ffffff !important;
  text-decoration: underline;
}

.page-hero-teams .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-emerald);
  color: #ffffff;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.35);
}

.page-hero-teams .hero-badge svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.page-hero-teams h1 {
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.05;
  color: #ffffff;
  margin: 0 0 12px;
}

.page-hero-teams .lede {
  color: rgba(248, 250, 252, 0.88);
  max-width: 650px;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Quick Metrics Bar in Hero */
.team-tournament-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.team-metric-pill {
  background: rgba(7, 23, 57, 0.7);
  border: 1px solid rgba(0, 168, 107, 0.3);
  padding: 12px 18px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.team-metric-pill:hover {
  transform: translateY(-2px);
  border-color: var(--color-yellow);
}

.team-metric-icon {
  width: 36px;
  height: 36px;
  background: rgba(0, 168, 107, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-metric-icon svg {
  width: 18px;
  height: 18px;
  color: var(--color-yellow);
}

.team-metric-pill strong {
  display: block;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-yellow);
  line-height: 1;
  margin-bottom: 2px;
}

.team-metric-pill span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Teams Control Toolbar */
.teams-toolbar {
  background: #ffffff;
  padding: 24px;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(7, 23, 57, 0.08);
  border: 1px solid rgba(0, 87, 217, 0.1);
  margin-bottom: 2rem;
}

.teams-search-and-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.team-search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.team-search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.team-search-box input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid #dcdfe3;
  border-radius: 4px;
  font-family: "Barlow", sans-serif;
  font-size: 0.95rem;
  background: #f8fafc;
  color: var(--color-ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.team-search-box input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-royal);
  box-shadow: 0 0 0 3px rgba(0, 87, 217, 0.15);
}

.teams-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-royal);
  background: #eff6ff;
  padding: 8px 16px;
  border-radius: 30px;
}

.teams-count-badge svg {
  width: 16px;
  height: 16px;
  color: var(--color-emerald);
}

/* Filter Chips with SVG Icons */
.teams-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.team-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f1f5f9;
  border: 1px solid #e2e5e9;
  border-radius: 30px;
  font-family: "Barlow Condensed", "Oswald", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.team-chip-btn svg {
  width: 14px;
  height: 14px;
  color: #64748b;
  transition: color 0.2s;
}

.team-chip-btn:hover {
  background: #e2e8f0;
  color: var(--color-royal);
  border-color: #cbd5e1;
}

.team-chip-btn.is-active {
  background: var(--color-emerald);
  color: #ffffff;
  border-color: var(--color-emerald);
  box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
}

.team-chip-btn.is-active svg {
  color: var(--color-yellow);
}

/* ==========================================================================
   Ultra-Premium Team Card Grid & Styling
   ========================================================================== */
.teams-premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 1rem;
}

.team-premium-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(7, 23, 57, 0.08);
  border: 1px solid rgba(0, 87, 217, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.3s;
  position: relative;
}

.team-premium-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 87, 217, 0.16);
  border-color: var(--color-royal);
}

/* Team Card Header & Media */
.team-card-media {
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--color-navy);
  overflow: hidden;
}

.team-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.6s;
}

.team-premium-card:hover .team-card-media img {
  transform: scale(1.06);
}

.team-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 23, 57, 0.2) 0%, rgba(7, 23, 57, 0.88) 100%);
  pointer-events: none;
}

/* Qualifier Zone Floating Badge */
.team-zone-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 23, 57, 0.88);
  border: 1px solid var(--color-yellow);
  color: var(--color-yellow);
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.team-zone-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Floating Crest and Flag */
.team-crests-row {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 2;
}

.team-crest-symbol {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--crest-bg, #00A86B);
  color: var(--crest-fg, #ffffff);
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.team-flag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.team-flag-pill .flag {
  width: 18px;
  height: 13px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

.team-flag-pill span {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-royal);
  text-transform: uppercase;
}

/* Card Body Content */
.team-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.team-card-content h3 {
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-royal);
  margin: 0 0 4px;
  line-height: 1.15;
  transition: color 0.2s;
}

.team-premium-card:hover .team-card-content h3 {
  color: var(--color-emerald);
}

.team-location-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: #5d6778;
  margin-bottom: 16px;
}

.team-location-meta svg {
  width: 14px;
  height: 14px;
  color: var(--color-emerald);
  flex-shrink: 0;
}

/* 4-Stat Broadcast Grid */
.team-stats-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e6ebf1;
  border-radius: 6px;
  padding: 10px 8px;
  margin-bottom: 16px;
  text-align: center;
}

.team-stat-cell dt {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
  font-weight: 600;
}

.team-stat-cell dd {
  margin: 0;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-royal);
  line-height: 1.1;
}

.team-stat-cell.is-points dd {
  color: var(--color-emerald);
}

/* Key Franchise Details */
.team-details-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e2e6eb;
}

.team-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #475569;
}

.team-tag-row svg {
  width: 14px;
  height: 14px;
  color: var(--color-emerald);
  flex-shrink: 0;
}

.team-tag-row strong {
  color: var(--color-royal);
  font-weight: 600;
}

/* Card Button */
.team-card-actions {
  margin-top: auto;
}

.team-btn-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--color-royal);
  color: #ffffff;
  border: 1px solid var(--color-royal);
  border-radius: 4px;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.team-btn-profile svg {
  width: 15px;
  height: 15px;
  color: var(--color-yellow);
  transition: transform 0.25s ease;
}

.team-btn-profile:hover {
  background: var(--color-emerald);
  border-color: var(--color-emerald);
  color: #ffffff;
}

.team-btn-profile:hover svg {
  color: #ffffff;
  transform: translateX(3px);
}

/* ==========================================================================
   Franchise Interactive Modal
   ========================================================================== */
.team-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 23, 57, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.team-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.team-modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  border: 1px solid rgba(0, 87, 217, 0.25);
  border-top: 4px solid var(--color-emerald);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
}

.team-modal-backdrop.is-open .team-modal-dialog {
  transform: translateY(0) scale(1);
}

.team-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(7, 23, 57, 0.7);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}

.team-modal-close:hover {
  background: var(--color-yellow);
  color: var(--color-ink);
  transform: rotate(90deg);
}

.team-modal-close svg {
  width: 18px;
  height: 18px;
}

.team-modal-header {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--color-navy);
}

.team-modal-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-modal-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 23, 57, 0.3) 0%, rgba(7, 23, 57, 0.95) 100%);
}

.team-modal-header-meta {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.team-modal-crest {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--crest-bg, #00A86B);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.team-modal-title h2 {
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 2rem;
  color: #ffffff;
  margin: 0;
  text-transform: uppercase;
  line-height: 1.1;
}

.team-modal-title p {
  color: var(--color-yellow);
  font-size: 0.95rem;
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-modal-body {
  padding: 24px;
}

.team-modal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.team-modal-stats strong {
  display: block;
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 1.6rem;
  color: var(--color-royal);
}

.team-modal-stats span {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.team-modal-section-title {
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  text-transform: uppercase;
  color: var(--color-royal);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-modal-section-title svg {
  width: 18px;
  height: 18px;
  color: var(--color-emerald);
}

.team-modal-roster-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.roster-player-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.roster-player-num {
  font-family: "Oswald", "Barlow Condensed", sans-serif;
  font-weight: 700;
  color: var(--color-royal);
  font-size: 0.95rem;
}

.roster-player-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--color-royal);
}

.roster-player-info span {
  font-size: 0.75rem;
  color: #64748b;
}

.team-modal-dossier {
  background: #f8fafc;
  border-left: 3px solid var(--color-emerald);
  padding: 14px 16px;
  border-radius: 0 4px 4px 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #475569;
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .team-tournament-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .teams-toolbar {
    padding: 14px 12px;
  }
  .team-search-box {
    min-width: 0;
    width: 100%;
  }
  .teams-premium-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .team-chip-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
}

@media (max-width: 600px) {
  .team-tournament-metrics {
    grid-template-columns: 1fr;
  }
  .team-modal-backdrop {
    padding: 12px;
  }
  .team-modal-body {
    padding: 16px 14px;
  }
  .team-modal-roster-list {
    grid-template-columns: 1fr;
  }
}
