/* GLOBAL THEME COLORS */
:root {
    --color-dark-primary: #212121; /* Body Background */
    --color-dark-secondary: #333333; /* For deeper backgrounds or modals */
    --color-accent-gold: #D7AA29; /* Primary branding color */
    --color-text-light: #DAD9DDA3; /* Light gray text for contrast */
    --color-text-white: #DAD9D4; /* Pure white text */
    --color-error-red: #AE1711; /* Error bars/notifications */
    --spacing-unit: 8px; /* Base unit for margins/paddings */
}

/* BASE STYLES */
body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--color-dark-primary);
    color: var(--color-text-light);
    margin: 0;
    padding-top: calc(80px + env(safe-area-inset-top)); /* BACK TO STABLE LOGIN HEIGHT */
    -webkit-text-size-adjust: 100%;
}

/* TYPOGRAPHY RESET */
h1, h2, h3, h4, p, ul, li {
    margin: 0;
    padding: 0;
    color: var(--color-text-white);
}

/* ACCENT STYLES */
a {
    color: var(--color-accent-gold);
    text-decoration: none;
    font-weight: 500;
}

/* MAIN LAYOUT CONTAINER */
#app-container {
    padding-top: calc(50px + env(safe-area-inset-top)); 
    width: 100%;
    min-height: 100vh;
}

/* --- HEADER STYLES --- */
#app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding-top: env(safe-area-inset-top);
    height: calc(50px + env(safe-area-inset-top));
    background-color: var(--color-dark-primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 15px;
}

.header-logo {
    height: 28px; /* Standardizing logo size */
    width: auto;
    object-fit: contain;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    min-width: 40px; /* Ensures spacing */
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    flex-grow: 1;
    text-align: center;
}

.header-right {
    justify-content: flex-end;
}

.icon {
    height: 24px;
    filter: invert(100%) saturate(200%); /* Makes icons white/light and pop */
    cursor: pointer;
}

.hidden {
    display: none;
}

/* --- HEADER STYLES FIX --- */
#app-header {
    height: 50px; /* Ensures the fixed top bar is consistently sized */
}

/* Ensure the logo image fits within the header height */
.header-logo {
    height: 40px; /* Constraint image height */
    width: auto;
    object-fit: contain;
}

/* Base style for navigation buttons */
.nav-button {
    padding: 10px 15px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

/* Hollow Button Style (Black border/text) */
.btn-hollow {
    background: transparent;
    border: 2px solid var(--color-text-light);
    color: var(--color-text-light);
    transition: background 0.3s ease;
}

/* Accent Button Style (Gold fill) */
.btn-accent {
    background-color: var(--color-accent-gold);
    color: var(--color-dark-primary);
    border: none;
    font-weight: bold;
}

/* --- SIDE MENU STYLES --- */
#side-menu-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%; /* Takes up 80% of the screen width */
    height: 100vh;
    background-color: var(--color-dark-secondary);
    z-index: 150;
    /* Initially push the menu off-screen to the right */
    transform: translateX(100%); 
    transition: transform 0.3s ease-in-out;
}

/* --- SIDE MENU STYLES --- */
#menu-placeholder { /* Target the container we inject the menu into */
    position: fixed;
    top: 0;
    right: 0;
    width: 80%; /* Takes up 80% of the screen width */
    height: 100vh;
    background-color: var(--color-dark-secondary);
    z-index: 150;
    /* CRITICAL: Initially push the menu off-screen to the right */
    transform: translateX(100%); 
    transition: transform 0.3s ease-in-out;
}

#menu-placeholder.open { /* Class added by JS when menu is clicked */
    transform: translateX(0); /* Slide menu into view */
}

/* Style for the inner navigation element */
#side-menu-nav {
    width: 100%;
    height: 100%;
}

.menu-content-wrapper {
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* --- APP STRUCTURE FIX --- */

/* Ensure the body is sized correctly for the mobile view */
body {
    width: 100%;
    min-height: 100vh;
}

/* This container holds all content below the fixed header */
#app-container {
    padding-top: 50px; /* Space for the fixed header (50px height) */
    width: 100%;
    /* Override absolute positioning we disabled earlier */
    position: relative; 
    z-index: 1; 
}

/* The element that is currently staying permanently visible (the side menu) */
#menu-placeholder {
    /* Initially hide or push the menu off-screen */
    position: fixed;
    top: 0;
    right: 0;
    width: 80%; 
    height: 100vh;
    transform: translateX(100%); 
    transition: transform 0.3s ease-in-out;
    z-index: 150;
    background-color: var(--color-dark-secondary);
}

/* The actual menu inside the placeholder */
#side-menu-nav {
    transform: translateX(0) !important; /* Reset the inner menu transform */
    width: 100% !important; /* Fix width calculation */
    height: 100% !important;
}

/* Fix: The main content area should not be static */
#page-content {
    padding-top: 0 !important;
    padding-left: 0 !important;
}

/* Ensure the header is correctly styled */
#app-header {
    background-color: var(--color-dark-primary);
}