/* --- GLOBAL RESET & TYPOGRAPHY --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

:root {
    /* Global Variables */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Global Colors (Used in Header/Footer) */
    --deep-space: #0f172a;
    --navy-glass: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.1);
    --starlight: #f1f5f9;
    --teaser-blue: #4ECDC4;
    --peach-glow: #F49F75;
    --gold-glow: #fbbf24;
    --finance-green: #10b981;
    --alert-red: #ef4444;
    --teal-glow: #4ECDC4;
    --ember-orange: #ff7043;
    /* Added for Fire Icons */

    /* --- LAYOUT SHELL SYSTEM (Standardized Vertical Rhythm) --- */
    --shell-header-height: 130px;
    --shell-subnav-height: 80px;
}

/* --- LAYOUT SHELL SYSTEM (CONSTITUTION) --- */
#app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER ZONE */
/* HEADER ZONE */
#shell-fixed {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
    /* Container is pass-through */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

#shell-fixed header {
    pointer-events: auto;
    margin-top: 0;
    /* Gap is now handled by parent top */
    /* Ensure it doesn't stretch */
    width: fit-content;
    max-width: 1600px;
}

/* Force specific styling for the header when inside shell to ensure it matches index */
/* Force specific styling for the header - supports both shell and body injection */
.island-nav,
#shell-fixed .island-nav {
    /* Visuals Only */
    border-radius: 50px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 12px 30px;
    /* Ensure it doesn't overflow */
    box-sizing: border-box;

    /* Positioning for Body-Direct Header */
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1600px;
    z-index: 9999;

    /* CALM BREATHE EFFECT REMOVED FOR VISIBILITY FIX */
    /* animation: calmBreathe 6s infinite ease-in-out; */
    transition: all 0.5s ease;
}

/* HOVER: THE EMBRACE (Steady Warmth) */
/* HOVER: THE EMBRACE (Steady Warmth) */
.island-nav:hover,
#shell-fixed .island-nav:hover {
    border-color: rgba(244, 159, 117, 0.4);
    /* Peach Glow */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(244, 159, 117, 0.15);
    transform: translateX(-50%) translateY(-2px);
    /* Maintain Center */
    /* Slight lift */
}

/* Rule 2: Content starts AFTER fixed shell, always */
/* CONTENT ZONE */
#shell-content {
    /* island header height + air */
    padding-top: 120px;
    flex: 1;
    /* Pushes footer down */
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Rule 4: Constrain Particles */
#particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Rule 2b: Page Stack Container */
#page-stack {
    position: relative;
    min-height: 100%;
    z-index: 1;
    flex: 1;
    /* Ensure it takes available space */
}

/* Rule 3: Page Views (Opacity Switching) */
.page-view {
    position: absolute;
    /* Inactive tabs are removed from flow but kept locally */
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    width: 100%;
}

.page-view.active {
    position: relative;
    /* Active tab re-enters flow */
    opacity: 1;
    pointer-events: auto;
}

/* Footer always last in flow */
/* FOOTER */
#main-footer {
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* Sub-Nav Anchor */
#shell-subnav {
    display: flex;
    justify-content: center;
    width: 100%;
    z-index: 999;
}

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

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    /* STRICT: No horizontal scroll */
    width: 100%;
    max-width: 100%;
    /* Ensure constraints */
    position: relative;
    font-family: var(--font-body);
    line-height: 1.6;
    touch-action: pan-y;
    /* FIX: Prevent horizontal scroll jerking on mobile */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll for iOS */
}

/* --- CUSTOM SCROLLBAR (Site-wide Premium Design) --- */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--deep-space);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--teal-glow), var(--peach-glow));
    border-radius: 5px;
    border: 2px solid var(--deep-space);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5eddd4, #ff9f85);
}

/* Light Mode Scrollbar Overrides */
body.light-mode ::-webkit-scrollbar-track {
    background: #e2e8f0;
    /* Light Grey */
}

body.light-mode ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    /* Visible Slate Grey */
    border: 2px solid #f8fafc;
    /* Match Light bg */
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- GLOBAL CONTENT SPACING (Standardized) --- */
/* Header is fixed at top:20px with ~80px height = needs 110px total clearance */
/* STANDARDIZED: All pages now use 110px after batch fix */
main:not(.custom-spacing),
.page-wrapper:not(.custom-spacing) {
    padding-top: 110px;
}

/* Hero sections and containers manage their own spacing */
section.hero,
.container {
    padding-top: inherit;
}

/* Pages can override with .custom-spacing class */
main.custom-spacing,
.page-wrapper.custom-spacing {
    padding-top: inherit !important;
}



/* TEMPORARILY DISABLED: This media query was overriding component.js header styles
   Causing max-width: 1300px cap and padding conflicts
   Re-enable if icon-only mode is needed for this screen range
   
@media (min-width: 1151px) and (max-width: 1650px) {

    #mobile-destruct-trigger {
        display: none !important;
    }

    .nav-links>a,
    .nav-links>.dropdown>a {
        font-size: 0 !important;
        gap: 0 !important;
        padding: 0 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .nav-links>a>i,
    .nav-links>.dropdown>a>i {
        font-size: 1.4rem !important;
        margin: 0 !important;
        color: var(--starlight);
        transition: 0.3s;
        display: inline-block !important;
    }

    .nav-links>.dropdown>a>.fa-chevron-down {
        display: none !important;
    }

    .nav-links a:hover i {
        color: var(--teaser-blue);
        transform: scale(1.1);
    }

    .auth-box {
        gap: 5px !important;
    }

    .nav-btn {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    header.island-nav {
        width: 94% !important;
        max-width: 1300px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 15px !important;
        border-radius: 50px !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-bottom: none !important;
        padding: 8px 30px !important;
        background: rgba(15, 23, 42, 0.90) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    }
}
*/

/* FORCE HEADER FONT (Override page-specific fonts) */
header,
.main-nav,
.nav-links,
.nav-btn,
.dropdown-content {
    font-family: var(--font-body) !important;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* --- UTILITIES --- */
/* --- PREMIUM HERO TYPOGRAPHY (Global Standard) --- */
.hero-title-premium {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 60%, #A5F3FC 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(78, 205, 196, 0.3));
}

.hero-subhead-premium {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--peach-glow);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: block;
}

@media (max-width: 900px) {
    .hero-title-premium {
        font-size: 2.8rem;
    }

    .hero-subhead-premium {
        font-size: 1rem;
    }
}

.text-center {
    text-align: center !important;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--starlight);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Force 2 columns */
    gap: 50px;
    /* Ensure wide gap */
    width: 100%;
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        gap: 30px;
    }
}

/* --- GLOBAL HEADER --- */
/* Base header styles managed by shell-fixed now */
header {
    transition: background 0.3s ease, backdrop-filter 0.3s ease, transform 0.2s ease-out;
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid var(--border-glass);
    will-change: transform;
}

/* --- ISLAND NAVIGATION (Creative) --- */
/* --- ISLAND NAVIGATION (Visuals) --- */
header.island-nav {
    /* ANTI-FOUC: Smooth appearance */
    opacity: 0;
    animation: headerFadeIn 0.3s ease-out 0.1s forwards;
}

@keyframes headerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- READING PROGRESS BAR --- */
#scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 21000;
    /* Highest layer (Above Header 20000) */
    pointer-events: none;
}

#scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--teaser-blue), var(--peach-glow));
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--teaser-blue);
}

.main-nav {
    /* GRID-BASED ARCHITECTURE (Industry Standard) */
    /* GRID-BASED ARCHITECTURE (Industry Standard) */
    display: flex !important;
    justify-content: space-between;
    /* INCREASED GAP to 40px */
    /* Force 3 specific columns */
    gap: 15px;
    /* STRICTLY REDUCED to prevent overlap */
    /* ADDED: Global gap between Logo, Links, and Auth */
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 40px !important;
    /* FIX: Prevent edge touching on desktop */
    position: relative;
    /* REQUIRED for absolute centering of children */
}



.nav-logo {
    display: flex;
    align-items: center;
    padding: 5px 0;
    margin-right: 0;
    /* Gap handled by grid now */
    min-width: 160px;
    /* Ensure logo area has space */
}

.nav-logo img {
    height: 40px;
    /* Slightly smaller logo to help fit */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.nav-logo:hover img {
    transform: scale(1.05);
}

.nav-links {
    /* GRID CHILD: Elastic middle column */
    display: flex;
    gap: 8px;
    /* REDUCED: 12px → 8px for tighter fit */
    align-items: center;
    justify-content: center;
    /* Center items within available grid space */
    white-space: nowrap;
    min-width: 0;
    /* CRITICAL: Allows grid shrinking */
}

.nav-links a {
    font-size: 0.8rem;
    /* REDUCED: 0.9rem → 0.85rem */
    font-weight: 500;
    color: var(--starlight);
    opacity: 0.8;
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 6px 4px;
    /* ADDED: Explicit compact padding */
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--teaser-blue);
}

.nav-links a.active::after {
    display: none;
}

/* --- DESKTOP CLEANUP --- */
.mobile-profile-card {
    display: none !important;
}

/* Icons */
.nav-links i {
    color: var(--peach-glow);
    margin-right: 5px;
    /* Reduced margin */
    font-size: 0.9em;
    display: inline-block;
}

.nav-links a:hover i {
    color: var(--peach-glow);
}

/* REMOVE CONFLICTING DEFINITIONS */

/* DESKTOP DROPDOWN ARROWS */
.dropdown>a>.fa-chevron-down {
    margin-left: 5px;
    /* Reduced margin */
    font-size: 0.75em;
    color: var(--peach-glow);
    /* Unify with other icons */
    transition: transform 0.3s ease;
    display: inline-block;
    position: relative;
    top: 1px;
}

/* Auth Container - GRID CHILD: Right column */
.auth-box {
    display: flex;
    align-items: center;
    gap: 15px;
    /* REDUCED: 10px → 8px */
    white-space: nowrap;
    /* Natural width, never shrinks */
}

.user-icon-btn {
    font-size: 1.8rem;
    /* Wrapper Size */
    color: var(--starlight);
    opacity: 0.8;
    transition: 0.3s;
    display: flex;
    align-items: center;
}

.user-icon-btn i {
    font-size: 2rem !important;
    /* FORCED ICON SIZE - User Req */
}


.user-icon-btn:hover {
    color: var(--peach-glow);
    opacity: 1;
    transform: scale(1.1);
}

.nav-btn {
    padding: 8px 16px;
    /* REDUCED padding for compact fit */
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--teaser-blue), #2a9d8f);
    color: var(--deep-space);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.2);
    white-space: nowrap;
    /* Prevent Wrapping */
    transition: all 0.3s ease;
}

.nav-btn i {
    font-size: 1.1em;
}


.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
    filter: brightness(1.1);
}

/* CRISIS BUTTON (Matches nav-btn geometry) */
.lifeline-btn {
    padding: 8px 16px;
    /* REDUCED padding */
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.1);
}

.lifeline-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.25);
    color: #ff8787;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--starlight);
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    /* Needed for z-index */
    z-index: 1002;
    /* Ensure it stays above the open menu (which is 999) */
}

/* --- GLOBAL FOOTER --- */
footer {
    width: 100%;
    background-color: var(--deep-space);
    color: var(--starlight);
    padding: 60px 20px !important;
    /* Force side padding to prevent text touching edges */
    border-top: 1px solid var(--border-glass);
    position: relative;
    z-index: 10;
}

footer p,
footer a {
    color: var(--starlight) !important;
    /* Force White Text */
    opacity: 1 !important;
    /* Force Full Opacity */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.footer-links a {
    opacity: 0.7;
    font-size: 0.95rem;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--peach-glow);
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.footer-socials a {
    color: var(--starlight);
    font-size: 1.5rem;
    opacity: 0.7;
    transition: 0.3s;
}

.footer-socials a:hover {
    color: var(--peach-glow);
    transform: translateY(-2px);
    opacity: 1;
}

/* --- DROPDOWN MENU --- */
.dropdown {
    position: relative;
}

.dropdown a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* --- DROPDOWN MENU ICONS (Fixed) --- */
.dropdown a i {
    font-size: 0.9em;
    /* Use global margin-right from line 170 */
    color: var(--peach-glow);
    /* FIXED: Unify Color */
    transition: transform 0.3s;
}

/* DESKTOP DEFAULT: Hide the injected mobile button */
.dropdown-toggle-btn {
    display: none !important;
}

/* DESKTOP DROPDOWN ARROWS (Legacy override) */
.dropdown>a>.fa-chevron-down {
    margin-left: 5px;
    font-size: 0.7em;
    color: var(--peach-glow);
    /* FIXED: Unify Arrow */
    transition: transform 0.3s ease;
    display: inline-block;
}



.dropdown:hover>a>.fa-chevron-down {
    transform: rotate(180deg);
}

/* MOBILE FIXES */
@media (max-width: 900px) {

    /* Show the embedded icon in the link */
    .dropdown>a>i {
        display: inline-block !important;
        margin-left: auto;
        /* Push to right */
    }

    /* Hide the separate toggle button (unused) */
    .dropdown-toggle-btn {
        display: none !important;
    }

    /* Ensure parent aligns them correctly */
    .nav-links li.dropdown {
        display: flex;
        flex-direction: column;
        /* Stack link and content */
        align-items: stretch;
    }

    /* Ensure link takes separate space */
    .nav-links li.dropdown>a {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* Removed global hover rotation to prevent mobile glitch */

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    top: 100%;
    left: auto;
    right: 0;
    min-width: 260px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.nav-links.open .dropdown-content {
    position: static;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    padding: 0;
    margin-top: 10px;
    display: none;
    /* Controlled by JS now */
    animation: none !important;
}

.dropdown.active .dropdown-content {
    display: block;
}

/* Nesting for Mobile */
.dropdown-submenu .dropdown-content {
    position: static;
    margin-left: 10px;
    /* Reduced Indent (prev 25px) */
    border-left: 1px solid rgba(78, 205, 196, 0.3);
    /* Thinner border */
    padding-left: 0;
    /* Align text better */
    left: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.02);
    /* Slight background distinction */
}

.dropdown-submenu.active>.dropdown-content {
    display: block;
}

@media (min-width: 1151px) {
    .dropdown:hover .dropdown-content {
        display: block;
        animation: fadeInDropdown 0.3s ease;
    }

    .dropdown:hover>a i {
        transform: rotate(180deg);
    }
}

.dropdown-content a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--starlight);
    opacity: 0.8;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--teaser-blue);
    opacity: 1;
}

.dropdown-content a::after {
    display: none !important;
    /* Remove underline effect for dropdown items */
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- UX ENHANCEMENT: BUTTON SHIMMER (#2) --- */
.nav-btn,
.lifeline-btn,
.shred-btn,
.send-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::after,
.lifeline-btn::after,
.shred-btn::after,
.send-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: shimmer 6s infinite;
    /* Gentle, periodic shimmer */
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    10% {
        left: 200%;
    }

    /* Fast sweep */
    100% {
        left: 200%;
    }

    /* Wait for next cycle */
}

/* --- UX ENHANCEMENT: SOULBOT PULSE (#3) --- */
/* Targeting the floating trigger button usually found in Soulbot.html or injected */
#triggerBtn,
.trigger-btn {
    animation: heartbeat 3s infinite ease-in-out;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(78, 205, 196, 0.6);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
    }
}

/* --- UTILITIES --- */
.page-wrapper {
    position: relative;
    min-height: 100vh;
    padding-top: 140px;
    /* Increased from 80px to fix overlap */
    /* Offset fixed header */
}

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

/* --- RESPONSIVE --- */
/* Default Styles for Injected Elements */
.mobile-login-btn {
    display: none;
    /* Hidden by default on desktop */
}

/* --- DEFENSIVE DESKTOP OVERRIDES (Force Correct Layout > 1200px) --- */
@media (min-width: 1201px) {

    /* NUCLEAR FIX: Never show mobile help button on desktop */
    /* Applies from 1150px upwards, covering the transition gap */
    /* SPECIFICITY BOOST: ID Selector (#) beats everything */
    #mobile-destruct-trigger,
    .nav-links .mobile-only-help,
    .mobile-only-help {
        display: none !important;
    }

    .auth-box {
        display: flex !important;
    }

    .nav-links {
        display: flex !important;
        flex-direction: row !important;
    }

    .nav-links a {
        display: flex !important;
        align-items: center !important;
    }

    .dropdown>a>i {
        display: inline-block !important;
    }

    /* Fix icons spacing */
    .nav-links i {
        margin-right: 8px !important;
    }

    /* Fix Get Help Button Style if it appears */
    .lifeline-btn {
        background: rgba(255, 107, 107, 0.1) !important;
        color: #ff6b6b !important;
        border: 1px solid rgba(255, 107, 107, 0.3) !important;
    }
}



/* --- MOBILE / TABLET OPTIMIZATION (Up to 1150px) --- */
@media (max-width: 1150px) {


    /* 1. Header Changes */
    header.island-nav {
        top: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-glass);
        padding: 15px 20px;
    }

    /* FIX: Ensure Dropdowns Stack Vertically on Mobile */
    .dropdown-content,
    .dropdown-submenu .dropdown-content {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        background: transparent !important;
        border: none !important;
        padding-left: 20px !important;
        width: 100% !important;
        max-height: none !important;
        /* Remove scroll limit for mobile flow */
        overflow: visible !important;
        display: none;
        /* JS toggles this */
    }

    /* Indentation for hierarchy */
    .dropdown-submenu .dropdown-content {
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-left: 10px !important;
    }

    /* Force display when active */
    .dropdown.active>.dropdown-content,
    .dropdown-submenu.active>.dropdown-content {
        display: block !important;
    }

    /* Hide Desktop Arrows on Mobile if needed */
    .dropdown-submenu>a::after {
        display: none !important;
    }

    /* EXCEPTION: Keep text in buttons visible, if they inherit from 'a' */
    .nav-btn {
        font-size: 0.85rem !important;
    }

    /* FIX: RESTORE FLOATING ISLAND (Laptop Mode) */
    /* User requested gaps on sides ("remove this" pointing to edges) */
    header.island-nav {
        width: 92% !important;
        /* Safer than VW for scrollbars */
        max-width: 1400px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 20px !important;
        /* Floating spacing */
        border-radius: 50px !important;
        /* Rounded corners */
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-bottom: none !important;
        /* Use border scaling */
        padding: 12px 30px !important;
        background: rgba(15, 23, 42, 0.90) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
    }

    /* HIDE DECORATIVE ELEMENTS THAT CAUSE SCROLL */
    /* HIDE DECORATIVE ELEMENTS THAT CAUSE SCROLL */
    /* .promo-sticker removed to allow showing on mobile */

    header.island-nav .nav-logo img {
        margin-right: 0 !important;
        /* Reset desktop margin */
    }

    .main-nav {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 !important;
    }

    /* Hide Desktop Elements */
    .nav-group>.nav-links,
    .auth-box {
        display: none;
    }

    .mobile-toggle {
        display: block;
        font-size: 1.5rem;
        background: transparent;
        border: none;
        color: white;
        cursor: pointer;
        margin: 0 !important;
        /* Force no margin */
        padding: 0 !important;
    }

    /* 4. DASHBOARD LIST ITEMS */
    /* NUCLEAR ALIGNMENT RESET to ensure "Single Line" look */
    .dropdown,
    .nav-links>a {
        display: block !important;
        /* FORCE BLOCK to prevent inline shifts */
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-sizing: border-box !important;
    }

    /* Fix Alignment: Force full width */

    .nav-links>a,
    .dropdown>a {
        display: grid !important;
        /* Switch to Grid for robust alignment */
        grid-template-columns: 24px 1fr auto;
        /* TIGHTER Icon Column (24px) */
        align-items: center !important;
        gap: 15px;
        /* Consistent Gap */
        padding: 12px 20px !important;
        /* Unified Horizontal Padding */
        color: rgba(255, 255, 255, 0.8);
        border-radius: 12px;
        font-size: 1rem;
        line-height: 1 !important;
        /* Tighten text box for precise alignment */
        transition: all 0.2s;
        width: 100%;
        margin-bottom: 5px;
        text-align: left;
        box-sizing: border-box !important;
    }

    /* FORCE SHOW Mobile Profile Card (overriding inline style) */
    .mobile-profile-card {
        display: flex !important;
        align-items: center;
        gap: 15px;
        width: 100%;
        background: rgba(255, 255, 255, 0.05);
        padding: 15px;
        border-radius: 15px;
        margin-bottom: 20px;
        border: 1px solid var(--border-glass);
    }

    .mp-avatar {
        width: 45px;
        height: 45px;
        background: var(--teaser-blue);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: var(--deep-space);
    }

    .mp-info {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .mp-name {
        font-weight: 700;
        color: var(--starlight);
        font-size: 1rem;
    }

    .mp-status {
        font-size: 0.8rem;
        opacity: 0.6;
    }

    .mp-btn {
        margin-left: auto;
        font-size: 0.8rem;
        padding: 5px 12px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.1);
        text-decoration: none;
    }

    /* Re-enable icons for Mobile Sidebar */
    /* Re-enable icons for Mobile Sidebar */
    .nav-links i {
        display: flex !important;
        /* Flex Center for perfect glyph alignment */
        justify-content: center !important;
        align-items: center !important;
        width: 24px !important;
        /* Strict 24px box */
        height: 24px !important;
        /* Strict height match */
        margin: 0 !important;
        padding: 0 !important;
        color: var(--peach-glow) !important;
        font-size: 1.1rem;
        transform: translateY(6px);
        /* Boosted Nudge: 6px down */
    }

    /* EXPLICIT: Dropdown Arrows (Peach Color & Right Aligned) */
    .dropdown>a>.fa-chevron-down {
        display: inline-block !important;
        margin-left: auto !important;
        width: auto !important;
        font-size: 0.9em !important;
        color: var(--peach-glow) !important;
        /* Logo Color */
        transform: rotate(0deg);
        transition: transform 0.3s ease;
    }

    .dropdown.active>a>.fa-chevron-down {
        transform: rotate(180deg);
    }

    /* SHOW DROPDOWN ON MOBILE TOGGLE */
    /* Dropdown Content (Main) */
    .dropdown-content {
        display: none;
        position: absolute;
        background-color: var(--navy);
        min-width: 250px;
        /* Slightly wider */
        box-shadow: 0px 15px 40px rgba(0, 0, 0, 0.4);
        z-index: 1000;
        border-radius: 12px;
        top: 120%;
        /* Gap for clean hover */

        /* Centered Alignment */
        left: 50%;
        transform: translateX(-50%);

        padding: 12px 0;
        border: 1px solid rgba(255, 255, 255, 0.1);

        /* IMPORTANT: Visible overflow for desktop to allow flyouts */
        overflow: visible;
    }

    /* Gap Filler for Hover Safety */
    .dropdown-content::before {
        content: '';
        position: absolute;
        top: -20px;
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
    }

    /* Custom Scrollbar for Submenus */
    .dropdown-content::-webkit-scrollbar {
        width: 5px;
    }

    .dropdown-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }

    .dropdown-content::-webkit-scrollbar-thumb {
        background-color: var(--teal-glow);
        border-radius: 10px;
    }

    /* --- NESTED DROPDOWN SUPPORT (Desktop) --- */
    .dropdown-submenu {
        position: relative;
    }

    /* Submenu (Level 2) */
    .dropdown-submenu .dropdown-content {
        top: 0;
        left: 100%;
        /* Flyout Right */
        margin-left: 15px;
        /* Offset */
        margin-top: -10px;
        display: none;

        /* Scrollbar logic - Only for submenus if they get long */
        max-height: 60vh;
        overflow-y: auto;
        overflow-x: hidden;

        /* Reset transform from parent */
        transform: none;
    }

    .dropdown-submenu:hover>.dropdown-content {
        display: block;
        animation: fadeInRight 0.3s ease;
    }

    .dropdown-submenu>a::after {
        content: "\f054";
        /* Right Arrow */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        float: right;
        font-size: 0.8em;
        opacity: 0.7;
        margin-top: 4px;
    }

    @keyframes fadeInRight {
        from {
            opacity: 0;
            transform: translateX(-10px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* ------------------------------- */

    /* Show Main Dropdown on Hover */
    @media(hover: hover) and (min-width: 1201px) {
        .dropdown:hover>.dropdown-content {
            display: block;
            animation: fadeInUp 0.3s ease;
            top: 100%;
            /* Snap to correct position */
        }
    }

    .dropdown.active .dropdown-content {
        display: block !important;
        position: static;
        /* Stack vertically */
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        width: 100%;
        margin-top: 10px;
    }

    /* Mobile Menu Style (Side Drawer) */

    /* Mobile Menu Style (Side Drawer) - GUARDED */
    @media (max-width: 1150px) {
        .nav-links {
            position: fixed;
            top: 0;
            right: 0;
            left: auto;
            width: 100%;
            height: 100vh;
            background: rgba(15, 23, 42, 0.98);
            backdrop-filter: blur(20px);
            display: flex !important;
            flex-direction: column;
            justify-content: flex-start;
            padding: 100px 40px 150px 40px;
            gap: 25px;
            align-items: stretch;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;

            /* NUCLEAR HIDE: Ensure it's absolutely gone when closed */
            transform: translateX(100%);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;

            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.4s;
            border-left: 1px solid var(--border-glass);
            /* GHOST LINE FIX: Hide shadow when closed */
            box-shadow: none;
            z-index: 99999 !important;
        }

        .nav-links.open {
            transform: translateX(0);
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
            /* Show shadow only when open */
        }

        /* Mobile Only Help Button - PROMINENT & ON TOP */
        #mobile-destruct-trigger.mobile-only-help,
        .mobile-only-help {
            display: flex !important;
            order: -1;
            /* VISUAL HOSTING: Moves to top of flex container */
            align-items: center;
            justify-content: center;

            /* Prominent "Crisis" Styling (Solid Red) */
            background: linear-gradient(135deg, #ef4444, #dc2626) !important;
            color: white !important;
            border: none !important;

            padding: 16px 20px;
            /* Generous padding */
            border-radius: 50px;
            /* Pill shape like desktop */
            font-weight: 700;
            font-size: 1.1rem;
            /* Larger text */

            margin-top: 0;
            margin-bottom: 25px;
            /* Separation from rest of menu */
            width: 100%;
            text-align: center;

            box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
            /* Glowing Shadow */
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }
    }
}

/* Scroll Lock Class (Toggled by JS) */
body.no-scroll {
    overflow: hidden;
}

/* Ensure Toggle is ALWAYS on top */
.mobile-toggle {
    z-index: 100000 !important;
    /* Above nuclear menu */
    /* Must be above the menu (2050) */
    /* Highest priority */
}

/* --- MOBILE BOTTOM NAV (Global) --- */
.mobile-bottom-nav {
    display: none !important;
    /* Default Hidden on Desktop */
}

@media (max-width: 1024px) {
    .mobile-bottom-nav {
        display: flex !important;
        /* Show on Mobile/Tablet */
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--border-glass);
        border-radius: 50px;
        justify-content: space-around;
        align-items: center;
        padding: 10px 20px;
        z-index: 8000 !important;
        /* Ensure it stays on top of footer but below menu overlay */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* HIDE when Main Menu is open */
    body.no-scroll .mobile-bottom-nav {
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translate(-50%, 20px) !important;
        z-index: -1 !important;
    }
}

.mobile-bottom-nav.hidden {
    transform: translate(-50%, 150%);
    opacity: 0;
    pointer-events: none;
}

.mb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--starlight);
    font-size: 0.75rem;
    text-decoration: none;
    opacity: 0.6;
    transition: 0.2s;
    cursor: pointer;
}

.mb-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.mb-item:hover,
.mb-item.active {
    opacity: 1;
    color: var(--teaser-blue);
    transform: translateY(-2px);
}

/* --- WORKPLACE REDESIGN (Glassmorphism & Cards) --- */
.glass-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 35px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(78, 205, 196, 0.3);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* COMPASS GRID (Responsive Pillars) */
.compass-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 40px;
}

@media (max-width: 1024px) {
    .compass-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2x2 on Tablet */
    }
}

@media (max-width: 600px) {
    .compass-grid {
        grid-template-columns: 1fr;
        /* Stack on Mobile */
    }
}

/* --- UNIVERSAL MOBILE GRID FIX --- */
/* Use this class to force responsive grids anywhere */
.mobile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Smart Wrap */
    gap: 20px;
}

@media (max-width: 768px) {
    .mobile-grid {
        grid-template-columns: 1fr !important;
        /* Force Stack */
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}



.accent-text {
    color: var(--teal-glow);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: block;
}

.icon-glow-box {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
}

.glass-card:hover .icon-glow-box {
    background: rgba(78, 205, 196, 0.1);
    color: var(--teal-glow);
    border-color: var(--teal-glow);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.2);
}

/* --- STANDARDIZED TOOL HEADERS --- */
.tool-header {
    position: absolute;
    top: 30px;
    /* Adjusted for overlay usage */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 30px;
    background: transparent;
    /* Removed background */
    backdrop-filter: none;
    /* Removed blur */
    border: none;
    /* Removed border */
    z-index: 99999 !important;
    /* Extremely high z-index to ensure clickability */
    pointer-events: none;
    /* Allow clicks through to elements below */
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure buttons are clickable */
.tool-header button,
.tool-header .back-btn {
    pointer-events: auto !important;
    cursor: pointer;
    z-index: 2147483648;
    /* Even higher */
}

/* Back Button Positioning */
.tool-header .back-btn {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    transition: 0.2s;
}

.tool-header .back-btn:hover {
    background: var(--alert-red);
    border-color: var(--alert-red);
    color: white;
}

/* Title Centering */
.tool-header h2 {
    color: white;
    font-size: 2rem;
    /* Increased size */
    margin: 0 auto;
    color: var(--starlight);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin: 0;
    pointer-events: none;
    text-align: center;
    pointer-events: auto;
}



.tool-header .back-btn {
    background: rgba(15, 23, 42, 0.6);
    /* Give button its own background */
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-glass);
    color: var(--starlight);
    padding: 8px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    position: absolute;
    /* Lock button to left */
    left: 0;
}

.tool-header .back-btn:hover {
    background: var(--alert-red);
    border-color: var(--alert-red);
    color: white;
}

/* Mobile Adjustments for Tool Header */
@media (max-width: 768px) {
    .tool-header {
        top: 80px;
        width: 95%;
        padding: 10px 20px;
    }

    .tool-header h2 {
        font-size: 1.2rem;
    }
}

/* --- LIVE USER WIDGET (Global) --- */
.live-pill {
    position: relative;
    /* Unpinned */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--peach-glow);
    padding: 8px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: white;
    /* Removed fixed positioning and animation that caused overlap */
}

.live-dot {
    /* If specific color needed, override locally or use JS */
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    /* Green default */
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        top: -50px;
        opacity: 0;
    }

    to {
        top: 90px;
        opacity: 1;
    }
}

/* =================================================
   HEADER CONTEXT MODES (DO NOT TOUCH STRUCTURE)
   ================================================= */

/* Light header skin for white/canvas pages */
body[data-header-theme="light"] header.island-nav {
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(10px) !important;
}

/* Text & links */
body[data-header-theme="light"] header.island-nav a {
    color: #0f172a !important;
    opacity: 0.9;
}

body[data-header-theme="light"] header.island-nav a:hover {
    color: var(--teaser-blue) !important;
}

/* Icons */
body[data-header-theme="light"] header.island-nav i {
    color: #334155 !important;
}

/* Buttons */
body[data-header-theme="light"] .nav-btn {
    background: #0f172a !important;
    color: white !important;
}

body[data-header-theme="light"] .lifeline-btn {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* PROBELM WALL SPECIFIC IMMERSION */
body[data-page="problem-wall"] header.island-nav {
    backdrop-filter: blur(6px);
    padding: 10px 26px !important;
}

/* --- CRITICAL LAYOUT FIX (FINAL OVERRIDE) --- */
#app-shell #shell-fixed header,
#app-shell #shell-fixed header.island-nav,
#app-shell #shell-fixed #main-header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 auto !important;
    /* We allow width/style to remain, but position is non-negotiable */
    z-index: 1001 !important;
}

/* --- GLOBAL PARTICLES --- */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.2;
    animation: float linear infinite;
}

@keyframes float {
    from {
        transform: translateY(100vh);
    }

    to {
        transform: translateY(-10vh);
    }
}

/* --- LAYOUT CONTRACT: MOBILE SAFE AREA --- */
@media (max-width: 1024px) {

    /* FIX: Extended to include Tablets */
    body {
        padding-bottom: 90px !important;
        /* Reserve space for fixed bottom bar */
    }
}

/* --- ADDED: Responsive Grids for Index --- */
.compass-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

@media (max-width: 900px) {
    .compass-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- MOBILE LAYOUT FIX: Reduce Container Padding --- */
@media (max-width: 768px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        /* Reduced from 24px to minimize edge spacing on mobile */
    }

    /* Ensure content sections also use reduced padding */
    section {
        padding-left: 12px;
        padding-right: 12px;
    }
}