/* ==========================================================================
   DP World ILT20 Season 5 - Matches & Fixtures Page Stylesheet
   Matches exact Figma & Brand Guidelines UI
   ========================================================================== */

/* Main Page Container */
.matches-page-wrapper {
  background-color: #300A4B;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  color: var(--color-text-white, #ffffff);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.matches-hero {
  position: relative;
  background-color: var(--color-bg-card-alt);
  background-image: url('assets/fictures-hero-section-bg.png');
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 1440px auto;
  padding: 30px 0 20px;
  border-bottom: 1px solid var(--color-border-card);
}

@media (min-width: 1441px) {
  .matches-hero {
    background-size: cover;
  }
}

.matches-container {
  width: 100%;
  max-width: 1312px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* Back to Home Button */
.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(35, 3, 56, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font-heading), 'Cutmark Narrow', 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all 0.2s ease;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.btn-back-home svg {
  transition: transform 0.2s ease;
}

.btn-back-home:hover {
  background: rgba(55, 8, 85, 0.9);
  border-color: var(--color-lime-primary, #b9e249);
  color: var(--color-lime-primary, #b9e249);
  transform: translateX(-2px);
}

.btn-back-home:hover svg {
  transform: translateX(-2px);
}

/* Page Title: MATCHES */
.matches-page-title {
  font-family: var(--font-display), 'Cutmark Narrow', 'Barlow Condensed', 'Teko', sans-serif;
  font-size: clamp(42px, 5.5vw, 64px);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-lime-primary, #b9e249);
  line-height: 1;
  letter-spacing: 0.5px;
  margin: 0 0 28px 0;
  text-shadow: 0 0 24px rgba(185, 226, 73, 0.25);
}

/* Filter Controls Row (Tabs on Left, Cities & Teams on Right) */
.matches-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

/* Left: Live, Upcoming, Recent Tabs */
.matches-status-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-tab-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-demi);
  font-size: 16px;
  font-weight: 600;
  padding: 8px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
}

.status-tab-btn:hover:not(.active) {
  color: var(--color-lime-primary, #b9e249);
  background: rgba(255, 255, 255, 0.08);
}

.status-tab-btn.active {
  background: var(--color-pink-primary, #f00080);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(240, 0, 128, 0.45);
}

/* Right Filter Controls */
.matches-filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Segmented City Filter Bar */
.city-filter-bar {
  display: inline-flex;
  align-items: center;
  background: var(--color-bg-purple);
  border: 1px solid var(--color-border-purple);
  border-radius: 8px;
  padding: 4px;
  gap: 3px;
  backdrop-filter: blur(10px);
}

.city-filter-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-demi);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
  white-space: nowrap;
  /* letter-spacing: 1px; */
}

.city-filter-btn:hover:not(.active) {
  color: var(--color-lime-primary, #b9e249);
}

.city-filter-btn.active {
  background: var(--color-lime-primary, #b9e249);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(185, 226, 73, 0.35);
}

/* Team Dropdown Select */
.team-filter-wrap {
  position: relative;
  display: inline-block;
}

.team-filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--color-bg-purple);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 2L6 6.5L10.5 2' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font-heading), 'Cutmark Narrow', 'Barlow Condensed', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 11px 38px 11px 14px;
  cursor: pointer;
  text-transform: uppercase;
  outline: none;
  transition: all 0.2s ease;
  min-width: 140px;
  letter-spacing: 1px;
}

.team-filter-select:hover,
.team-filter-select:focus {
  border-color: var(--color-lime-primary, #b9e249);
  background-color: rgba(38, 5, 62, 0.95);
}

.team-filter-select option {
  background-color: #26023e;
  color: #ffffff;
  padding: 10px;
}

/* --------------------------------------------------------------------------
   Matches Content Section & Watermark
   -------------------------------------------------------------------------- */
.matches-content-section {
  position: relative;
  padding: 110px 0 70px;
  min-height: 480px;
}

/* Outline Watermark (UPCOMING.svg, LIVE.svg, RECENT.svg) */
.watermark-wrap {
  position: absolute;
  top: -86px;
  left: 20px;
  pointer-events: none;
  z-index: 1;
  user-select: none;
  transition: opacity 0.3s ease;
}

.watermark-img {
  height: 86px;
  width: auto;
  max-width: min(547px, 85vw);
  display: block;
  opacity: 0.9;
}

/* Matches Cards List */
.matches-list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 280px;
}

/* --------------------------------------------------------------------------
   Individual Match Card (1312 x 207) - Wave Entrance Animation
   -------------------------------------------------------------------------- */
.match-card-item {
  width: 100%;
  max-width: 1312px;
  min-height: 200px;
  margin: 0 auto;
  background-image: url('assets/fixturescard-bg.png');
  /* background-size: 100% 100%; */
  background-position: top center;
  background-repeat: no-repeat;
  background-color: #fcfcfd;
  border-radius: 16px;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s ease;
  animation: cardWaveIn 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

@keyframes cardWaveIn {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }

  50% {
    opacity: 0.85;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Cascading Wave Delays (Cards enter one by one like a wave) */
.match-card-item:nth-child(1) {
  animation-delay: 0.03s;
}

.match-card-item:nth-child(2) {
  animation-delay: 0.09s;
}

.match-card-item:nth-child(3) {
  animation-delay: 0.15s;
}

.match-card-item:nth-child(4) {
  animation-delay: 0.21s;
}

.match-card-item:nth-child(5) {
  animation-delay: 0.27s;
}

.match-card-item:nth-child(6) {
  animation-delay: 0.33s;
}

.match-card-item:nth-child(7) {
  animation-delay: 0.39s;
}

.match-card-item:nth-child(8) {
  animation-delay: 0.45s;
}

.match-card-item:nth-child(n+9) {
  animation-delay: 0.50s;
}

.match-card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   Card Top Row: Date/Time (left), Toss Badge (center), Result/Live (right)
   -------------------------------------------------------------------------- */
.card-top-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 32px;
}

.card-datetime {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-demi);
  font-size: 14.5px;
  font-weight: 500;
  color: #210238;
  letter-spacing: 0.3px;
  justify-self: start;
}

.card-datetime svg {
  color: #38004f;
  flex-shrink: 0;
}

/* Center Toss Badge (Vibrant Pink Capsule from reference) */
.card-toss-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-pink-primary, #f00080);
  color: #ffffff;
  font-family: var(--font-heading), 'Cutmark Narrow', 'Barlow Condensed', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 5px 22px;
  border-radius: 6px;
  text-transform: uppercase;
  box-shadow: 0 3px 12px rgba(240, 0, 128, 0.35);
  text-align: center;
  white-space: nowrap;
  justify-self: center;
}

/* Right Match Result Text */
.card-result-badge {
  font-family: var(--font-heading), 'Cutmark Narrow', 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #210238;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: right;
  line-height: 1.2;
  justify-self: end;
}

/* Live Badge Indicator */
.card-live-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-family: var(--font-heading), 'Cutmark Narrow', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #de0004;
  letter-spacing: 1px;
  justify-self: end;
}

.card-live-indicator .live-dot {
  width: 9px;
  height: 9px;
  background: #de0004;
  border-radius: 50%;
  animation: liveDotPulse 1.2s infinite;
}

@keyframes liveDotPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 8px #de0004;
  }

  100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
}

.card-header-spacer {
  min-width: 220px;
}

/* --------------------------------------------------------------------------
   Card Middle: Teams & Scores
   -------------------------------------------------------------------------- */
.card-teams-col {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 0;
}

.team-side {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.team-home {
  justify-content: flex-end;
  text-align: right;
}

.team-away {
  justify-content: flex-start;
  text-align: left;
}

.team-details {
  display: flex;
  flex-direction: column;
}

.team-home .team-details {
  align-items: flex-end;
  text-align: right;
}

.team-away .team-details {
  align-items: flex-start;
  text-align: left;
}

.team-name {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 800;
  color: var(--color-bg-purple);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.2;
}

/* Team Scores Block (Runs / Overs) */
.team-score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 3px;
}

.team-runs {
  font-family: var(--font-display), 'Cutmark Narrow', 'Barlow Condensed', 'Teko', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: #210238;
  line-height: 1;
  letter-spacing: 0.5px;
}

.team-overs {
  font-family: var(--font-heading), 'Cutmark Narrow', 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #4b1a6a;
}

.team-logo-wrap {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-logo {
  max-width: 70px;
  max-height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  transition: transform 0.2s ease;
}

.match-card-item:hover .team-logo {
  transform: scale(1.06);
}

/* Center VS Divider */
.vs-divider-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  flex-shrink: 0;
}

.vs-img {
  width: 28px;
  height: 38px;
  object-fit: contain;
  display: block;
}

/* --------------------------------------------------------------------------
   Card Bottom Row: Venue (left), Action Button (right)
   -------------------------------------------------------------------------- */
.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
}

.card-venue {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-demi);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-bg-purple);
  line-height: 1.35;
}

.card-venue svg,
.card-venue-icon {
  width: 18px;
  height: 15px;
  color: #38004f;
  flex-shrink: 0;
  object-fit: contain;
  display: inline-block;
}

.card-actions-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Buy Tickets Button */
.btn-buy-tickets {
  width: 184px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-lime-primary, #b9e249);
  color: #000000;
  font-family: var(--font-heading), 'Cutmark Narrow', 'Barlow Condensed', sans-serif;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: capitalize;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 2px 8px rgba(185, 226, 73, 0.25);
}

.ticket-btn-icon,
.btn-buy-tickets svg {
  width: 18px;
  height: 12px;
  flex-shrink: 0;
  object-fit: contain;
  display: inline-block;
}

.btn-buy-tickets:hover {
  background: var(--color-lime-light, #caff54);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(185, 226, 73, 0.4);
}

/* Match Centre Button */
.btn-match-centre {
  width: 184px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-image: url('assets/matchcenterbtn-bg.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  background-color: transparent;
  color: #38004f;
  font-family: var(--font-heading), 'Cutmark Narrow', 'Barlow Condensed', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-match-centre:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
  box-shadow: 0 4px 12px rgba(56, 0, 79, 0.15);
}

/* Empty State / Loading State */
.matches-empty-state,
.matches-loading-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(30, 2, 48, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  margin: 30px 0;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--color-lime-primary, #b9e249);
  opacity: 0.85;
}

.empty-state-title {
  font-family: var(--font-heading), 'Cutmark', sans-serif;
  font-size: 22px;
  color: #ffffff;
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 440px;
  margin: 0 auto 20px;
}

.btn-reset-filters {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--color-lime-primary, #b9e249);
  color: #000000;
  font-family: var(--font-heading), 'Cutmark Narrow', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
}

/* Spinner */
.matches-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(185, 226, 73, 0.2);
  border-top-color: var(--color-lime-primary, #b9e249);
  border-radius: 50%;
  animation: spinnerRotate 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spinnerRotate {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .match-card-item {
    padding: 18px 20px;
  }

  .card-meta-col {
    min-width: 180px;
    max-width: 220px;
    gap: 20px;
  }

  .card-teams-col {
    padding: 0 16px;
  }

  .team-name {
    font-size: 14px;
  }

  .team-logo-wrap {
    width: 46px;
    height: 46px;
  }

  .team-logo {
    max-width: 60px;
    max-height: 60px;
  }

  .btn-buy-tickets,
  .btn-match-centre {
    width: 160px;
    height: 40px;
    font-size: 13.5px;
  }

  .card-actions-col {
    min-width: 160px;
  }
}

@media (max-width: 991px) {
  .matches-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .matches-filter-controls {
    width: 100%;
    justify-content: space-between;
  }

  .match-card-item {
    padding: 16px 18px;
    gap: 16px;
    min-height: auto;
  }

  .card-top-row {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }

  .card-teams-col {
    width: 100%;
    padding: 8px 0;
    justify-content: center;
  }

  .team-name {
    font-size: 14.5px;
    line-height: 1.2;
  }

  .card-bottom-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .matches-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .matches-status-tabs {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .status-tab-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 8px;
  }

  .card-top-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(56, 0, 79, 0.14);
  }

  .card-datetime {
    order: 1;
    font-size: 13px;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
  }

  .card-result-badge,
  .card-live-indicator {
    order: 2;
    font-size: 13px;
    text-align: right;
    justify-content: flex-end;
    margin-left: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 55%;
  }

  .card-header-spacer {
    display: none;
  }

  /* Set toss section in its own dedicated centered row below time and result */
  .card-toss-badge {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 4px auto 0;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.3;
    padding: 6px 14px;
    white-space: normal;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 6px;
  }
}

@media (max-width: 640px) {
  .matches-hero {
    padding: 20px 0 16px;
  }

  .matches-page-title {
    font-size: 38px;
    margin-bottom: 20px;
  }

  .matches-filter-row {
    gap: 12px;
  }

  .matches-status-tabs {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .status-tab-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 4px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 8px;
  }

  .matches-filter-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .city-filter-bar {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: space-between;
  }

  .city-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .city-filter-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

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

  .team-filter-select {
    width: 100%;
  }

  .match-card-item {
    padding: 12px 12px 16px;
    border-radius: 14px;
    gap: 12px;
  }

  .card-teams-col {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 0;
    gap: 8px;
  }

  .team-side {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .team-details {
    align-items: center !important;
    text-align: center !important;
  }

  .team-name {
    font-size: 12px !important;
    text-align: center !important;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.15;
  }

  .team-score-row {
    justify-content: center;
  }

  .team-runs {
    font-size: 24px;
  }

  .team-overs {
    font-size: 11px;
  }

  .team-logo-wrap {
    width: 44px;
    height: 44px;
  }

  .team-logo {
    max-width: 54px;
    max-height: 54px;
  }

  .vs-divider-wrap {
    padding: 0 4px;
    flex-shrink: 0;
  }

  .vs-img {
    width: 22px;
    height: 30px;
  }

  .card-bottom-row {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
  }

  .card-venue {
    font-size: 12.5px;
    text-align: center;
    justify-content: center;
  }

  .card-actions-col {
    width: 100%;
    justify-content: center;
  }

  .btn-buy-tickets,
  .btn-match-centre {
    width: 100%;
    max-width: 260px;
    height: 40px;
    font-size: 13.5px;
  }

  .watermark-img {
    height: 54px;
  }

  .watermark-wrap {
    top: -65px;
  }

  .matches-content-section {
    padding: 78px 0 70px;
  }
}

@media (max-width: 420px) {
  .status-tab-btn {
    font-size: 12.5px;
    padding: 7px 2px;
  }
}