/* Base Styles */
:root {
    --primary-color: #003366;
    --accent-color: #FFD700;
    --text-color-light: #fff;
    --text-color-dark: #333;
    --button-register-bg: #E74C3C; /* Red for Register */
    --button-login-bg: #2ECC71;    /* Green for Login */
    --button-download-bg: #3498DB; /* Blue for Download */
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark);
    padding-top: 80px; /* Placeholder, will be dynamically set by JS */
    transition: padding-top 0.3s ease;
}

/* Site Header - Fixed & Suspended */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    min-height: 60px; /* Minimum height for top bar */
    display: flex;
    flex-direction: column; /* Allows stacking header-top-bar and mobile-button-area */
}

.header-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    height: 60px; /* Fixed height for desktop top bar */
}

.logo {
    color: var(--accent-color);
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    display: block; /* Ensure visibility */
    white-space: nowrap;
}

/* Main Navigation - Desktop First */
.main-nav {
    flex: 1;
    display: flex; /* Desktop: visible, horizontal */
    justify-content: center;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.main-nav li a {
    color: var(--text-color-light);
    text-decoration: none;
    padding: 10px 0;
    transition: color 0.3s, border-bottom-color 0.3s;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.main-nav li a:hover,
.main-nav li a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Desktop Navigation Buttons */
.desktop-nav-buttons {
    display: flex; /* Desktop: visible */
    align-items: center;
    gap: 10px;
}

/* Mobile specific elements (hidden on desktop) */
.hamburger-menu,
.mobile-button-area,
.mobile-menu-overlay {
    display: none;
}

/* Buttons - General Style */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    white-space: nowrap;
    color: var(--text-color-light);
    display: inline-block;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn-register {
    background-color: var(--button-register-bg);
}

.btn-login {
    background-color: var(--button-login-bg);
}

.btn-download {
    background-color: var(--button-download-bg);
}

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

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

.footer-section {
    flex: 1 1 280px; /* Allow sections to grow but prefer 280px width */
    margin-bottom: 20px;
}

.footer-section h3 {
    color: var(--accent-color);
    font-size: 1.2em;
    margin-bottom: 15px;
}

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

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

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

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

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .site-header {
        min-height: auto; /* Height will be sum of top-bar and button-area */
    }

    .header-top-bar {
        height: 60px; /* Keep consistent height for top bar */
        padding: 10px 15px;
        justify-content: space-between;
    }

    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 24px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1002; /* Higher than menu overlay */
    }

    .hamburger-menu .bar {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--text-color-light);
        transition: all 0.3s ease-in-out;
        border-radius: 2px;
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
    }

    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
    }

    .logo {
        flex-grow: 1; /* Allow logo to take available space */
        text-align: center; /* Center logo in remaining space */
        font-size: 24px;
    }

    .main-nav {
        display: none; /* Mobile: hidden by default */
        position: fixed;
        top: 0; /* Will be adjusted by JS based on header height */
        left: 0;
        width: 70%;
        height: 100vh;
        background-color: var(--primary-color);
        flex-direction: column;
        padding-top: 80px; /* Space for logo/hamburger area */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        transform: translateX(-100%); /* Start off-screen */
        transition: transform 0.3s ease;
        z-index: 1001; /* Above overlay, below hamburger button */
        overflow-y: auto;
    }

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

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav li a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: block;
        width: 100%;
    }

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

    .mobile-button-area {
        display: flex; /* Show mobile buttons */
        justify-content: center;
        gap: 8px;
        padding: 10px 15px;
        background-color: var(--primary-color);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        width: 100%;
        z-index: 998; /* Below main nav and hamburger */
    }

    .mobile-button-area .btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .mobile-menu-overlay {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999; /* Below menu, above content */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-overlay.active {
        display: block; /* Show overlay when active */
        opacity: 1;
    }

    body.no-scroll {
        overflow: hidden;
    }

    .footer-container {
        flex-direction: column;
        gap: 20px;
    }

    .footer-section {
        flex: 1 1 100%;
        text-align: center;
    }

    .footer-section ul {
        text-align: center;
    }
}
