/* public/css/public/styles.css */

/* =====================================================================
   GLOBAL DESIGN SYSTEM VARIABLES
   ===================================================================== */
:root {
    --brand-blue: #104776;
    --brand-teal: #6fada3;
    --brand-gold: #b08c57;
    --lightgray: #f2f2f2;

    --primary: var(--brand-blue);
    --secondary: var(--brand-teal);
    --primary-foreground: #fff;
    --foreground: hsl(225, 30%, 20%);
    --background: #fff;
    --card: #fff;
    --border: hsl(220, 20%, 93%);
    --input: hsl(220, 20%, 93%);
    --brand-blue-light: hsl(210, 85%, 95%);
    --ring: var(--brand-blue);
    --accent: var(--brand-gold);
    --radius: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --button-gold: var(--brand-gold);
    --button: var(--brand-teal);
    --light-background: var(--lightgray);
    --shadow-card: 0 4px 15px -4px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 25px -8px rgba(0,0,0,0.25);
}

/* =====================================================================
   BASE ELEMENTS
   ===================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.6;

    /* REQUIRED for fixed footer */
    padding-bottom: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hidden { display: none !important; }
.modal-open { overflow: hidden; }

/* =====================================================================
   HEADER (Google Style)
   ===================================================================== */
.header {
    background: var(--background);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 2.2rem;
    height: 2.2rem;
    background: var(--primary);
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--foreground);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.nav-link {
    color: hsl(225, 15%, 50%);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem;
    transition: color 0.2s;
    font-weight: 500;
}
.nav-link:hover { color: var(--primary); }

.account-actions {
    display: flex;
    gap: 1rem;
    margin-left: 2rem;
}

.account-actions a {
    color: var(--primary);
    font-size: 0.9rem;
    text-decoration: none;
}

.account-actions button {
    background: var(--button-gold);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
}

/* =========================================
   GLOBAL HEADER
   ========================================= */
/* ===== GLOBAL HEADER ===== */
.smm-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.25s ease-in-out; /* smooth sticky mode */
}

/* Header container (DESKTOP default) */
.smm-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.1rem 1rem; /* taller header */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo */
.smm-logo {
    display:flex;
    align-items:center;
    text-decoration:none;
    margin-right: 1.5rem;
}
.smm-logo-img {
    height: 60px; /* bigger logo */
    width: auto;
    transition: height 0.25s ease-in-out;
}

/* Search Bar */
.smm-search-bar {
    flex: 1;
    max-width: 650px;
    margin: 0 auto;  /* centers search bar between logo and sign-in */
    display: flex;
    align-items: center;
    background: #f1f3f4;
    border-radius: 999px;
    padding: 0.55rem 1.2rem;
    border: none !important;
    transition: all 0.25s ease-in-out;
}
.smm-search-bar input {
    flex: 1;
    border: none !important;
    background: transparent;
    font-size: 1rem;
    padding: 0.3rem;
}
.smm-search-bar input:focus,
.smm-search-bar:focus-within {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}
.smm-search-bar button {
    border: none;
    background: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--primary);
}

/* Right side actions */
.smm-actions {
    display: flex;
    align-items: center;
    margin-left: auto;  /* pushes sign in to extreme right */
}

/* Gold SignIn Button */
.smm-btn-gold {
    padding: 0.55rem 1.4rem;
    border-radius: 6px;
    background: var(--accent); /* Gold Accent Color */
    color: white;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

/* =====================================================================
 * PROFILE UI (smm-profile, profile-circle, profile-menu)
 * ===================================================================== */

/* --- PROFILE CONTAINER (The Clickable Area / Positioning Context) --- */
.smm-profile {
    /* CRITICAL FIX: Sets this element as the reference point for the absolute menu positioning */
    position: relative;
    z-index: 101;
    /* Ensure the user can click the whole area to trigger the menu */
    line-height: 1; 
    padding-bottom: 5px; /* Creates the invisible bridge */
    margin-bottom: -5px; /* Prevents the padding from pushing content down */
}

/* Profile Circle (The Gold Square Icon) */
.profile-circle {
    width: 42px;
    height: 42px;
    background: var(--accent); /* Gold Accent Color */
    color: white;
    border-radius: 6px; /* Square/Rounded corners */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.2rem;
}

/* --- DROPDOWN MENU CONTAINER --- */
.profile-menu {
    /* FIX 1: Default State: Hidden and Absolutely positioned relative to .smm-profile */
    display: none; 
    position: absolute;
    right: 0;
    top: 48px; /* Position directly below the 42px circle + margin */
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 220px; /* Ensures all menu items are readable */
    box-shadow: var(--shadow-card);
    z-index: 99;
    
    /* FIX 2: Force vertical stacking */
    padding: 0;
    flex-direction: column; 
}

/* FIX 3: Activation State (Show menu on hover over the entire smm-profile area) */
.smm-profile:hover .profile-menu { 
    display: flex; /* Overrides display:none */
}

/* --- MENU ITEMS AND ICONS --- */
.profile-menu a, 
.profile-menu button {
    padding: 0.65rem 1rem; 
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--foreground);
    font-weight: 500;
    
    /* Ensure icon and text align */
    display: flex; 
    align-items: center;
    gap: 0.75rem; 
    text-decoration: none;
    transition: background 0.15s;
}

.profile-menu a:hover, 
.profile-menu button:hover {
    background: var(--lightgray);
}

/* FIX 4: Gold Icon Coloring */
.profile-menu i {
    color: var(--accent); /* Gold color for all utility icons */
    width: 1.25rem; 
    text-align: center;
}

/* Specific Sign Out button color (using system defined red) */
.profile-menu button.text-danger {
    color: #DC3545; 
}

/* ===== Sticky Compact Mode (Google style) ===== */
.smm-header.compact .smm-header-inner {
    padding: 0.55rem 2rem;
}
.smm-header.compact .smm-logo-img {
    height: 44px;
}
.smm-header.compact .smm-search-bar {
    max-width: 450px;
    padding: 0.45rem 1rem;
}

/* ===========================
   MOBILE HEADER BEHAVIOR
   =========================== */
@media (max-width: 768px) {

    /* allow wrapping to get 2 rows: [logo | signin] + [search full width] */
    .smm-header-inner {
        flex-wrap: wrap;
        padding: 0.8rem 1rem;
    }

    .smm-logo {
        margin-right: 0.75rem;
    }

    .smm-logo-img {
        height: 48px;
    }

    .smm-actions {
        margin-left: auto;
    }

    /* Full-width search bar on mobile when present */
    .smm-header-inner.has-search .smm-search-bar {
        flex: 0 0 100%;
        max-width: 100%;
        margin: 0.75rem 0 0 0; /* second row */
    }

    .smm-btn-gold {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}


/* =====================================================================
   ====== 404 ======
   ===================================================================== */
/* --- ERROR CONTENT STYLING --- */
    .error-container {
        text-align: center;
        max-width: 500px;
        padding: 40px 20px;
        margin-bottom: 80px; /* Space above footer */
    }
    .error-code {
        font-size: 80px;
        font-weight: 800;
        color: var(--accent); /* Gold accent for warning/attention */
        line-height: 1;
        margin-bottom: 10px;
    }
    .error-message {
        font-size: 20px;
        font-weight: 600;
        color: var(--foreground);
        margin-bottom: 25px;
    }
    .error-suggestion {
        font-size: 16px;
        color: var(--subtle-text);
        margin-bottom: 30px;
    }



/* =====================================================================
   HERO SECTION — Mobile First
   ===================================================================== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    text-align: center;
}

.hero-content {
    width: 100%;
    max-width: 42rem;
}

.hero-logo-main {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.hero-logo-main .logo-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.8rem;
}

.hero-logo-main .logo-text {
    font-size: 2.2rem;
    font-weight: 400;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
    background: #fff;
    box-shadow: var(--shadow-card);
}

.search-input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--brand-blue-light);
}

.search-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    font-size: 1rem;
    background: var(--button);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover { opacity: 0.9; }

.language-bar {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: hsl(225, 15%, 50%);
}

.language-bar a {
    color: var(--primary);
    text-decoration: none;
    margin: 0 0.3rem;
    font-weight: 500;
}

.language-bar a:hover { text-decoration: underline; }

/* =====================================================================
   DESKTOP HERO OVERRIDES
   ===================================================================== */
@media (min-width: 600px) {
    .hero {
        min-height: calc(100vh - 12rem);
        padding: 4rem 0;
        justify-content: center;
    }

    .hero-logo-main .logo-icon {
        width: 4.5rem;
        height: 4.5rem;
        font-size: 2.5rem;
    }

    .hero-logo-main .logo-text {
        font-size: 3.5rem;
    }

    .search-input {
        padding: 1.1rem 4rem 1.1rem 1.5rem;
    }

    .search-btn {
        position: absolute;
        top: 50%;
        right: 0.5rem;
        transform: translateY(-50%);
        width: auto;
        margin-top: 0;
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}


/* ========== MOBILE HEADER FIXES ========== */
@media (max-width: 600px) {
    .nav-link[data-menu="about"] {
        display: none !important;
    }
}

/* ========== MOBILE HERO — FULL CENTER ALIGNMENT ========== */
@media (max-width: 600px) {
    .hero {
        justify-content: center !important;
        align-items: center !important;
        min-height: calc(80vh - 6rem);
        padding: 2rem 1rem;
        text-align: center;
    }
}

/* ========== MOBILE LOGO REDUCTION ========== */
@media (max-width: 600px) {
    .hero-logo-main .logo-icon {
        width: 2.4rem !important;
        height: 2.4rem !important;
        font-size: 1.4rem !important;
    }

    .hero-logo-main .logo-text {
        font-size: 1.6rem !important;
        font-weight: 500;
    }

    .hero-logo-main {
        margin-bottom: 1rem !important;
    }
}

/* =====================================================================
   FIXED FOOTER
   ===================================================================== */
.page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 40;
}

/* Top light bar */
.footer-top-bar {
    background: var(--light-background);
    border-top: 1px solid var(--border);
    padding: 0.5rem 1rem;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--foreground);
}

.top-bar-content a {
    color: var(--foreground);
    text-decoration: none;
}
.top-bar-content a:hover { text-decoration: underline; }

/* Bottom primary bar */
.footer-bottom-bar {
    background: var(--primary);
    color: white;
    height: 40px;
    display: flex;
    align-items: center;
}

.bottom-bar-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 2rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.bottom-bar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.bottom-bar-content a {
    color: white;
    text-decoration: none;
    opacity: 1;
    transition: color 0.2s;
}

.bottom-bar-content a:hover {
    color: var(--brand-teal);
}

.developer-attribution {
    color: var(--brand-gold);
}

/* =====================================================================
   MODALS
   ===================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(30, 40, 60, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 30rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform: scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: hsl(225, 15%, 50%);
    cursor: pointer;
}

.modal-close-btn:hover {
    color: var(--primary);
}

/* Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    color: hsl(225, 15%, 50%);
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Form groups */
.form-group { margin-bottom: 1rem; }

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--brand-blue-light);
}

.error-message {
    color: hsl(0, 72%, 51%);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error .form-input { border-color: hsl(0, 72%, 51%); }
.form-group.error .error-message { display: block; }

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-full { width: 100%; }

/* OTP */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.otp-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid var(--input);
    border-radius: var(--radius);
}

.otp-input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--brand-blue-light);
}


/* --- MOBILE HEADER STACKING FIX --- */
/* --- MOBILE HEADER STACKING FIX (Add to styles.css) --- */
/* --- MOBILE HEADER STACKING FIX (Final Refinement in styles.css) --- */
/* ===========================
    MOBILE HEADER BEHAVIOR (Final Two-Row Fix)
    =========================== */
/* ===========================
    MOBILE HEADER BEHAVIOR (Final Two-Row Fix Attempt)
    =========================== */
/* ===========================
    MOBILE HEADER BEHAVIOR (Final Stable Two-Row Fix)
    =========================== */
@media (max-width: 768px) {

    .smm-header-inner {
        flex-wrap: wrap; 
        padding: 0.6rem 1rem; 
        justify-content: space-between;
    }

    /* Target the elements that should be on the TOP ROW */
    .smm-logo, 
    .smm-actions {
        flex-shrink: 0;
        /* Ensure these take only minimum required width */
    }

    /* Logo Size */
    .smm-logo-img {
        height: 38px;
    }

    /* Search Wrapper: Force to the BOTTOM ROW */
    .smm-header-inner .search-wrapper { 
        order: 3; /* CRITICAL: Force it to the last position in the flex order */
        flex-basis: 100%; /* CRITICAL: Force it to take the full width, wrapping it below */
        max-width: 100%;
        margin-top: 0.6rem; 
        margin-left: 0;
        margin-right: 0;
    }

    /* Gold Button Size */
    .smm-btn-gold,
    .smm-actions .smm-btn-gold {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap; 
        height: 38px; 
    }
}