/* 
   MIND EXPLORATION STATION: HTML PORT MAIN STYLESHEET
   Sci-Fi Space Cockpit HUD Aesthetic (Highly Beautified)
*/

:root {
    --bg-primary: #05060f;
    --bg-surface: rgba(16, 18, 35, 0.45);
    --bg-surface-active: rgba(26, 29, 58, 0.65);
    --border-color: rgba(0, 240, 255, 0.15);
    --border-color-glow: rgba(0, 240, 255, 0.4);
    
    --color-cyan: #00f0ff;
    --color-purple: #8a2be2;
    --color-magenta: #ff007f;
    --color-red: #ff2a5f;
    --color-green: #00ff87;
    --color-yellow: #ffdf00;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    
    --glow-cyan: 0 0 15px rgba(0, 240, 255, 0.4);
    --glow-purple: 0 0 15px rgba(138, 43, 226, 0.4);
    --glow-red: 0 0 15px rgba(255, 42, 95, 0.4);
    --glow-green: 0 0 15px rgba(0, 255, 135, 0.4);
    
    --font-cyber: 'Share Tech Mono', 'Courier New', monospace;
    --font-sans: 'Outfit', 'Noto Sans SC', sans-serif;
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 50% 30%, #12132e 0%, #05060f 80%),
        radial-gradient(circle at 10% 80%, #0e051c 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, #031420 0%, transparent 50%);
    color: var(--color-text);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background grid overlay */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center top;
    pointer-events: none;
    z-index: 1;
}

/* Floating Back Button */
.back-btn {
    position: fixed;
    top: 25px;
    left: 25px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-cyan);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.back-btn:hover {
    border-color: var(--color-cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
    background: var(--bg-surface-active);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.back-btn:hover svg {
    transform: scale(1.1);
}

/* Sci-fi HUD Layout */
.hud-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-height: 100vh;
}

/* HUD Header */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 20px;
}

@media (max-width: 768px) {
    .hud-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .dashboard-stats {
        width: 100%;
        justify-content: space-between;
    }
}

.title-area {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.title-badge {
    align-self: flex-start;
    font-family: var(--font-cyber);
    font-size: 11px;
    color: var(--color-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 240, 255, 0.05);
}

.hud-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--color-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
}

.hud-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* Dashboard Status Indicators */
.dashboard-stats {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 150px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    background: var(--bg-surface-active);
}

.stat-label {
    font-family: var(--font-cyber);
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: var(--font-cyber);
    font-size: 28px;
    font-weight: bold;
    margin-top: 2px;
}

#stat-resilience { color: var(--color-cyan); text-shadow: var(--glow-cyan); }
#stat-insight { color: var(--color-purple); text-shadow: var(--glow-purple); }
#stat-calmness { color: var(--color-green); text-shadow: var(--glow-green); }

/* Main Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 25px;
    flex-grow: 1;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel Glass Component */
.panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(15px);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.panel-card:hover {
    border-color: rgba(0, 240, 255, 0.25);
}

/* Glowing top border indicator */
.panel-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-cyan), transparent);
    opacity: 0.7;
}

.panel-card.panel-reactor::after {
    background: linear-gradient(90deg, transparent, var(--color-cyan), transparent);
}

.panel-card.panel-logic::after {
    background: linear-gradient(90deg, transparent, var(--color-purple), transparent);
}

.panel-card.panel-syncer::after {
    background: linear-gradient(90deg, transparent, var(--color-green), transparent);
}

/* Panel Headers */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title svg {
    width: 20px;
    height: 20px;
    color: var(--color-cyan);
}

.panel-logic .panel-title svg { color: var(--color-purple); }
.panel-syncer .panel-title svg { color: var(--color-green); }

.panel-status-badge {
    font-family: var(--font-cyber);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid;
    text-transform: uppercase;
}

/* --------------------------------------------- */
/* 1. EMOTION REACTOR (LEFT PANEL)              */
/* --------------------------------------------- */
.reactor-display {
    height: 200px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.reactor-display::before, .syncer-display::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), linear-gradient(90deg, rgba(0, 240, 255, 0.03), rgba(0, 255, 135, 0.01), rgba(255, 42, 95, 0.02));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.5;
}

/* Core glowing reactor circle */
.reactor-core {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,240,255,0.85) 0%, rgba(0,240,255,0.2) 50%, transparent 75%);
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 2;
    transition: all 0.5s ease;
    animation: core-pulse 2s infinite alternate ease-in-out;
}

@keyframes core-pulse {
    0% { transform: scale(0.95); }
    100% { transform: scale(1.05); }
}

/* Particle canvas inside display */
#canvas-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Warning alert overlay */
.reactor-alert-text {
    position: absolute;
    bottom: 15px;
    font-family: var(--font-cyber);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--color-cyan);
    text-shadow: var(--glow-cyan);
    z-index: 3;
}

.reactor-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.control-label {
    color: var(--color-text-muted);
}

.control-val {
    font-family: var(--font-cyber);
    color: var(--color-cyan);
    font-weight: bold;
}

/* Custom Styled Range Sliders with high-tech glowing look */
.slider-input {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 15px currentColor, inset 0 0 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: 3px solid currentColor;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.slider-input#arousal-slider {
    color: var(--color-cyan);
}

/* Cognitive Reappraisal Selector */
.knob-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.knob-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 500;
}

.knob-btn.active {
    background: var(--color-cyan);
    color: #05060f;
    font-weight: 700;
    box-shadow: var(--glow-cyan);
}

.knob-btn.active.threat {
    background: var(--color-red);
    box-shadow: var(--glow-red);
    color: #ffffff;
}

.reactor-feedback {
    min-height: 70px;
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 12px 18px;
    border-left: 4px solid var(--color-cyan);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}


/* --------------------------------------------- */
/* 2. LOGIC REFACTOR TERMINAL (CENTER PANEL)     */
/* --------------------------------------------- */
.console-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-grow: 1;
}

.terminal-monitor {
    background: rgba(5, 6, 15, 0.9);
    border: 1px solid rgba(138, 43, 226, 0.25);
    border-radius: 12px;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: inset 0 0 25px rgba(138, 43, 226, 0.15), 0 4px 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

.terminal-monitor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.6;
}

.system-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-red);
    font-family: var(--font-cyber);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-red);
    animation: alert-pulse 1s infinite alternate;
}

.thought-display {
    font-family: var(--font-cyber);
    color: #ffd2d2;
    background: rgba(255, 42, 95, 0.06);
    border: 1px solid rgba(255, 42, 95, 0.15);
    padding: 15px 18px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

.refactor-step-title {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--color-purple);
    font-weight: 600;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-button {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 20px;
    color: var(--color-text);
    text-align: left;
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-button:hover {
    background: rgba(138, 43, 226, 0.08);
    border-color: rgba(138, 43, 226, 0.35);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.1);
}

.option-marker {
    font-family: var(--font-cyber);
    background: rgba(138, 43, 226, 0.15);
    color: var(--color-purple);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.2s;
}

.option-button.correct {
    background: rgba(0, 255, 135, 0.08);
    border-color: var(--color-green);
    box-shadow: 0 0 15px rgba(0, 255, 135, 0.1);
}

.option-button.correct .option-marker {
    background: var(--color-green);
    color: #05060f;
}

.option-button.incorrect {
    background: rgba(255, 42, 95, 0.08);
    border-color: var(--color-red);
    box-shadow: 0 0 15px rgba(255, 42, 95, 0.1);
}

.option-button.incorrect .option-marker {
    background: var(--color-red);
    color: #ffffff;
}

.next-challenge-btn {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--color-purple), #a855f7);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--glow-purple);
    display: none;
}

.next-challenge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.5);
}


/* --------------------------------------------- */
/* 3. NEBULA SYNCER BREATHING (RIGHT PANEL)      */
/* --------------------------------------------- */
.syncer-display {
    height: 220px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 135, 0.10);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

/* Circular stardust grid background */
.breathing-orbit {
    position: absolute;
    width: 170px;
    height: 170px;
    border: 1px dashed rgba(0, 255, 135, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 135, 0.9) 0%, rgba(0, 255, 135, 0.3) 50%, rgba(0, 255, 135, 0.08) 75%, transparent 100%);
    box-shadow: 0 0 45px rgba(0, 255, 135, 0.45), inset 0 0 15px rgba(255, 255, 255, 0.5);
    transition: width 4s linear, height 4s linear, background 0.3s;
    position: relative;
    z-index: 5;
}

/* Target breathing ring */
.target-breathing-ring {
    position: absolute;
    width: 140px;
    height: 140px;
    border: 2px solid rgba(0, 255, 135, 0.35);
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.15);
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
}

.breathing-label {
    position: absolute;
    z-index: 10;
    font-family: var(--font-cyber);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

.breathing-counter {
    position: absolute;
    bottom: 25px;
    font-family: var(--font-cyber);
    font-size: 13px;
    color: var(--color-green);
    letter-spacing: 1.5px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 135, 0.3);
}

/* Breathing Actions & Instructions */
.syncer-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.breath-instruction {
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.6;
    background: rgba(0, 255, 135, 0.03);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 135, 0.12);
    width: 100%;
}

.breath-btn {
    width: 100%;
    background: transparent;
    border: 2px solid var(--color-green);
    border-radius: 12px;
    color: var(--color-green);
    padding: 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    outline: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.breath-btn:hover {
    background: rgba(0, 255, 135, 0.08);
    box-shadow: inset 0 0 10px rgba(0, 255, 135, 0.1), var(--glow-green);
}

.breath-btn:active, .breath-btn.pressed {
    background: var(--color-green);
    color: #05060f;
    box-shadow: var(--glow-green);
}

/* Score popups overlay */
.score-popup {
    position: absolute;
    color: var(--color-green);
    font-family: var(--font-cyber);
    font-size: 18px;
    font-weight: bold;
    animation: popup-up 1s forwards ease-out;
    pointer-events: none;
    z-index: 50;
    text-shadow: 0 0 10px rgba(0, 255, 135, 0.7);
}


/* Footer HUD stats */
.hud-footer {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-cyber);
    font-size: 11px;
    color: rgba(0, 240, 255, 0.35);
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
    margin-top: 10px;
}

.footer-decorations {
    display: flex;
    gap: 15px;
}

/* Animations */
@keyframes alert-pulse {
    0% { opacity: 0.3; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); }
}

@keyframes popup-up {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-40px) scale(1.1); opacity: 0; }
}
