/* Base Styles */
:root {
    --primary-color: #007BFF;
    --secondary-color: #FFC107;
    --dark-bg: #222;
    --light-text: #f8f9fa;
    --dark-text: #333;
    --accent-color-1: #28a745; /* For Tải App button */
}

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

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

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none; /* Remove underline for buttons */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
    color: var(--light-text);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, var(--primary-color));
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-secondary {
    background: linear-gradient(45deg, var(--secondary-color), #d39e00);
    color: var(--dark-text);
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #d39e00, var(--secondary-color));
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-tertiary {
    background: linear-gradient(45deg, var(--accent-color-1), #218838);
    color: var(--light-text);
    border: none;
}

.btn-tertiary:hover {
    background: linear-gradient(45deg, #218838, var(--accent-color-1));
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Header Styles (Desktop First) */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 60px; /* Use min-height */
    background-color: var(--dark-bg);
    color: var(--light-text);
    display: flex;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.site-header .logo {
    font-size: 28px;
    font-weight: bold;
    color: var(--secondary-color);
    text-decoration: none;
    margin-right: 20px;
    display: block; /* Ensure logo is always visible */
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.site-header .logo:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.main-nav ul {
    display: flex;
    flex-direction: row;
    gap: 25px;
}

.main-nav a {
    color: var(--light-text);
    font-weight: bold;
    font-size: 16px;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

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

.desktop-nav-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.hamburger-menu,
.mobile-buttons-area,
.mobile-menu-overlay {
    display: none; /* Hidden by default on desktop */
}

/* Footer Styles */
.site-footer {
    background-color: var(--dark-bg);
    color: var(--light-text);
    padding: 40px 20px;
    font-size: 14px;
    margin-top: 50px;
}

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

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

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

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

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

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

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

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--secondary-color);
    text-decoration: none;
    display: block;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.footer-logo:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-description {
    line-height: 1.8;
    color: #bbb;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.copyright {
    color: #aaa;
}

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

    .site-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 15px;
        min-height: unset;
    }

    .site-header .logo {
        font-size: 24px;
        margin: 0;
        flex-grow: 1; /* Allow logo to take available space */
        text-align: center;
        order: 1;
    }

    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001; /* Above mobile-buttons-area */
        order: 0;
    }

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

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

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

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

    .main-nav {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--dark-bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 60px 20px 20px;
        transform: translateX(-100%); /* Slide out to the left */
        transition: transform 0.3s ease-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
        z-index: 1002; /* Above overlay */
    }

    .main-nav.active {
        display: flex; /* CRITICAL: Ensure it becomes visible */
        transform: translateX(0); /* Slide in */
    }

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

    .main-nav ul li {
        width: 100%;
        border-bottom: 1px solid #333;
    }

    .main-nav ul li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: 15px 10px;
        font-size: 18px;
        color: var(--light-text);
    }

    .main-nav a:hover {
        background-color: #333;
        color: var(--primary-color);
    }

    .main-nav a::after {
        display: none;
    }

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

    .mobile-buttons-area {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        padding: 10px 0;
        background-color: #333;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        order: 2; /* Below logo and hamburger */
        z-index: 999; /* Below hamburger menu */
    }

    .mobile-buttons-area .btn {
        flex: 1 1 auto; /* Allow buttons to grow/shrink */
        max-width: 150px;
        font-size: 14px;
        padding: 8px 15px;
    }

    /* Header top row for hamburger and logo */
    .site-header::before {
        content: '';
        display: flex;
        width: 100%;
        height: 50px; /* Fixed height for the top row */
        position: absolute;
        top: 0;
        left: 0;
        background-color: var(--dark-bg);
        z-index: -1; /* Behind logo and hamburger */
    }

    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 1001; /* Between menu and main content */
        transition: opacity 0.3s ease-out;
        opacity: 0;
    }

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

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

    .footer-column ul {
        padding-left: 0;
    }
}

body.no-scroll {
    overflow: hidden;
}