/* General Body and Theme */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    zoom: 1; /* Fixed: Adjusted zoom to 1 */
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

a {
    color: #2E6DA4; /* Changed from elegant gold to professional blue */
    text-decoration: none;
}

/* Header and Footer */
header, footer {
    background-color: #151515; /* Darker black */
    padding: 1rem 1.5rem; /* Reduced padding */
    text-align: center;
    border-bottom: 1px solid #2A2A2A; /* Darker border */
}

header h1 {
    margin: 0;
    font-size: 2rem; /* Reduced font size */
    text-align: center; /* Fixed: Centered header h1 */
    color: #ffffff;
}

footer {
    border-top: 1px solid #2A2A2A; /* Darker border */
    margin-top: 1.5rem; /* Reduced margin */
    font-size: 0.9rem;
    color: #666666; /* Darker text */
}

.footer-links {
    margin-bottom: 0.8rem; /* Reduced margin */
    color: #666666; /* Darker text */
}

.footer-link {
    color: #ccc;
    cursor: pointer;
    margin: 0 0.25rem;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

.home-link {
    color: #ffffff;
    text-decoration: none;
}

.home-link:hover {
    text-decoration: none;
}

/* Category Menu Styles */
#category-menu {
    background-color: #1C1C1C; /* Darker background */
    border-bottom: 1px solid #2A2A2A; /* Darker border */
    padding: 0.6rem 0; /* Reduced padding */
}

#category-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

#category-menu ul li a {
    color: #e0e0e0;
    padding: 0.6rem 1rem; /* Reduced padding */
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.3s;
    border-radius: 5px;
    font-size: 0.9rem; /* Reduced font size */
    height: 100%; /* Fixed: Ensure consistent height */
    box-sizing: border-box; /* Fixed: Ensure consistent height */
    margin: 0 0.25rem; /* Fixed: Added margin for spacing */
}

#category-menu ul li a:hover,
#category-menu ul li a.active {
    background-color: #2E6DA4; /* Changed from new primary color */
    color: #e0e0e0; /* Fixed: Maintain light text on active */
}

.ongoing-button {
    background-color: #3E2723; /* Fixed: Darker, less saturated red-brown */
}

.ongoing-button.active {
    background-color: #7F2A2A; /* Fixed: Deeper, more muted red */
    color: #ffffff;
}

.live-indicator-menu {
    display: none;
    width: 8px;
    height: 8px;
    background-color: #e53935;
    border-radius: 50%;
    margin-left: 5px; /* Fixed: Tighter spacing */
    animation: flash 1.5s infinite;
}

.live-indicator-menu.live {
    display: inline-block;
}

/* New Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.mainmenubtn {
    background-color: transparent;
    color: #e0e0e0;
    padding: 0.6rem 1rem; /* Reduced padding */
    font-size: 0.9em; /* Reduced font size */
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: 5px;
    height: 100%; /* Fixed: Ensure consistent height */
    box-sizing: border-box; /* Fixed: Ensure consistent height */
    margin: 0 0.25rem; /* Fixed: Added margin for spacing */
}

.mainmenubtn:hover {
    background-color: #2E6DA4; /* Changed from new primary color */
    color: #121212; /* Dark text for contrast */
}

.dropdown-child {
    display: none;
    position: absolute;
    background-color: #252525; /* Darker background for dropdown */
    min-width: 170px; /* Fixed: Adjusted min-width */
    box-shadow: 0px 4px 8px 0px rgba(0,0,0,0.4); /* Fixed: Softer shadow */
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 3px; /* Reduced gap from button */
    top: calc(100% + 5px); /* Fixed: Positioned directly below button */
    left: 50%; /* Center the dropdown */
    transform: translateX(-50%); /* Center the dropdown */
}

.dropdown-child a {
    color: #e0e0e0;
    padding: 8px 14px; /* Reduced padding */
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 0.9rem; /* Reduced font size */
}

.dropdown-child a:hover {
    background-color: #353535; /* Lighter hover background */
}

.dropdown-child.show {
    display: block;
}

/* Search Bar */
.search-container {
    margin: 1rem 0; /* Reduced margin */
    display: flex; /* Added to center input */
    justify-content: center; /* Added to center input */
}

#searchInput {
    width: 65%; /* Reduced width */
    max-width: 400px; /* Reduced max-width */
    padding: 0.7rem; /* Reduced padding */
    border-radius: 25px;
    border: 1px solid #444444; /* Darker border */
    background-color: #222222; /* Darker background */
    color: #e0e0e0;
    font-size: 0.95rem; /* Reduced font size */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4); /* Inner shadow for depth */
    margin-left: auto; /* Fixed: Centered input */
    margin-right: auto; /* Fixed: Centered input */
    margin-top: 0.5rem; /* Fixed: Tighter spacing */
}

#searchInput:focus {
    outline: none;
    border-color: #2E6DA4; /* Changed from new primary color */
    box-shadow: 0 0 0 2px rgba(46, 109, 164, 0.5); /* Soft focus glow using new color */
}

/* Ad Slot Style */
.ad-slot {
    width: 468px;
    height: 60px;
    background-color: #1A1A1A; /* Darker background */
    border: 1px solid #3A3A3A; /* Solid, subtle border */
    margin: 20px auto; /* Reduced margin */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
    font-size: 13px;
    border-radius: 4px;
}

/* Main Content and Schedule Layout */
main {
    padding: 1rem 1.5rem; /* Reduced padding */
    max-width: 1200px; /* Reduced max-width */
    margin: 0 auto;
}

.sport-category {
    width: 80%; /* Reduced width */
    margin: 0 auto 2rem; /* Reduced margin */
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 1.5rem; /* Reduced padding */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Stronger shadow */
    margin-left: auto; /* Fixed: Centered category */
    margin-right: auto; /* Fixed: Centered category */
}

.sport-title {
    color: #ffffff;
    border-bottom: 2px solid #2E6DA4; /* Changed from new primary color */
    padding-bottom: 0.6rem; /* Reduced padding */
    margin-top: 0;
    font-size: 1.4rem; /* Reduced font size */
}

.league-title {
    color: #2E6DA4; /* Changed from new primary color */
    font-size: 1.1rem; /* Reduced font size */
    margin-top: 1rem; /* Reduced margin */
    margin-bottom: 0.6rem; /* Reduced margin */
}

.match-list {
    list-style: none;
    padding: 0;
}

.match-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.1rem; /* Fixed: Adjusted padding */
    border-bottom: 1px solid #252525; /* Darker border */
    transition: background-color 0.3s;
}

.match-item:last-child {
    border-bottom: none;
}

.match-item:hover {
    background-color: #282828; /* Darker hover background */
}

.match-info {
    display: flex;
    flex-direction: column;
}

.match-title {
    font-weight: bold;
    font-size: 1rem; /* Fixed: Reduced font size */
}

.match-time {
    font-size: 0.8rem; /* Fixed: Reduced font size */
    color: #777777; /* Darker time color */
}

.match-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem; /* Reduced gap */
}

/* Status Indicators */
.live-indicator, .finished-indicator {
    display: none;
    color: white;
    padding: 0.25rem 0.5rem; /* Reduced padding */
    border-radius: 4px;
    font-size: 0.75rem; /* Reduced font size */
    font-weight: bold;
    text-transform: uppercase;
}

.live-indicator {
    background-color: #e53935;
    animation: flash 1.5s infinite;
}

.finished-indicator {
    background-color: #616161;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Watch Now Button */
.watch-button {
    background-color: #2E6DA4; /* Changed from new primary color */
    color: #ffffff; /* Dark text for contrast */
    padding: 0.4rem 0.9rem; /* Fixed: Reduced padding */
    border-radius: 20px;
    font-weight: bold;
    transition: background-color 0.3s;
    display: none;
}

.watch-button:hover {
    background-color: #1D5985; /* Changed from darker shade on hover */
    text-decoration: none;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 25px; /* Reduced position */
    right: 25px; /* Reduced position */
    background-color: #2A2A2A;
    color: #2E6DA4; /* Changed from new primary color */
    border: 1px solid #2E6DA4; /* Changed from new primary color */
    width: 45px; /* Reduced size */
    height: 45px; /* Reduced size */
    text-align: center;
    line-height: 45px;
    font-size: 20px; /* Fixed: Reduced font size */
    border-radius: 8px;
    text-decoration: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4); /* Added shadow */
}

#back-to-top:hover {
    background-color: #2E6DA4; /* Changed from new primary color */
    color: #121212; /* Dark text on hover */
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85); /* Darker overlay */
}

.modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
    margin: 8% auto; /* Reduced margin */
    padding: 2rem; /* Reduced padding */
    border: 1px solid #3A3A3A; /* Darker border */
    width: 80%; /* Reduced width */
    max-width: 600px; /* Reduced max-width */
    border-radius: 10px;
    position: relative;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6); /* Stronger shadow */
    text-align: left; /* Fixed: Align text left */
}

.modal-content h2 {
    color: #2E6DA4; /* Changed from new primary color */
    margin-top: 0;
    font-size: 1.6rem; /* Reduced font size */
    border-bottom: 1px solid #3A3A3A; /* Subtle border */
    padding-bottom: 0.7rem; /* Reduced padding */
    margin-bottom: 1.2rem; /* Reduced margin */
}

.modal-content p {
    margin-bottom: 0.8rem; /* Reduced margin */
}

.modal-content ul {
    padding-left: 20px; /* Reduced padding */
    margin-bottom: 0.8rem; /* Reduced margin */
}

.modal-content li {
    margin-bottom: 0.4rem; /* Reduced margin */
}

.close-btn {
    color: #bbb;
    position: absolute;
    top: 12px; /* Reduced position */
    right: 18px; /* Reduced position */
    font-size: 28px; /* Reduced font size */
    font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.no-results {
    text-align: center;
    font-size: 1.2rem; /* Reduced font size */
    color: #777;
    margin-top: 2rem; /* Fixed: Reduced margin */
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem; /* Fixed: Reduced font size */
    }

    /* The menu will now remain horizontal and wrap on mobile */
    #category-menu ul li a,
    #category-menu .mainmenubtn {
        padding: 0.4rem 0.7rem; /* Reduced padding */
        font-size: 0.8rem; /* Fixed: Reduced font size */
    }

    .dropdown-child {
       right: 0;
       left: auto;
       min-width: 140px; /* Reduced min-width */
    }

    .sport-category {
        width: 90%; /* Fixed: Adjusted width */
        padding: 1.2rem; /* Fixed: Adjusted padding */
    }

    .match-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem; /* Reduced gap */
        padding: 0.6rem; /* Fixed: Reduced padding */
    }

    .match-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.4rem; /* Reduced margin */
    }

    #back-to-top {
        width: 38px; /* Reduced size */
        height: 38px; /* Reduced size */
        line-height: 38px;
        font-size: 16px; /* Fixed: Reduced font size */
        right: 12px; /* Reduced position */
        bottom: 12px; /* Reduced position */
    }

    .ad-slot {
        width: 100%;
        max-width: 280px; /* Reduced max-width */
        height: 45px; /* Reduced height */
    }

    .modal-content {
        margin: 5% auto;
        padding: 1.2rem; /* Reduced padding */
    }

    .modal-content h2 {
        font-size: 1.3rem; /* Reduced font size */
        margin-bottom: 0.8rem; /* Reduced margin */
    }
}