/* =========================================
   1. RESET & BASE STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    min-height: 100dvh;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden; /* Prevents side-scrolling when menu is hidden */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* =========================================
   2. STICKY NAVBAR
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: linear-gradient(to bottom, #1a1a1a env(safe-area-inset-top), rgba(26, 26, 26, 0.98) env(safe-area-inset-top));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: opacity 0.3s;
    margin-right: auto;
}

.nav-logo:hover {
    opacity: 0.8;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between Login and Three-prong icon */
    flex-shrink: 0;
    margin-left: auto;
}

.nav-welcome {
    color: #e0e0e0;
    font-size: 13px;
    letter-spacing: 0.2px;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* RELATIVELY BIGGER LOGIN BUTTON */
.nav-login-btn {
    background: #D4A574;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-login-btn:hover {
    background: #E5C17A;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(212, 165, 116, 0.2);
}

.settings-menu {
    cursor: pointer;
    font-size: 24px;
    color: #ffffff;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
    transition: color 0.3s;
    z-index: 2001;
}

.settings-menu:hover {
    color: rgba(255, 255, 255, 0.7);
}

.settings-menu i {
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
}

.settings-menu.active i.fa-bars {
    opacity: 0;
    transform: rotate(180deg);
}

.settings-menu::after {
    content: '×';
    position: absolute;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    opacity: 0;
    transform: rotate(-90deg);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    color: #ffffff;
}

.settings-menu.active::after {
    opacity: 1;
    transform: rotate(0deg);
}

/* =========================================
   3. SIDE MENU (SLIDE OUT)
   ========================================= */
.side-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 350px;
    height: 100%;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    padding: 100px 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 50px rgba(0,0,0,0.6);
}

/* JS toggles this class */
.side-menu.active {
    right: 0;
}

.menu-close {
    position: fixed;
    top: 16px;
    right: 24px;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    color: #ffffff;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 2002;
}

body.menu-open .menu-close {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.menu-close:hover {
    opacity: 0.7;
    transform: rotate(90deg);
}

.menu-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 30px;
}

.menu-links a {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 30px;
    transition: 0.3s;
}

.menu-links a:hover {
    color: #D4A574;
    padding-left: 10px;
}

.menu-logout-button {
    border: 1px solid rgba(212, 165, 116, 0.6);
    background: transparent;
    color: #f5e6c8;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.menu-logout-button:hover {
    background: rgba(212, 165, 116, 0.15);
    border-color: rgba(212, 165, 116, 0.95);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1500;
    display: none;
}

.menu-overlay.active {
    display: block;
}

.logout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    padding: 20px;
}

.logout-modal-overlay.active {
    display: flex;
}

.logout-modal {
    width: min(420px, 100%);
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    padding: 24px 22px;
}

.logout-modal h2 {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 8px;
}

.logout-modal p {
    color: #c9c9c9;
    font-size: 15px;
}

.logout-modal-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-logout-cancel,
.btn-logout-confirm {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-logout-cancel {
    background: #3a3a3a;
    color: #efefef;
}

.btn-logout-confirm {
    background: #d4a574;
    color: #1d1d1d;
}

/* =========================================
   4. HERO SECTION (COFFEE IMAGE)
   ========================================= */
.hero {
    height: 65vh;
    min-height: 400px;
    width: 100%;
    /* High-quality coffee background */
    background: url('https://images.unsplash.com/photo-1495474472287-4d71bcdd2085?q=80&w=2070') no-repeat center center/cover;
    background-attachment: fixed;
    position: relative;
    margin-top: calc(64px + env(safe-area-inset-top));
}

@media (max-width: 768px) {
    .hero {
        height: 55vh;
        min-height: 320px;
        background-attachment: scroll;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5); /* Darkens image so text is readable */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hero-overlay h1 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    color: #ffffff;
    padding: 0 20px;
    line-height: 1.2;
}

@media (max-width: 480px) {
    .hero-overlay h1 {
        font-size: 1.5rem;
        letter-spacing: 1px;
        padding: 0 16px;
    }
}

/* =========================================
   5. MAIN CONTENT AREA
   ========================================= */
.main-content {
    padding: calc(80px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.content-card {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 16px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 16px 64px rgba(0, 0, 0, 0.04),
        0 32px 128px rgba(0, 0, 0, 0.02);
    max-width: 600px;
    width: 100%;
    padding: 50px 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.debug-card {
    max-width: 760px;
    text-align: left;
}

.debug-title {
    font-size: 28px;
    margin-bottom: 14px;
    color: #ffffff;
}

.session-debug-output {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: #d8d8d8;
    overflow: auto;
    max-height: 420px;
    font-size: 13px;
    line-height: 1.45;
}

.description {
    color: #a0a0a0;
    font-size: 18px;
    margin-bottom: 32px;
}

/* SIGNUP LINK COLOR (Reverted to your preferred deep gold) */
.signup-link {
    text-align: center;
    color: #a0a0a0;
    font-size: 15px;
}

.signup-link a {
    color: #D4A574;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease;
}

.signup-link a:hover {
    color: #E5C17A;
}

/* =========================================
   6. RESPONSIVE QUERIES
   ========================================= */

/* Landscape mode fix - prevent hero from stretching */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        min-height: 100vh;
        margin-top: 64px;
    }

    .hero-overlay h1 {
        font-size: 1.8rem;
    }

    .main-content {
        padding: 30px 20px;
    }
}

@media (max-width: 600px) {
    .side-menu {
        width: 100%; /* Full screen on mobile */
    }

    .nav-logo {
        font-size: 14px;
    }

    .nav-logo-text {
        display: none; /* Skull/logo image only on phone */
    }

    .logo-img {
        height: 40px;
    }

    .content-card {
        padding: 30px 20px;
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.15),
            0 4px 16px rgba(0, 0, 0, 0.12),
            0 8px 32px rgba(0, 0, 0, 0.08),
            0 16px 64px rgba(0, 0, 0, 0.04),
            0 32px 128px rgba(0, 0, 0, 0.02);
    }

    .nav-login-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .main-content {
        padding: 40px 16px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 14px;
    }

    .nav-welcome {
        max-width: 34vw;
        font-size: 12px;
    }

    .menu-links a {
        font-size: 18px;
        margin-bottom: 24px;
    }

    .menu-logout-button {
        width: 100%;
    }

    .logout-modal {
        padding: 18px 16px;
        border-radius: 12px;
    }

    .logout-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-logout-cancel,
    .btn-logout-confirm {
        width: 100%;
    }
}