/* ==========================================================================
   PIM-BRAIN — PULSEPOINT PERMANENT DARK THEME DESIGN SYSTEM
   Single Source of Truth: pulsepoint-DESIGN.md
   ========================================================================== */

:root {
    /* ----------------------------------------------------------------------
       1. Exact Design Tokens from pulsepoint-DESIGN.md
       ---------------------------------------------------------------------- */
    --color-primary-navy: #1E3A5F;
    --color-secondary-red: #E63946;
    --color-tertiary-steel: #8D99AE;
    --color-neutral-slate: #64748B;
    --color-bg-dark: #0F172A;
    --color-surface-dark: #1E293B;
    --color-surface-elevated: #334155;
    --color-hover-secondary: #475569;
    --color-primary-hover: #264A75;
    --color-destructive-hover: #FF4D5A;

    --color-success: #22C55E;
    --color-success-text: #4ADE80;
    --color-warning: #F59E0B;
    --color-warning-text: #FBBF24;
    --color-error: #E63946;
    --color-error-text: #FF6B76;
    --color-info: #3B82F6;
    --color-info-text: #60A5FA;

    --color-text-white: #F1F5F9;
    --color-text-steel: #94A3B8;

    /* Base Layout Colors (Permanent Dark Mode) */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-body: #8D99AE;
    --text-muted: #64748B;
    --surface: #1E293B;
    --surface-strong: #334155;
    --border-color: #334155;

    /* Typography */
    --font-display: 'Red Hat Display', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Elevation Glows (pulsepoint-DESIGN.md) */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 8px rgba(30, 58, 95, 0.15);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 16px rgba(30, 58, 95, 0.20);
    --shadow-large: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 32px rgba(30, 58, 95, 0.25);
    --shadow-alert: 0 0 20px rgba(230, 57, 70, 0.40), 0 0 6px rgba(230, 57, 70, 0.60);

    /* Section Atmosphere Environments (Dark Mode Depth) */
    --world-hero: #0F172A;
    --world-statement: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --world-about: #0F172A;
    --world-domains: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --world-lab: #0F172A;
    --world-ai: linear-gradient(135deg, #0F172A 0%, #1E293B 60%, rgba(30, 58, 95, 0.4) 100%);
    --world-agendas: #0F172A;
    --world-programs: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --world-people: #0F172A;
    --world-infra: #0F172A;
    --world-pubs: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --world-vision: #0F172A;
    --world-contact: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    --world-footer: #0F172A;

    /* Navigation & Modals */
    --nav-bg: rgba(15, 23, 42, 0.88);
    --nav-border: #334155;
    --nav-shadow: 0 16px 45px rgba(0, 0, 0, 0.7);

    --modal-bg: rgba(30, 41, 59, 0.98);
    --modal-border: #334155;
    --modal-shadow: 0 16px 48px rgba(0, 0, 0, 0.70);
}

/* --------------------------------------------------------------------------
   2. Global Typography & Core Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0F172A;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1E3A5F 0%, #3B82F6 100%);
    border-radius: 4px;
}

.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }
.font-mono { font-family: var(--font-mono); }

/* Text Gradients (Approved PulsePoint Color Combinations) */
.text-gradient {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 50%, #FF6B76 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-cyan,
.text-gradient-info {
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-purple,
.text-gradient-alert {
    background: linear-gradient(90deg, #E63946 0%, #F59E0B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   3. Card System (pulsepoint-DESIGN.md: #1E293B, #334155, 4px corners, shadows)
   -------------------------------------------------------------------------- */
.card-blue,
.card-cyan,
.card-purple,
.card-violet,
.card-indigo,
.card-magenta,
.card-teal,
.card-white-luxe,
.card-dark-luxe {
    background: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: var(--shadow-subtle);
    color: #F1F5F9;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-blue:hover,
.card-cyan:hover,
.card-purple:hover,
.card-violet:hover,
.card-indigo:hover,
.card-magenta:hover,
.card-teal:hover,
.card-white-luxe:hover,
.card-dark-luxe:hover {
    transform: translateY(-4px);
    border-color: #3B82F6;
    box-shadow: var(--shadow-medium);
}

/* --------------------------------------------------------------------------
   4. Card Top Accent Lines (Using Approved Tokens)
   -------------------------------------------------------------------------- */
.accent-top-blue::before,
.accent-top-cyan::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #3B82F6;
    z-index: 10;
}
.accent-top-purple::before,
.accent-top-magenta::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #E63946;
    z-index: 10;
}
.accent-top-indigo::before,
.accent-top-violet::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #1E3A5F;
    z-index: 10;
}
.accent-top-teal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #22C55E;
    z-index: 10;
}

/* --------------------------------------------------------------------------
   5. Status Chips & Capsules (pulsepoint-DESIGN.md Section: Chips)
   -------------------------------------------------------------------------- */
.icon-capsule-blue,
.chip-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.30);
    color: #60A5FA;
}

.icon-capsule-purple,
.icon-capsule-magenta,
.chip-critical {
    background: rgba(230, 57, 70, 0.15);
    border: 1px solid rgba(230, 57, 70, 0.30);
    color: #FF6B76;
}

.icon-capsule-cyan,
.chip-normal {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.30);
    color: #4ADE80;
}

.icon-capsule-indigo,
.icon-capsule-violet,
.chip-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.30);
    color: #FBBF24;
}

.icon-capsule-teal {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.30);
    color: #60A5FA;
}

/* --------------------------------------------------------------------------
   6. Image Frames & Elevation Glows (pulsepoint-DESIGN.md)
   -------------------------------------------------------------------------- */
.frame-glow-blue,
.frame-glow-cyan {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 24px rgba(30, 58, 95, 0.35);
    border: 1px solid rgba(59, 130, 246, 0.35);
}
.frame-glow-purple,
.frame-glow-magenta {
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.30), 0 0 6px rgba(230, 57, 70, 0.50);
    border: 1px solid rgba(230, 57, 70, 0.35);
}

.neural-image-frame {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease;
}
.neural-image-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.neural-image-frame:hover img {
    transform: scale(1.03);
}

/* --------------------------------------------------------------------------
   7. Buttons (pulsepoint-DESIGN.md: Primary, Secondary, Ghost, Destructive)
   -------------------------------------------------------------------------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #F1F5F9 !important;
    background: #1E3A5F;
    border: none;
    box-shadow: var(--shadow-subtle);
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary:hover {
    background: #264A75;
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    color: #94A3B8;
    background: #334155;
    border: 1px solid #64748B;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-secondary:hover {
    background: #475569;
    color: #F1F5F9;
    transform: translateY(-2px);
}

.glass-nav {
    background: rgba(15, 23, 42, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid #334155;
    box-shadow: var(--shadow-large);
}

/* --------------------------------------------------------------------------
   Brand Identity Component (2-Line Stacked Layout + Perfect Circular Logo)
   -------------------------------------------------------------------------- */
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    flex-shrink: 0;
}

/* Circular Logo Container with Outer Glowing Animated Ring */
.brand-logo-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand:hover .brand-logo-wrapper {
    transform: scale(1.03);
}

/* Thin Animated Glowing Outer Layer (pulsepoint-DESIGN.md palette) */
.brand-logo-glow-ring {
    position: absolute;
    inset: -2.5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #3B82F6 0%, #1E3A5F 35%, #E63946 70%, #60A5FA 85%, #3B82F6 100%);
    opacity: 0.85;
    filter: blur(1.5px);
    animation: logoGlowRotate 10s linear infinite;
    z-index: 1;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.brand:hover .brand-logo-glow-ring {
    opacity: 1;
    filter: blur(2px) drop-shadow(0 0 8px rgba(59, 130, 246, 0.65));
}

/* Perfect White Circle Logo Container (Zero Padding) */
.brand-logo-circle {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    border-radius: 50% !important;
    background: #FFFFFF !important;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Static Logo Artwork inside Circle */
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: none !important;
    pointer-events: none;
}

/* Slow Glowing Ring Rotation Animation */
@keyframes logoGlowRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.brand-text {
    display: flex;
    flex-direction: column !important;
    justify-content: center;
    text-align: left;
}

.brand-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.2rem;
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: var(--color-text-white);
    transition: color 0.2s ease;
}

.brand:hover .brand-title {
    color: var(--color-info);
}

.brand-subtitle {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-steel);
    margin-top: 2px;
}

@media (max-width: 640px) {
    .brand-logo-wrapper {
        width: 40px;
        height: 40px;
    }
    .brand-title {
        font-size: 1.05rem;
    }
    .brand-subtitle {
        font-size: 0.55rem;
    }
}

.glass-modal {
    background: #1E293B;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid #334155;
    box-shadow: var(--modal-shadow);
    border-radius: 6px;
    color: #F1F5F9;
}

/* Form Controls in Dark Mode */
input, textarea, select {
    background-color: #0F172A !important;
    border: 1px solid #334155 !important;
    color: #F1F5F9 !important;
}
input:focus, textarea:focus, select:focus {
    border-color: #3B82F6 !important;
    outline: 2px solid rgba(59, 130, 246, 0.3) !important;
}
input::placeholder, textarea::placeholder {
    color: #64748B !important;
}

/* Tables in Dark Mode */
table {
    background-color: #1E293B;
    color: #F1F5F9;
    border-collapse: collapse;
    width: 100%;
}
th {
    background-color: #0F172A;
    color: #94A3B8;
    border-bottom: 1px solid #334155;
    padding: 12px 16px;
    font-family: var(--font-display);
    font-weight: 600;
}
td {
    border-bottom: 1px solid #334155;
    padding: 12px 16px;
    color: #F1F5F9;
}
tr:hover td {
    background-color: #334155;
}

/* Neural Wave Line */
.neural-wave-line {
    animation: waveDrift 10s ease-in-out infinite alternate;
}
@keyframes waveDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-40px); }
}

/* EEG Waveform Simulation Canvas */
.eeg-waveform-canvas {
    display: block;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Mobile Navigation Drawer & Accordion Architecture
   -------------------------------------------------------------------------- */
body.menu-open {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none !important;
}

.mobile-drawer-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.mobile-drawer-scrollbar::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
.mobile-drawer-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
.mobile-drawer-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #3B82F6;
}

/* Mobile Accordion Smooth CSS Grid Expansion */
.mobile-accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    opacity: 0;
}
.mobile-accordion-content.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
}
.mobile-accordion-inner {
    overflow: hidden;
    min-height: 0;
}

.mobile-nav-item.is-active {
    border-color: #3B82F6 !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.18);
}
.mobile-nav-item.is-active .mobile-accordion-toggle {
    color: #3B82F6;
}

