/* Base styles */
:root {
    --primary-color: #FFD700; /* Gold */
    --secondary-color: #8B0000; /* Dark Red */
    --dark-red-variant: #6B0000;
    --light-gold-variant: #FFEB80;
    --text-color: #f0f0f0;
    --dark-text-color: #333;
    --button-bg-register: linear-gradient(135deg, #FFD700, #FFA500);
    --button-bg-login: linear-gradient(135deg, #8B0000, #B22222);
    --button-bg-download: linear-gradient(135deg, #4CAF50, #66BB6A);
    --button-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    /* Placeholder heights, will be dynamically calculated by JS for accurate body padding */
    --header-top-height-desktop: 60px;
    --main-nav-height-desktop: 50px;
    --header-top-height-mobile: 60px;
    --mobile-buttons-height: 50px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--dark-text-color);
    background-color: #f9f9f9;
    padding-top: calc(var(--header-top-height-desktop) + var(--main-nav-height-desktop)); /* Default padding for desktop, adjusted by JS */
}

body.no-scroll {
    overflow: hidden;
}

/* Header styles - Desktop First */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.header-top {
    background-color: var(--dark-red-variant);
    width: 100%;
    padding: 10px 0;
    display: flex;
    align-items: center;
    min-height: var(--header-top-height-desktop);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.logo {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #FFF;
}

.desktop-nav-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    color: #FFF;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--button-shadow);
    border: none;
    cursor: pointer;
    font-size: 0.95em;
}

.btn-register {
    background: var(--button-bg-register);
}
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.btn-login {
    background: var(--button-bg-login);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.btn-download {
    background: var(--button-bg-download);
}
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.hamburger-menu {
    display: none; /* Hidden on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-menu .bar {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 6px 0;
    transition: 0.4s;
    border-radius: 2px;
}

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

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

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

.mobile-buttons-area {
    display: none; /* Hidden on desktop */
    background-color: var(--dark-red-variant);
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    min-height: var(--mobile-buttons-height);
    z-index: 990; /* Below overlay and menu */
}

.mobile-buttons-container {
    width: 100%;
    max-width: none; /* Ensure full width on mobile */
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 15px;
}

.main-nav {
    background-color: var(--primary-color);
    width: 100%;
    padding: 10px 0;
    display: flex; /* Default to flex for desktop */
    flex-direction: row; /* Default to row for desktop */
    justify-content: center;
    align-items: center;
    min-height: var(--main-nav-height-desktop);
    transition: transform 0.3s ease; /* For mobile menu animation */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 25px;
    padding: 0 20px;
}

.nav-link {
    color: var(--dark-text-color);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 15px;
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    border-radius: 5px;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

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

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

/* Footer styles */
.site-footer {
    background-color: var(--dark-red-variant);
    color: var(--text-color);
    padding: 40px 20px;
    font-size: 0.9em;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-column h3,
.footer-column h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-column p {
    margin-bottom: 10px;
}

.footer-column a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    color: rgba(255, 255, 255, 0.7);
}

/* Media queries for mobile */
@media (max-width: 768px) {
    body {
        padding-top: calc(var(--header-top-height-mobile) + var(--mobile-buttons-height)); /* Adjusted for mobile header + buttons by JS */
    }

    .site-header {
        min-height: auto;
    }

    .header-top {
        padding: 10px 0;
        min-height: var(--header-top-height-mobile);
    }

    .header-container {
        padding: 0 15px;
        width: 100%;
        max-width: none;
        justify-content: space-between;
    }

    .logo {
        font-size: 1.8em;
        flex-grow: 1; /* Allow logo to take available space */
        text-align: center;
        order: 2; /* Position logo in center */
    }

    .hamburger-menu {
        display: block; /* Show hamburger on mobile */
        order: 1; /* Position hamburger to the left */
        margin-right: auto; /* Push logo to center */
    }

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

    .mobile-buttons-area {
        display: block; /* Show mobile buttons area */
    }

    .mobile-buttons-container {
        padding: 0 15px;
        width: 100%;
        max-width: none;
    }

    .main-nav {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        top: calc(var(--header-top-height-mobile) + var(--mobile-buttons-height) + 1px); /* Below header-top and mobile buttons */
        left: 0;
        width: 80%; /* Sidebar width */
        max-width: 300px;
        height: calc(100vh - (var(--header-top-height-mobile) + var(--mobile-buttons-height) + 1px)); /* Full height below header */
        background-color: var(--light-gold-variant);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
        transform: translateX(-100%); /* Start off-screen */
        z-index: 1000; /* Above overlay */
        overflow-y: auto;
    }

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

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 0;
        width: 100%;
        max-width: none;
    }

    .nav-link {
        width: 100%;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        color: var(--dark-text-color);
    }

    .nav-link:hover {
        background-color: var(--primary-color);
        color: #FFF;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-nav {
        align-items: center;
    }
}