:root {
    --neon-orange: #ff7b00;
    --neon-blue: #00f3ff;
    --bg-dark: #0a0a0a;
    --glass-border: rgba(255, 255, 255, 0.1);
    --safe-area-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0; 
    background-color: var(--bg-dark); 
    color: #fff;
    font-family: 'Inter', sans-serif; 
    overflow-x: hidden;
    padding-bottom: 120px;
}

#bgCanvas { 
    position: fixed; top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 0; pointer-events: none; 
}

.promo-banner {
    background: var(--neon-orange); color: #000; width: 100%; padding: 12px 0;
    font-family: 'JetBrains Mono'; font-weight: 800; text-transform: uppercase;
    position: fixed; top: 0; left: 0; z-index: 1000; text-align: center; 
    font-size: 14px; letter-spacing: 1px; height: 40px; 
}

.intel-ticker {
    position: fixed; top: 40px; left: 0; width: 100%; height: 35px;
    background: rgba(0, 0, 0, 0.95); border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    display: flex; align-items: center; padding: 0 20px; z-index: 999;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--neon-blue);
    backdrop-filter: blur(10px); box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.content-viewport {
    width: 100%; 
    max-width: 900px;
    margin: 0 auto;
    position: relative; 
    z-index: 1; 
    padding: 120px 20px 40px 20px; 
}

.page-title {
    font-family: 'Chakra Petch';
    font-size: clamp(40px, 8vw, 80px);
    margin: 0;
    line-height: 0.9;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff 40%, #555 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.page-subtitle {
    text-align: center;
    font-family: 'JetBrains Mono';
    color: var(--neon-blue);
    font-size: 12px;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.search-wrapper {
    position: sticky;
    top: 80px; 
    z-index: 900;
    margin-bottom: 40px;
    background: var(--bg-dark);
    padding: 10px 0;
}

#searchInput {
    width: 100%;
    padding: 18px 25px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--neon-blue);
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(5px);
}

details {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

summary {
    padding: 20px;
    font-family: 'Chakra Petch';
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
}

.integration-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--glass-border);
}

.integration-list li {
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ccc;
    font-family: 'JetBrains Mono';
    font-size: 13px;
    display: flex;
    align-items: center;
    transition: 0.2s;
    line-height: 1.4;
}

.no-results {
    text-align: center;
    color: var(--neon-orange);
    font-family: 'JetBrains Mono';
    padding: 40px;
}

/* --- 5-COLUMN NAVIGATION (SPECIFIC FIX) --- */
.bottom-nav-5 {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 90px;
    background: rgba(0,0,0,0.98); backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: grid; 
    grid-template-columns: 1fr 1fr 80px 1fr 1fr; /* 5 Columns */
    align-items: center; justify-items: center;
    z-index: 9999; padding-bottom: env(safe-area-inset-bottom);
}

.nav-group-5 {
    width: 100%; height: 100%; display: flex; 
    align-items: center; justify-content: center; position: relative;
}

.nav-trigger-5 {
    background: none; border: none; color: #666; font-size: 20px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer; transition: 0.3s; width: 100%;
}

.nav-trigger-5:hover, .nav-trigger-5.active {
    color: #ff7b00; text-shadow: 0 0 15px rgba(255, 123, 0, 0.4);
}

.bottom-nav-5 .center-btn-wrapper {
    top: -15px; /* Lifts the center button in this specific layout */
}

/* --- SHARED NAV STYLES --- */
.center-btn-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-master-btn {
    width: 60px; 
    height: 60px; 
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-orange), #ff4400); 
    border: 3px solid #000;
    color: #fff; 
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 123, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10001;
}
.center-master-btn:hover {
    transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 123, 0, 0.6);
}

.nav-label { 
    font-size: 10px; 
    font-weight: 800; 
    font-family: 'Chakra Petch'; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

/* --- NAV STACKS --- */
.nav-stack {
    position: absolute;
    bottom: 90px; 
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: max-content; 
    min-width: 100px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
    overflow: hidden;
    z-index: 10000; /* Increased to ensure visibility */
}

/* FIX: Allow visibility when stack itself has active class */
.nav-stack.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    border-color: var(--neon-orange);
}

.nav-stack a {
    text-decoration: none;
    color: #ccc;
    font-family: 'JetBrains Mono';
    font-size: 10px;
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap; 
}

.nav-stack a:hover {
    background: rgba(255, 123, 0, 0.1);
    color: #fff;
}

.nav-stack a.active-link {
    color: var(--neon-orange);
    font-weight: 800;
}

@media (max-width: 768px) {
    .content-viewport { padding: 120px 15px 120px 15px; }
    
    .center-master-btn {
        width: 48px;
        height: 48px;
    }

    .nav-stack {
        padding: 5px 0;
        z-index: 10000;
        width: max-content; 
        min-width: 80px;
        bottom: 95px; 
    }
    
    .nav-stack a {
        font-size: 13px;
        padding: 10px 12px; 
    }
    
    /* Specific positioning adjustments for stacks on mobile */
    #stack-home {
        left: 5px;
        right: auto;
        transform: translateY(20px);
        border-radius: 12px 12px 12px 0;
    }
    /* Ensure active state resets transform correctly for mobile alignment */
    #stack-home.active {
        transform: translateY(0);
        left: 5px; 
    }

    #stack-creation { 
        left: auto;
        right: 5px;
        transform: translateY(20px);
        border-radius: 12px 12px 0 12px;
    }

    #stack-crm {
        left: auto; 
        right: 0px; 
        transform: translateY(20px);
        border-radius: 12px 12px 0 12px;
    }
    #stack-crm.active {
        transform: translateY(0);
        left: auto;
        right: 0;
    }
}