:root {
    /* Default values - will be overridden by config.js */
    --color-primary: #FFFFFF;
    --color-secondary: #E0E0E0;
    --color-hover: #FFD324;
    --color-text-shadow: rgba(0, 0, 0, 0.8);
    --color-overlay: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.85) 100%);
    --color-back-button-hover-bg: rgba(255, 255, 255, 0.2);
    /* Live indicator colors */
    --color-live-bg: rgba(255, 0, 0, 0.8);
    --color-live-text: #FFFFFF;
    /* New icon colors */
    --color-icon-bg: rgba(255, 255, 255, 0.1); /* Background for the icon circle */
    --color-icon-default: #ffffff; /* Default icon color */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000000;
    color: #ffffff;
    font-family: "Ubuntu", sans-serif;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Style for the main content area to center its children */
.content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Keeps the main grid-container centered */
    width: 100%;
}

/* Site title clickable styling */
.site-title {
    color: #ffffff;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none; /* Prevents text selection */
    text-align: center; /* Main site title remains centered */
}
.site-title:hover {
    color: var(--color-hover);
}

/* Header */
.main-header {
    text-align: center;
    padding: 40px 0;
}

.site-title {
    font-size: 4.5rem;
    margin-bottom: 30px;
    color: #ffffff;
    letter-spacing: 2px;
}

/* Navigation */
.main-nav {
    margin: 20px 0 40px;
}

.nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    list-style: none;
    padding: 0;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 15px;
    right: 15px;
    height: 2px;
    background-color: var(--color-hover);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links a:hover {
    color: var(--color-hover);
}

.nav-links a.active {
    color: var(--color-hover);
    font-weight: 500;
}

/* --- New/Modified Styles for Live Match Display on Home Screen --- */

/* Main container for the new sections layout */
.grid-container {
    display: flex;
    flex-direction: column; /* Stack sections vertically */
    gap: 30px; /* Space between each sport section */
    padding: 0 75px 40px; /* Standard padding */
    max-width: 1200px; /* Max width for the overall grid */
    margin: 0 auto; /* Center the grid */
    width: 100%;
}

/* Individual sport section (e.g., Football, Basketball) */
.sport-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Removed align-items: center; to allow title block to be left-aligned */
}

/* Header block for each sport section (icon + title) */
.sport-section-title-block {
    display: flex;
    align-items: center; /* Vertically aligns items in the middle */
    gap: 15px; /* Adds space between the icon and the title */
    justify-content: flex-start; /* Left-align icon and title within the block */
    padding: 15px 40px;
    margin-bottom: 30px; /* Space below the title block */
    background-color: rgba(255, 255, 255, 0.05); /* Subtle background for the title block */
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 100%; /* Ensures it takes full width of its container */
    max-width: 600px; /* Limits the max width for better readability */
    align-self: flex-start; /* Left-align the title block itself within sport-section */
}

/* Adjust the icon wrapper for title blocks */
.sport-section-title-block .sport-icon-wrapper {
    width: 60px; /* Slightly smaller icon wrapper for section titles */
    height: 60px;
    margin-bottom: 0; /* Remove margin-bottom as flex gap handles spacing */
    flex-shrink: 0; /* Prevent the icon wrapper from shrinking */
}

.sport-section-title-block .sport-icon {
    font-size: 2.5em; /* Adjust icon size within the title block */
}

/* Ensure the sport-title within the section title block is aligned */
.sport-section-title-block .sport-title {
    margin: 0; /* Remove any default margins that might interfere */
    text-align: left; /* Ensure text aligns to the left next to the icon */
    flex-grow: 1; /* Allows the title to take up remaining space */
}

/* Container for match cards within each sport section */
.sport-section-matches-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive grid */
    gap: 20px; /* Space between match cards */
    width: 100%;
    max-width: 1200px; /* Align with main grid-container */
    justify-items: center; /* Center individual cards within their grid cells */
}

/* Individual match card within the section */
.sport-section-match-card {
    background-color: rgba(255, 255, 255, 0.08); /* Slightly darker background than section */
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Added default shadow for separation */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%; /* Ensure match cards take full width of their grid column */
    max-width: 320px; /* Max width for individual match cards */
}

.sport-section-match-card:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
}

/* Header for match card, if it contains an icon and title */
.match-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px; /* Space below the header */
}

.match-card-icon { /* Style for icons within match cards, if applicable */
    font-size: 1.2em; /* Adjust size as needed */
    color: var(--color-icon-default);
    flex-shrink: 0;
}

/* Match card title and date */
.match-card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-primary);
    line-height: 1.3;
    text-align: left; /* Explicitly left-align for clarity */
}

.match-card-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}


/* Responsive Grid Layout - Adjust padding and gaps */
@media (max-width: 1400px) {
    .grid-container {
        padding: 0 60px 35px;
        gap: 25px;
    }
}

@media (max-width: 1100px) {
    .grid-container {
        padding: 0 50px 30px;
        gap: 20px;
    }
}

@media (max-width: 980px) {
    .grid-container {
        gap: 20px;
        padding: 0 40px 30px;
    }
    /* Header responsive */
    .main-header {
        padding: 30px 20px;
        text-align: center;
    }

    .site-title {
        font-size: 3.5rem;
        margin-bottom: 25px;
        letter-spacing: 1px;
    }

    .main-nav {
        margin: 15px 0 30px;
    }

    .nav-links {
        gap: 8px;
        padding: 0 10px;
    }

    .nav-links a {
        font-size: 1rem;
        padding: 6px 12px;
    }

    /* Footer responsive */
    .main-footer {
        margin-top: 40px;
        padding: 30px 20px;
    }

    .footer-content {
        gap: 25px;
        padding: 0 15px;
    }

    .footer-title {
        font-size: 2.2rem;
    }

    .footer-links {
        gap: 12px;
        justify-content: center;
    }

    .footer-links a {
        font-size: 0.9rem;
        padding: 4px 8px;
    }
}

@media (max-width: 768px) {
    .grid-container {
        gap: 15px;
        padding: 0 30px 25px;
    }
    /* Header responsive */
    .main-header {
        padding: 25px 15px;
    }

    .site-title {
        font-size: 2.8rem;
        margin-bottom: 20px;
        letter-spacing: 0.5px;
    }

    .main-nav {
        margin: 12px 0 25px;
    }

    .nav-links a {
        font-size: 0.95rem;
        padding: 5px 10px;
    }

    /* Footer responsive */
    .main-footer {
        margin-top: 35px;
        padding: 25px 15px;
    }

    .footer-content {
        gap: 20px;
        padding: 0 10px;
    }

    .footer-title {
        font-size: 2rem;
    }

    .footer-links {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }

    .footer-links a {
        font-size: 0.85rem;
        padding: 3px 6px;
    }

    /* Removed fixed height for iframe here - handled by responsive aspect ratio */
}

@media (max-width: 592px) {
    .grid-container {
        gap: 15px;
        padding: 0 20px 20px;
    }
    /* Responsive card sizing for the OLD sport-card */
    .sport-card {
        width: 90%;
        max-width: 320px;
        height: 220px;
    }
    .sport-section-title-block {
        padding: 10px 20px;
        gap: 10px;
        margin-bottom: 20px;
    }
    .sport-section-title {
        font-size: 1.6rem;
    }
    .sport-section-title-block .sport-icon-wrapper {
        width: 50px;
        height: 50px;
    }
    .sport-section-title-block .sport-icon {
        font-size: 2em;
    }
    .sport-section-matches-list {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
}

@media (max-width: 480px) {
    /* Header responsive */
    .main-header {
        padding: 20px 10px;
    }

    .site-title {
        font-size: 2.2rem;
        margin-bottom: 15px;
        letter-spacing: 0px;
    }

    .main-nav {
        margin: 10px 0 20px;
    }

    .nav-links {
        gap: 5px;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 4px 8px;
    }

    /* Footer responsive */
    .main-footer {
        margin-top: 30px;
        padding: 20px 10px;
    }

    .footer-content {
        gap: 15px;
        padding: 0 5px;
    }

    .footer-title {
        font-size: 1.8rem;
    }

    .footer-links a {
        font-size: 0.8rem;
        padding: 2px 4px;
    }

    /* Removed fixed height for iframe here - handled by responsive aspect ratio */
}

/* New style for when sportsGrid hosts lists or player */
.content-host {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Loading and Error States */
.loading, .error, .no-matches, .no-streams {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--color-primary);
}

.error {
    color: #ff5555;
}

/* Match Cards (for general category view if not using new sections) */
.matches-container {
    max-width: 1200px;
    width: 90%;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-button {
    cursor: pointer;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--color-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: var(--color-back-button-hover-bg);
    color: var(--color-hover);
}

.match-title-header {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-primary);
    text-align: left; /* Explicitly left-align for clarity */
}

.match-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-card:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.match-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-primary);
    text-align: left; /* Explicitly left-align for clarity */
}

.match-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}


/* Streams */
.streams-container {
    max-width: 1200px;
    width: 90%;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stream-source-section {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.source-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--color-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    text-align: left; /* Explicitly left-align for clarity */
}

.streams-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.stream-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stream-item:hover {
    background-color: rgba(255, 211, 36, 0.2);
    transform: translateY(-2px);
}

.stream-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stream-number {
    font-weight: 500;
    color: var(--color-primary);
}

.stream-language {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.quality-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.quality-badge.hd {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.quality-badge.sd {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

/* Stream player - NEW Responsive 16:9 Aspect Ratio */
.player-area {
    position: relative; /* Essential for child iframe positioning */
    width: 100%;
    max-width: 1200px; /* Max width for the video player */
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.3);
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio (9 / 16 = 0.5625) */
    height: 0; /* Ensures container collapses, relying on padding-bottom for height */
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.05);
}

.stream-info-header {
    font-size: 0.9rem;
    color: var(--color-primary);
}

.close-player {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.close-player:hover {
    background-color: rgba(255, 211, 36, 0.2);
    color: var(--color-hover);
}

.player-area iframe {
    position: absolute; /* Positions iframe relative to .player-area */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Makes iframe fill its parent (player-area's calculated height) */
    border: none;
    display: block;
}


/* Footer Styles */
.main-footer {
    margin-top: 60px;
    padding: 40px 0;
    background-color: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.footer-logo {
    text-align: center;
}

.footer-title {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.footer-title:hover {
    color: var(--color-hover);
}

.footer-nav {
    width: 100%;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-hover);
}

.footer-copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* --- Old Card Styles (if still used elsewhere for individual sport category selection) --- */
/* If your main page now uses sport-section-title-block and sport-section-match-card,
   these .sport-card styles might only be relevant for a different view or if you
   haven't fully transitioned all card types. */
.sport-card {
    width: 240px;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
    transform-style: preserve-3d;
    cursor: pointer;
    text-align: center;
}

.sport-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.05);
}

/* New styles for the icon wrapper (general purpose, also used in section title block) */
.sport-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
    background-color: var(--color-icon-bg);
    border-radius: 50%;
    margin-bottom: 20px; /* Default margin, overridden in section title block */
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.sport-card:hover .sport-icon-wrapper {
    background-color: rgba(255, 211, 36, 0.2);
}

/* Styles for the Font Awesome icon itself (general purpose) */
.sport-icon {
    font-size: 4em;
    color: var(--color-icon-default);
    transition: color 0.3s ease;
}

.sport-card:hover .sport-icon {
    color: var(--color-hover);
}

.sport-info {
    padding: 0 15px 25px;
    text-align: center;
    z-index: 3;
    width: 100%;
}

.sport-title {
    font-size: 1.5rem;
    margin: 0;
    color: var(--color-hover);
    font-weight: 700;
    text-shadow: 0 2px 4px var(--color-text-shadow);
}

.sport-category {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 500;
    opacity: 1;
    transition: color 0.3s ease;
}

.match-info-on-card { /* This class seems to be for text within the OLD sport-card */
    margin-top: 10px;
    text-align: center;
    width: 100%;
}

.match-info-on-card.no-live-match {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}


/* Live badge on grid cards and match cards */
.live-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--color-live-bg);
    color: var(--color-live-text);
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 5;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Font Classes */
.ubuntu-light { font-weight: 300; font-style: normal; }
.ubuntu-regular { font-weight: 400; font-style: normal; }
.ubuntu-medium { font-weight: 500; font-style: normal; }
.ubuntu-bold { font-weight: 700; font-style: normal; }
.ubuntu-light-italic { font-weight: 300; font-style: italic; }
.ubuntu-regular-italic { font-weight: 400; font-style: italic; }
.ubuntu-medium-italic { font-weight: 500; font-style: italic; }
.ubuntu-bold-italic { font-weight: 700; font-style: italic; }
