/* ==========================================================================
   DP World ILT20 Season 5 - Team & Squads Page Stylesheet (Figma 'Desktop - 2')
   Matches exact layout, colors, typography, and responsive breakpoints
   ========================================================================== */

/* Team Color Variables */
:root {
  --team-primary: #063624;
  --team-dark: #073624;
  --team-accent: #5af8bb;
  --team-gold: #f2d586;
  --team-lime: #b9e249;
  --team-magenta: #f00080;
  --team-purple: #421066;
  --team-purple-dark: #380d57;
}

/* Page Background for Teams/Roster Section per Figma Desktop - 2 */
body.team-page {
  background-color: #f7f5fa;
  color: #1a1a1a;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Team Hero Section (Frame 1000009299)
   -------------------------------------------------------------------------- */
.team-hero-section {
  position: relative;
  background: var(--team-primary);
  min-height: 480px;
  overflow: hidden;
  color: #ffffff;
  padding-top: 36px;
  padding-bottom: 30px;
  transition: background 0.4s ease;
}

/* Ambient Arabic Calligraphy Watermark */
.team-hero-watermark {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(400px, 50vw, 850px);
  opacity: 0.18;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

.team-hero-watermark img {
  width: 100%;
  height: auto;
  display: block;
}

/* Team Geometric Angle Watermark */
.team-hero-vector-bg {
  position: absolute;
  left: -12%;
  top: -20%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  transform: rotate(12deg);
  pointer-events: none;
  z-index: 1;
}

.team-hero-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

/* Breadcrumbs Capsule (Group 1000010400) */
.team-breadcrumbs-wrap {
  margin-bottom: 24px;
}

.team-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(6, 61, 40, 0.85);
  border: 1px solid rgba(0, 127, 78, 0.7);
  border-radius: 5px;
  padding: 6px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.team-breadcrumbs a {
  color: #ffffff;
  transition: color 0.2s ease;
}

.team-breadcrumbs a:hover {
  color: var(--color-lime-primary);
}

.team-breadcrumbs .crumb-sep {
  color: var(--team-gold);
  font-size: 11px;
}

.team-breadcrumbs .crumb-team,
.team-breadcrumbs .crumb-active {
  color: var(--team-gold);
}

/* Hero Content Grid (Identity + Players Cutout) */
.team-hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.team-hero-identity {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  max-width: 650px;
}

.team-hero-crest-frame {
  width: clamp(100px, 11vw, 150px);
  height: clamp(100px, 11vw, 150px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-hero-crest {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.team-hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1.05;
}

/* Right Players Trio Cutout Artwork (image 84) */
.team-hero-players-art {
  position: absolute;
  right: 0;
  top: -50px;
  bottom: -30px;
  width: clamp(340px, 45vw, 680px);
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  z-index: 2;
}

.team-hero-players-img {
  max-height: 460px;
  width: 100%;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

/* --------------------------------------------------------------------------
   Team Switcher Strip (Frame 1000009281)
   -------------------------------------------------------------------------- */
.team-switcher-wrap {
  margin-top: 32px;
  position: relative;
  z-index: 3;
}

.team-switcher-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.team-switcher-strip::-webkit-scrollbar {
  height: 6px;
}

.team-switcher-strip::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.team-switcher-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.team-switcher-card {
  flex: 0 0 110px;
  height: 130px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px 8px;
  cursor: pointer;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  background: #25073c;
  text-decoration: none;
}

.team-switcher-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.team-switcher-card.active {
  border: 1.5px solid var(--team-gold);
  box-shadow: 0 0 16px rgba(242, 213, 134, 0.5);
  transform: translateY(-3px);
}

/* Card Themes */
.team-switcher-card.theme-adkr {
  background: linear-gradient(145deg, #421066 0%, #200732 100%);
}
.team-switcher-card.theme-vipers {
  background: linear-gradient(145deg, #063624 0%, #031d13 100%);
}
.team-switcher-card.theme-capitals {
  background: linear-gradient(145deg, #c4122d 0%, #102d69 100%);
}
.team-switcher-card.theme-giants {
  background: linear-gradient(145deg, #e86100 0%, #7a3100 100%);
}
.team-switcher-card.theme-emirates {
  background: linear-gradient(145deg, #004b87 0%, #00223d 100%);
}
.team-switcher-card.theme-warriors {
  background: linear-gradient(145deg, #e59b00 0%, #502379 100%);
}

.team-switcher-card-watermark {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: url('assets/hero-calligraphy.png');
  background-size: cover;
  background-position: center;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.team-switcher-card-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  margin-top: 6px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.team-switcher-card-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1.1;
  margin-top: auto;
  position: relative;
  z-index: 1;
  letter-spacing: 0.4px;
}

/* --------------------------------------------------------------------------
   Roster Hub Section (Light Background per Figma Desktop - 2)
   -------------------------------------------------------------------------- */
.team-roster-section {
  padding: 50px 0 80px;
  background-color: #f7f5fa;
  position: relative;
}

/* Section Header (Group 1000010383) */
.roster-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.roster-magenta-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 36px;
}

.roster-magenta-bars span {
  display: block;
  height: 4px;
  background: var(--color-pink-primary);
  border-radius: 2px;
}

.roster-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.8vw, 48px);
  font-weight: 800;
  color: var(--team-purple-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Filter & Search Bar (Rectangle 6943 + Controls)
   -------------------------------------------------------------------------- */
.roster-filter-bar {
  background-color: var(--team-purple);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 45px;
  box-shadow: 0 4px 16px rgba(66, 16, 102, 0.15);
}

.filter-left-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Season 5 Active Pill */
.filter-season-btn {
  background-color: var(--color-pink-primary);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(240, 0, 128, 0.35);
  transition: background-color 0.2s ease;
}

.filter-season-btn:hover {
  background-color: var(--color-pink-hover);
}

.filter-season-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* Custom Styled Dropdowns */
.filter-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--team-purple-dark);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  padding: 8px 36px 8px 16px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.filter-select:hover,
.filter-select:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background-color: #2e0847;
}

.filter-select option {
  background-color: var(--team-purple-dark);
  color: #ffffff;
}

.filter-dropdown-wrap .chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #ffffff;
  opacity: 0.8;
}

/* Search Players Box */
.filter-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--team-purple-dark);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  padding: 7px 16px;
  min-width: 260px;
  transition: border-color 0.2s ease;
}

.filter-search-wrap:focus-within {
  border-color: var(--color-pink-primary);
}

.filter-search-icon {
  width: 18px;
  height: 18px;
  color: #ffffff;
  opacity: 0.85;
  flex-shrink: 0;
}

.filter-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  width: 100%;
}

.filter-search-input::placeholder {
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Squad Category Sections & Player Grid
   -------------------------------------------------------------------------- */
.squad-category-block {
  margin-bottom: 50px;
}

.squad-category-block.is-empty {
  display: none;
}

.squad-category-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 800;
  color: var(--team-purple);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 22px;
  line-height: 1.1;
}

.squad-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 240px));
  gap: 24px;
}

/* --------------------------------------------------------------------------
   Player Card Component (Frame 1000009274 - Exact Figma Spec)
   -------------------------------------------------------------------------- */
.player-card {
  background-color: var(--team-primary);
  border: 0.88px solid var(--team-gold);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s ease;
  cursor: pointer;
}

.player-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

/* Card Calligraphy Background Watermark */
.player-card-watermark {
  position: absolute;
  inset: -15% -20%;
  background-image: url('assets/hero-calligraphy.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

/* Player Portrait Container */
.player-card-thumb-frame {
  height: 250px;
  width: 100%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at center 60%, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
}

.player-card-thumb {
  max-height: 240px;
  width: auto;
  max-width: 95%;
  object-fit: contain;
  object-position: bottom center;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.player-card:hover .player-card-thumb {
  transform: scale(1.05);
}

/* Player Card Bottom Plate (Rectangle 7031) */
.player-card-bottom {
  background-color: var(--team-dark);
  border-top: 1px solid var(--team-accent);
  padding: 10px 14px 12px;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Tag Pills Row (Frame 1000009070 & 1000009071) */
.player-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-tag-role {
  background-color: var(--team-gold);
  color: var(--team-dark);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.4px;
  line-height: 1.3;
}

.player-tag-flag {
  background-color: var(--team-gold);
  color: #000000;
  font-size: 14px;
  padding: 1px 6px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

/* Name & Action Row */
.player-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-card-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-arrow-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--color-lime-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-lime-primary);
  font-size: 13px;
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.player-card:hover .player-card-arrow-btn {
  background-color: var(--color-lime-primary);
  color: var(--team-dark);
}

/* Empty State Message */
.roster-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px dashed rgba(66, 16, 102, 0.25);
  margin-top: 20px;
}

.roster-empty-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--team-purple);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.roster-empty-desc {
  color: #666666;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   Responsive Design Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .team-hero-section {
    min-height: auto;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .team-hero-players-art {
    width: 320px;
    opacity: 0.6;
    right: -20px;
  }

  .squad-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .team-hero-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .team-hero-identity {
    gap: 16px;
  }

  .team-hero-crest-frame {
    width: 80px;
    height: 80px;
  }

  .team-hero-players-art {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    max-height: 220px;
    justify-content: center;
    margin-top: 12px;
    opacity: 0.9;
  }

  .team-hero-players-img {
    max-height: 220px;
  }

  .team-switcher-card {
    flex: 0 0 96px;
    height: 118px;
    padding: 8px 4px 6px;
  }

  .team-switcher-card-logo {
    width: 48px;
    height: 48px;
  }

  .team-switcher-card-name {
    font-size: 10px;
  }

  .roster-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .filter-left-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .filter-season-btn {
    justify-content: center;
  }

  .filter-dropdown-wrap {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .filter-search-wrap {
    width: 100%;
  }

  .squad-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .player-card-thumb-frame {
    height: 190px;
  }

  .player-card-thumb {
    max-height: 180px;
  }

  .player-card-name {
    font-size: 16px;
  }

  .player-tag-role {
    font-size: 10px;
    padding: 1px 6px;
  }

  .player-tag-flag {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .squad-cards-grid {
    grid-template-columns: 1fr;
    max-width: 270px;
    margin-left: auto;
    margin-right: auto;
  }
}
