/*
* Base Styles
* Contains global styles for the entire application
*/

/* Box-sizing rule to simplify padding and border calculations */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Resets and base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #3e342a; /* Using the text-color variable value */
    background-color: #f5f2ed; /* Using the light-bg variable value */
}

/* General container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.full-width {
    width: 100%;
}

/* Header styles */
.main-header {
    background: #fff;
    color: #7a6855;
    padding: 1rem 0;
    border-bottom: 2px solid #7a6855;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.logo-container img {
    max-height: 50px;
}

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

.main-nav a {
    color: #7a6855; /* Changed to primary-color */
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: #7a6855; /* Changed to primary-color */
    color: #fff;
}

/* Footer styles */
.main-footer {
    text-align: center;
    padding: 1rem;
    background: #e9ecef;
    color: #6c757d;
    border-top: 1px solid #e5ded5; /* Using border-color variable value */
    margin-top: 2rem;
}

/* Button styles */
.primary-btn {
    background: #7a6855; /* Changed to primary-color */
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
}

.primary-btn:hover {
    background: #5d4c3c; /* Changed to primary-dark */
}

.cancel-btn {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 5px;
    font-size: 0.9rem;
}

.cancel-btn:hover {
    background: #495057;
}

.login-btn {
    background: #7a6855; /* Changed to primary-color */
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
}

.login-btn:hover {
    background: #5d4c3c; /* Changed to primary-dark */
}

/* Form styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form input {
    padding: 0.75rem;
    border: 1px solid #e5ded5; /* Using border-color variable value */
    border-radius: 5px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #3e342a; /* Using text-color variable value */
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5ded5; /* Using border-color variable value */
    border-radius: 5px;
}

/* Modal styles */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 1rem;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.hidden {
    display: none !important;
}

/* Auth card styles */
.auth-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Using box-shadow variable value */
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card h2 {
    margin-bottom: 1.5rem;
    color: #7a6855; /* Changed to primary-color */
}

.auth-message {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Error message styles */
.error-message {
    color: #dc3545;
    margin-top: 0.5rem;
}

/* User profile styles */
.user-profile {
    display: flex;
    align-items: center;
}

.user-profile-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-username {
    font-size: 13px;
    color: #5d4c3c;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.8;
}

.profile-picture {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-dropdown {
    position: absolute;
    top: 5rem;
    right: 0;
    background: #fff;
    border: 1px solid #e5ded5; /* Using border-color variable value */
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Using box-shadow variable value */
    padding: 0.5rem 0;
    z-index: 1001;
}

.dropdown-username {
    padding: 0.5rem 1rem;
    font-weight: bold;
    color: #3e342a; /* Using text-color variable value */
}

.dropdown-divider {
    height: 1px;
    background-color: #e5ded5; /* Using border-color variable value */
    margin: 0.5rem 0;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #7a6855; /* Changed to primary-color */
}

.dropdown-item:hover {
    background-color: #f5f2ed; /* Using light-bg variable value */
}

/* Placeholder content */
.placeholder-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    margin-top: 2rem;
}

/* Responsive Styles */
/* Update to styles.css to fix mobile navigation */

/* Keep the existing media query but modify the nav styles */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-bottom: 0.5rem;
    }

    /* Change these styles to keep nav horizontal */
    .main-nav {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .main-nav > ul {
        /* Keep this flex but not column */
        flex-direction: row; 
        justify-content: center;
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .main-nav li {
        text-align: center;
        /* Make items smaller to fit */
        flex: 1;
        max-width: 25%; /* Since you have 4 items */
    }
    
    .main-nav a {
        padding: 0.4rem 0.2rem;
        font-size: 0.9rem;
        /* Ensure flex children fill parent */
        width: 100%;
        display: block;
    }

    .container {
        padding: 1rem;
    }
}

/* Add additional styles for even smaller screens */
@media (max-width: 400px) {
    .main-nav a {
        font-size: 0.8rem;
        padding: 0.3rem 0.1rem;
    }
}

/* Specific to keep login button from flashing */
#loginBtn {
    display: block;  /* Override any previous 'none' */
    visibility: visible; /* Ensure it's visible */
}

#loginBtn.hidden {
    display: none; /* Or visibility: hidden; */
}

/* ==============================
   ROOT VARIABLES - Color Scheme from the 471-line CSS
   ============================== */
:root {
    --primary-color: #7a6855;
    --primary-dark: #5d4c3c;
    --secondary-color: #d6c9bb;
    --text-color: #3e342a;
    --light-bg: #f5f2ed;
    --border-color: #e5ded5;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --button-bg: #7a6855;
    --button-hover: #5d4c3c;
    --ticket-bg: #fff;
    --status-complete-bg: #7a6855;
    --status-complete-text: white;
    --status-pending-text: #7a6855;
    --status-pending-bg: #f0e9e2;
    --button-radius: 5px; /* For rounded corners on buttons */
    --nav-radius: 4px; /* For rounded corners on nav items */
}

/* Adjust main navigation styles */
.main-nav a {
    color: var(--text-color); /* Ensure text color is consistent */
    border-radius: var(--nav-radius); /* Apply rounded corners */
}

.main-nav a:hover,
.main-nav a.active {
    background-color: var(--primary-color); /* Use brown for active/hover */
    color: white;
}

/* Adjust buttons */
button,
.primary-btn,
.login-btn {
    background-color: var(--primary-color); /* Brown background */
    border-radius: var(--button-radius); /* Rounded corners */
}

button:hover,
.primary-btn:hover,
.login-btn:hover {
    background-color: var(--primary-dark); /* Darker brown on hover */
}

/* Modifying the modal header */
.modal-content h2 {
    color: var(--primary-color); /* Brown header text */
}

/* Mobile header layout fixes */
@media (max-width: 768px) {
    /* Reset the existing column layout */
    .main-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.5rem;
    }
    
    /* Logo left, profile right, nav below */
    .logo-container {
        flex: 0 0 auto;
        margin-right: auto;
        order: 1;
    }
    
    .user-profile {
        flex: 0 0 auto;
        margin-left: auto;
        order: 2;
    }
    
    .main-nav {
        width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }
    
    /* Ensure nav links are properly spaced */
    .main-nav > ul {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    
    .main-nav li {
        flex: 1 1 auto;
        text-align: center;
    }
    
    .main-nav a {
        padding: 0.4rem 0.2rem;
        font-size: 0.9rem;
    }
    
    /* Fix profile picture and button sizing */
    .profile-picture {
        width: 35px;
        height: 35px;
    }
    
    #loginBtn {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Ensure dropdown is properly positioned */
    .profile-dropdown {
        top: 45px;
        right: 0;
    }

    /* The top text nav is replaced by the hamburger menu (mobile-menu.js)
       on mobile - it was duplicating the bottom-nav and its dropdown was
       causing horizontal overflow/scroll. Hide it here; mobile-menu.css
       repositions the logo to the center and adds the hamburger button. */
    .main-header .main-nav,
    .main-nav,
    .nav-more,
    .nav-more-trigger,
    .nav-more-dropdown {
        display: none !important;
    }
}

/* Even smaller screens */
@media (max-width: 400px) {
    .logo-container img {
        max-height: 35px;
    }
    
    .profile-picture {
        width: 30px;
        height: 30px;
    }
    
    .main-nav a {
        font-size: 0.8rem;
        padding: 0.3rem 0.1rem;
    }
    
    #loginBtn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}
.delete-btn {
    background-color: #f44336;  /* Red color for delete button */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background-color: #d32f2f;  /* Darker red on hover */
}

/* Add this to your styles.css file to center auth checks on all pages */

/* Enhanced auth check styling - matches index.html */
.auth-check {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 20px;
}

.auth-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.auth-card h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.auth-message {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Responsive adjustments for auth check */
@media (max-width: 768px) {
    .auth-check {
        min-height: 300px;
        padding: 15px;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-check {
        min-height: 250px;
        padding: 10px;
    }
    
    .auth-card {
        padding: 1rem;
    }
}
/* ── Google Sign-In button ───────────────────────────────────────────────── */
.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.google-signin-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.google-signin-btn:active {
  background: #f1f3f4;
}

/* When used as authLoginBtn inside auth-card */
.auth-card .google-signin-btn {
  margin: 0 auto;
  padding: 10px 24px;
  font-size: 15px;
}

/* ── Auth loading screen ──────────────────────────────────────────────────── */
/* Shown immediately on page load while Firebase checks session.              */
/* Replaced by real auth-card only if the user is genuinely signed out.       */

.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 16px;
}

.auth-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5ded5;
    border-top-color: #7a6855;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-loading-text {
    font-size: 13px;
    font-weight: 600;
    color: #7a6855;
    letter-spacing: 0.3px;
}

/* Hide the real sign-in card until auth confirms signed-out state */
.auth-check .auth-card {
    display: none;
}

.auth-check.confirmed-signed-out .auth-loading {
    display: none;
}

.auth-check.confirmed-signed-out .auth-card {
    display: block;
}

/* ── ViaMyVA Login Modal ──────────────────────────────────────────────────── */

#viaLoginModal {
  position: fixed;
  inset: 0;
  background: rgba(62, 52, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#viaLoginModal.hidden { display: none; }

.via-login-card {
  background: #faf8f5;
  border-radius: 14px;
  padding: 2.5rem 2rem 2rem;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 16px 48px rgba(62, 52, 42, 0.22);
  position: relative;
  text-align: center;
  animation: viaLoginFadeIn 0.2s ease;
}

@keyframes viaLoginFadeIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.via-login-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #9e8e80;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.via-login-close:hover { color: #3e342a; }

.via-login-logo {
  height: 36px;
  margin-bottom: 1.4rem;
}

.via-login-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e5ded5;
  border-radius: 8px;
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  color: #3e342a;
  background: #fff;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 0.6rem;
  display: block;
}
.via-login-field:focus { border-color: #7a6855; }

.via-login-error {
  min-height: 1.2em;
  font-size: 0.8rem;
  color: #c0392b;
  margin: 0 0 0.75rem;
}

.via-login-submit {
  width: 100%;
  padding: 0.8rem;
  background: #7a6855;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s;
}
.via-login-submit:hover   { background: #5d4c3c; }
.via-login-submit:disabled { background: #b0a090; cursor: not-allowed; }

/* ==============================
   MORE DROPDOWN NAV
   ============================== */

.nav-more {
    position: relative;
}

.nav-more-trigger {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 5px;
    transition: color 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.nav-more-trigger::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.6;
    transition: transform 0.2s;
    margin-top: 1px;
}

.nav-more.is-open .nav-more-trigger::after {
    transform: rotate(180deg);
}

/* Full-page transparent backdrop -- sits BELOW the sticky header (z-index 500)
   so page content clicks close the dropdown without covering the header itself */
.nav-more-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 499;
    background: transparent;
}
.nav-more-backdrop.is-visible {
    display: block;
}

/* Active state when on a More page */
.nav-more-active .nav-more-trigger {
    color: var(--accent-color, #BB5D4C);
    font-weight: 700;
}

.nav-more-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(74, 55, 40, 0.13);
    min-width: 140px;
    padding: 6px 0;
    list-style: none;
    margin: 0;
    z-index: 600;
    animation: moreDropIn 0.15s ease;
}

.nav-more.is-open .nav-more-dropdown {
    display: block;
}

.nav-more-dropdown li a {
    display: block;
    padding: 9px 18px;
    font-size: 14px;
    color: #4a3728;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
    border-radius: 0;
}

.nav-more-dropdown li a:hover {
    background: #f5efe6;
    color: #BB5D4C;
}

.nav-more-dropdown li a.active {
    color: #BB5D4C;
    font-weight: 700;
    background: #fdf8f3;
}

@keyframes moreDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Top menu customizer (profile page) */
.navc-hint { font-size: 0.85rem; color: #7a6855; margin: 0 0 10px; }
.navc-list { display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
.navc-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #faf6f0; border-radius: 8px; }
.navc-label { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; }
.navc-btn { border: 1px solid #d9cdbb; background: #fff; border-radius: 6px; width: 30px; height: 28px; cursor: pointer; font-size: 0.7rem; color: #6B3F2A; }
.navc-btn:disabled { opacity: 0.35; cursor: default; }
.navc-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.navc-reset { background: none; border: none; color: #7a6855; text-decoration: underline; cursor: pointer; font-size: 0.9rem; }
.navc-msg { font-size: 0.85rem; color: #6B3F2A; }
