/* ==========================================
   Date Tabs & League Grouping Styles
   ========================================== */

/* Date Tabs Container */
.date-tabs-container {
    margin: 2rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.date-tabs-container::-webkit-scrollbar {
    display: none;
}

.date-tabs {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    min-width: min-content;
}

.date-tab {
    background: #F1F5F9;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 90px;
    white-space: nowrap;
}

.date-tab:hover {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.1);
    transform: translateY(-2px);
}

.date-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}

.tab-day-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.tab-date {
    font-size: 0.85rem;
    opacity: 0.8;
}

.matches-container {
    margin: 2rem 0;
}

.league-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all var(--transition);
}

.league-group:hover {
    border-color: rgba(255, 107, 53, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.league-header {
    background: linear-gradient(135deg, #F8F9FA, rgba(220, 38, 38, 0.05));
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.league-logo-header {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.league-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.matches-list {
    padding: 0;
}

/* Match Row - Horizontal Team vs Team Layout */
.match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
    position: relative;
}

.match-row:last-child {
    border-bottom: none;
}

.match-row:hover {
    background: rgba(255, 107, 53, 0.05);
}

.match-row.live {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #ef4444;
}

/* Live Indicator */
.live-dot {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {

    0%,
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translateY(-50%) scale(1.2);
    }
}

/* Team Sides */
.team-side {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.team-home {
    justify-content: flex-end;
    text-align: right;
}

.team-away {
    justify-content: flex-start;
    text-align: left;
}

.team-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-logo-sm {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Center Area (Score/Time) */
.match-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 100px;
    text-align: center;
}

/* Score Display */
.match-score-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
}

.score-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent);
}

.score-separator {
    font-size: 1.25rem;
    opacity: 0.6;
    font-weight: 600;
    color: var(--text-main);
}

/* Time Display */
.match-time-display {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Status Text */
.match-status-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.match-row.live .match-status-text {
    color: #ef4444;
    font-weight: 600;
}

/* Loading & Error States */
.matches-container .loading,
.matches-container .no-matches,
.matches-container .error {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.matches-container .error {
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .date-tab {
        padding: 0.6rem 1rem;
        min-width: 75px;
    }

    .tab-day-name {
        font-size: 0.85rem;
    }

    .tab-date {
        font-size: 0.75rem;
    }

    .league-header {
        padding: 0.875rem 1rem;
    }

    .league-logo-header {
        width: 26px;
        height: 26px;
    }

    .league-name {
        font-size: 0.95rem;
    }

    .match-row {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .team-side {
        flex: 1;
        min-width: 0;
    }

    .match-center {
        min-width: 80px;
    }

    .team-name {
        font-size: 0.875rem;
    }

    .team-logo-sm {
        width: 28px;
        height: 28px;
    }

    .match-score-display {
        font-size: 1.25rem;
    }

    .score-number {
        font-size: 1.5rem;
    }

    .match-time-display {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .date-tab {
        padding: 0.5rem 0.75rem;
        min-width: 65px;
    }

    .league-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .league-logo-header {
        width: 24px;
        height: 24px;
    }

    .league-name {
        font-size: 0.875rem;
    }

    .match-row {
        padding: 0.875rem 0.75rem;
    }

    .team-name {
        font-size: 0.8rem;
    }

    .team-logo-sm {
        width: 26px;
        height: 26px;
    }

    .score-number {
        font-size: 1.35rem;
    }

    .match-time-display {
        font-size: 0.85rem;
    }
}

/* Live Player Section styling */
.live-player-section {
    background: #111827; /* Dark background to pop the video */
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 1px solid #1f2937;
    padding-bottom: 0.75rem;
}

.live-indicator {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 9999px;
    animation: live-glowing 1.5s infinite;
}

@keyframes live-glowing {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

#playing-match-title {
    color: #f3f4f6;
    font-size: 1.15rem;
    margin: 0;
}

.live-player-section .video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 12px;
    background: #000;
    margin: 0;
    border: 1px solid #374151;
}

.live-player-section video,
.live-player-section iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: none;
}

/* Make Match Rows Clickable */
.match-row {
    cursor: pointer;
}

.match-row:hover {
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* Player placeholder styling */
.player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #090d16;
    color: #9ca3af;
    text-align: center;
    padding: 1.5rem;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 0.75rem;
    animation: placeholder-pulse 2s infinite ease-in-out;
}

.placeholder-text {
    margin: 0;
    font-size: 1.15rem;
    color: #f3f4f6;
    font-weight: 500;
}

.placeholder-subtext {
    margin: 0.35rem 0 0 0;
    font-size: 0.9rem;
    color: #6b7280;
}

@keyframes placeholder-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.08); opacity: 1; }
}

.offline-indicator {
    background: #4b5563;
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 9999px;
}

/* ==========================================
   Yalla Koora Matches Section Integration
   ========================================== */

/* Card container for each match card */
.containerMatch {
    display: block;
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    overflow: hidden;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.containerMatch:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
    border-color: var(--accent);
}

/* Match layout inside card */
.containerMatch .Match {
    display: grid;
    grid-template-columns: 1fr 140px 1fr;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

/* Team columns */
.containerMatch .fareq {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.containerMatch .fareq .Imagee {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.25rem;
}

.containerMatch .fareq .Imagee img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.containerMatch .asm {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* Center score / timing column */
.containerMatch .Nateja {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.containerMatch .matchHour {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.containerMatch .natej {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 2px;
    line-height: 1;
}

/* Status Badges */
.containerMatch .matchDate {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    color: white;
    text-transform: uppercase;
}

.containerMatch .matchDate.live {
    background-color: #ef4444;
    animation: live-glowing 1.5s infinite;
}

.containerMatch .matchDate.end {
    background-color: #6b7280;
}

.containerMatch .matchDate.soon {
    background-color: #22c55e;
}

.containerMatch .matchDate.upcoming {
    background-color: #3b82f6;
}

/* Hover play overlay (.Show) */
.containerMatch .Show {
    position: absolute;
    z-index: 2;
    background: rgba(9, 14, 49, 0.5);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.containerMatch .Show::before {
    content: '';
    width: 48px;
    height: 48px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M8 5v14l11-7z'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: scale(0.8);
    transition: transform 0.3s ease-in-out;
}

.containerMatch:hover .Show {
    opacity: 1;
}

.containerMatch:hover .Show::before {
    transform: scale(1);
}

/* Details list under the match */
.containerMatch ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    gap: 0.75rem;
}

.containerMatch ul li {
    list-style: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.containerMatch ul li span.icon {
    display: inline-block;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    width: 18px;
    height: 18px;
}

/* SVGs inline for Channel and Tournament */
.containerMatch ul li:nth-child(1) span.icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'><path d='M21 6h-7.59l3.29-3.29L16 2l-4 4-4-4-.71.71L10.59 6H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 14H3V8h18v12z'/></svg>");
}

.containerMatch ul li:nth-child(2) span.icon {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'><path d='M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v3c0 2.24 1.81 4.09 4.05 4.28C7.94 15.37 9.8 17 12 17s4.06-1.63 4.95-4.72C19.19 12.09 21 10.24 21 8V7c0-1.1-.9-2-2-2zm-14 5V7h2v3c0 1.1-.9 2-2 2zm14-2c0 1.1-.9 2-2 2V7h2v3zm-7 8c-2.21 0-4-1.79-4-4h8c0 2.21-1.79 4-4 4zM5 20h14v2H5v-2z'/></svg>");
}

body.darkmode .containerMatch ul li span.icon {
    filter: invert(0.6) brightness(1.2);
}

/* Hide original flex styles if they conflict */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .containerMatch .Match {
        grid-template-columns: 1fr 100px 1fr;
    }
    
    .containerMatch .asm {
        font-size: 0.95rem;
        max-width: 120px;
    }
    
    .containerMatch .fareq .Imagee {
        width: 48px;
        height: 48px;
    }
    
    .containerMatch .natej {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .containerMatch .Match {
        grid-template-columns: 1fr 80px 1fr;
        gap: 0.25rem;
    }

    .containerMatch .fareq .Imagee {
        width: 36px;
        height: 36px;
    }

    .containerMatch .asm {
        font-size: 0.75rem;
        max-width: 90px;
    }

    .containerMatch .natej {
        font-size: 1.25rem;
    }

    .containerMatch .matchHour {
        font-size: 0.95rem;
    }

    .containerMatch ul {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Yalla Koora Match Navigation Tabs Styling */
.TabulaSoprt {
  max-width: 100%;
  margin: 0 auto 2.5rem;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.TabulaSoprt div#tabulaSoprt {
  padding: 1.5rem;
}

.TabulaSoprt .TabulaGo {
  padding: 1rem 1.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.TabulaSoprt .TabulaGo h2.boxstitle {
  font-weight: 600;
  font-size: 1.15rem;
  background: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: #fff;
  margin: 0;
}

.TabulaSoprt .TabulaGo ul.nav-tabs {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.TabulaSoprt .TabulaGo ul.nav-tabs li {
  padding: 0.5rem 1.25rem;
  color: #cbd5e1;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all var(--transition);
}

.TabulaSoprt .TabulaGo ul.nav-tabs li.yesterday {
  background: #104783;
}

.TabulaSoprt .TabulaGo ul.nav-tabs li.Today {
  background: var(--accent);
}

.TabulaSoprt .TabulaGo ul.nav-tabs li.tomorrow {
  background: #7b6926;
}

.TabulaSoprt .TabulaGo ul.nav-tabs li.active {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.TabulaSoprt .TabulaGo ul.nav-tabs li:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Darkmode support */
body.darkmode .TabulaSoprt {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.darkmode .TabulaSoprt .TabulaGo {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-color);
}

body.darkmode .TabulaSoprt .TabulaGo ul.nav-tabs li {
  color: #fff !important;
}

@media (max-width: 768px) {
  .TabulaSoprt .TabulaGo {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .TabulaSoprt .TabulaGo h2.boxstitle {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }

  .TabulaSoprt .TabulaGo ul.nav-tabs {
    width: 100%;
    justify-content: center;
  }

  .TabulaSoprt .TabulaGo ul.nav-tabs li {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Emoji flags and dynamic content loading styling */
.team-emoji-flag {
    font-size: 2.5rem;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

.matches-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
    gap: 1rem;
}

.matches-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 107, 53, 0.1);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: matches-spin 1s linear infinite;
}

@keyframes matches-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.matches-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: #ef4444;
    font-weight: 500;
    gap: 0.5rem;
    text-align: center;
}

.matches-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

/* Reserve space so match content never causes layout shift */
.match-day-content {
    min-height: 600px;
}

/* Desktop needs more reserved space — viewport is taller so footer
   can be in view when match cards expand past 600px */
@media (min-width: 769px) {
    .match-day-content {
        min-height: 1400px;
    }
}

/* Skeleton loader cards — shown in HTML before JS loads */
.sk-card {
    height: 120px;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border-color, #2a2a4a);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.sk-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
    animation: sk-shimmer 1.5s linear infinite;
}
@keyframes sk-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}