/* Global Styles & Desktop First */
:root {
    --primary-color: #0056B3; /* Dark Blue */
    --secondary-color: #FFD700; /* Gold */
    --header-top-bg: #003366; /* Darker Blue */
    --main-nav-bg: #007BFF; /* Medium Blue */
    --text-light: #ffffff;
    --text-dark: #333333;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.2);
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    padding-top: 100px; /* Placeholder for fixed header height on desktop */
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-strong);
    background-color: var(--header-top-bg); /* Fallback, specific sections will override */
    min-height: 60px; /* Ensure content adaptation */
}

.header-top {
    background-color: var(--header-top-bg);
    padding: 10px 0;
    width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px; /* Desktop padding for logo and buttons */
}

.logo {
    color: var(--secondary-color);
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block; /* Ensure visibility */
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    width: 30px;
    height: 24px;
    z-index: 1001;
}

.hamburger-menu .bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

.desktop-nav-buttons {
    display: flex;
    gap: 12px; /* Spacing between buttons */
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-align: center;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.btn-register {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}
.btn-register:hover {
    background-color: #e6c200;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.6);
}

.btn-login {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.4);
}
.btn-login:hover {
    background-color: #004499;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.6);
}

.btn-download {
    background-color: #28a745; /* Green for download */
    color: var(--text-light);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}
.btn-download:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.6);
}

.mobile-button-area {
    display: none; /* Hidden on desktop */
}

.main-nav {
    background-color: var(--main-nav-bg);
    width: 100%;
    display: flex; /* Desktop: visible and flex row */
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    min-height: 40px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    gap: 30px; /* Spacing between nav links */
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
}

.mobile-menu-overlay {
    display: none; /* Hidden on desktop */
}

/* Footer Styles */
.site-footer {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 40px 0 20px 0;
    font-size: 14px;
}

.site-footer .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding: 0 20px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: var(--secondary-color);
    font-size: 18px;
    margin-bottom: 15px;
}

.footer-section p,
.footer-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom .copyright {
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Styles */
@media (max-width: 768px) {
    body {
        padding-top: 110px; /* Adjust for fixed header-top + mobile-button-area height */
    }

    .site-header {
        box-shadow: 0 2px 8px var(--shadow-light);
    }

    .header-container {
        padding: 0 15px;
        justify-content: space-between;
        position: relative;
    }

    .logo {
        font-size: 24px;
        flex-grow: 1; /* Allows logo to take available space */
        text-align: center; /* Center logo */
        order: 2; /* Place logo in the middle */
        display: block; /* Ensure visibility */
    }

    .hamburger-menu {
        display: block; /* Show hamburger on mobile */
        order: 1; /* Place hamburger on the left */
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .desktop-nav-buttons {
        display: none; /* Hide desktop buttons on mobile */
    }

    .mobile-button-area {
        display: block; /* Show mobile button area */
        background-color: var(--header-top-bg); /* Match header top background */
        padding: 10px 0;
        width: 100%;
        box-shadow: 0 2px 5px var(--shadow-light);
        z-index: 990; /* Below fixed header and mobile menu */
    }

    .mobile-button-container {
        width: 100%;
        max-width: none; /* Crucial: no max-width on mobile */
        margin: 0 auto;
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 0 15px;
    }

    .btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    .main-nav {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        top: 110px; /* Height of header-top + mobile-button-area */
        left: 0;
        width: 80%;
        height: calc(100vh - 110px); /* Fill remaining viewport height */
        flex-direction: column;
        background-color: var(--main-nav-bg);
        transform: translateX(-100%); /* Slide out to the left */
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px var(--shadow-strong);
        z-index: 999; /* Below overlay, above other content */
        overflow-y: auto; /* Allow scrolling for long menus */
        align-items: flex-start;
        padding: 20px 0;
    }

    .main-nav.active {
        display: flex; /* Show menu when active */
        transform: translateX(0); /* Slide into view */
    }

    .nav-container {
        width: 100%;
        max-width: none; /* Crucial: no max-width on mobile */
        flex-direction: column;
        align-items: flex-start;
        padding: 0 20px;
        gap: 15px; /* Spacing between nav links in column */
    }

    .nav-link {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        transition: opacity 0.3s ease-in-out;
        opacity: 0;
    }

    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }

    .site-footer .footer-container {
        flex-direction: column;
        gap: 20px;
        padding: 0 15px;
    }

    .footer-section {
        min-width: unset;
        width: 100%;
    }
}

/* Helper class to prevent background scrolling */
body.no-scroll {
    overflow: hidden;
}
