/* ULTRA SECURITY UI - V4.0 (The Glisten Update) */
:root {
    --bg-dark: #0a192f;
    --bg-card: rgba(17, 34, 64, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.02);
    --accent-primary: #64ffda;
    --accent-secondary: #00b4d8;
    --accent-warn: #ffd166;
    --accent-danger: #ef476f;
    --text-main: #e6f1ff;
    --text-muted: #8892b0;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
    --easing: cubic-bezier(0.645, 0.045, 0.355, 1);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow: hidden; /* Locked Viewport */
    height: 100vh;
    width: 100vw;
}

/* --- LAYOUT --- */
.assessment-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch; /* Ensure equal height columns */
    padding-top: 120px; /* Navbar clear */
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 20px; padding-right: 20px;
    position: relative;
    z-index: 10;
    height: calc(100vh - 20px); /* Fixed viewport height (accounting for margins) */
    box-sizing: border-box;
    overflow: hidden; /* Prevent page scroll */
}

/* --- HUD SIDEBAR --- */
.hud-panel {
    width: 340px;
    flex-shrink: 0;
    background: rgba(10, 25, 47, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    /* Scroll internally if content exceeds viewport */
    max-height: 100%; 
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    z-index: 100;
    transition: all 0.3s ease;
    
    /* Hide Scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.hud-panel::-webkit-scrollbar { width: 0; height: 0; }

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    border-bottom: 1px solid rgba(100,255,218,0.1);
    padding-bottom: 15px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(100, 255, 218, 0.5);
}

.live-dot {
    width: 6px; height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-primary);
    animation: blink 2s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

.hud-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    position: relative;
}
.hud-section::after {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100,255,218,0.2), transparent);
}

.hud-section:last-child { margin-bottom: 0; padding-bottom: 0; }
.hud-section:last-child::after { display: none; }

.hud-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex; align-items: center; gap: 8px;
}
.hud-label::before { content:''; width: 4px; height: 4px; background: var(--accent-secondary); border-radius: 50%; }

/* Projection Ring */
.projection-container {
    position: relative;
    display: flex; justify-content: center; align-items: center;
    margin: 20px 0;
}

.projection-ring { transform: rotate(-90deg); }

.projection-value {
    position: absolute;
    display: flex; flex-direction: column; align-items: center;
}
.projection-value span {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}
.projection-value small {
    font-size: 0.6rem;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    margin-top: 5px;
    letter-spacing: 1px;
}

.hud-micro-stat {
    display: flex; justify-content: space-between;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 6px;
}

/* Analysis Feed */
.analysis-list { display: flex; flex-direction: column; gap: 10px; }

.analysis-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.4s ease;
}

.analysis-item i { font-size: 0.9rem; color: var(--text-muted); width: 20px; text-align: center; transition: all 0.4s; }

.analysis-text { display: flex; flex-direction: column; }
.a-title { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); transition: color 0.4s; }
.a-status { font-size: 0.65rem; font-family: var(--font-mono); color: #555; margin-top: 2px; transition: color 0.4s; }

/* Locked State */
.analysis-item.locked { opacity: 0.6; filter: grayscale(1); }

/* Unlocked/Active State */
.analysis-item.unlocked {
    background: rgba(100, 255, 218, 0.05);
    border-color: rgba(100, 255, 218, 0.2);
    opacity: 1;
    filter: grayscale(0);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.analysis-item.unlocked i { color: var(--accent-primary); text-shadow: 0 0 10px var(--accent-primary); }
.analysis-item.unlocked .a-title { color: #fff; }
.analysis-item.unlocked .a-status { color: var(--accent-primary); }

/* Risk Bar & Optimizations "Sexy" Update */
.hud-flex-row { display: flex; gap: 15px; }

.hud-stat-box.mini { 
    flex: 1; 
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    padding: 12px; 
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.risk-bar-track {
    height: 6px; /* Slightly thicker */
    width: 100%; 
    background: rgba(0,0,0,0.3); 
    border-radius: 3px; 
    margin-top: 10px; 
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.risk-bar-fill {
    height: 100%; 
    background: linear-gradient(90deg, var(--accent-danger), #ff0044); 
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px var(--accent-danger); /* Stronger Glow */
}

.hud-stat-value#opt-counter {
    font-size: 1.8rem; /* Bigger */
    color: var(--accent-warn);
    text-shadow: 0 0 15px rgba(255, 209, 102, 0.5); /* Neon Glow */
    line-height: 1;
    margin-top: 5px;
    display: block;
    font-weight: 800;
    letter-spacing: -1px;
}

/* Terminal Output Area */
#terminal-output {
    height: 200px; /* Increased height */
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(100,255,218,0.1);
    padding-top: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.term-line {
    margin-bottom: 6px;
    line-height: 1.4;
    word-wrap: break-word;
    padding-left: 10px;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}
.term-line:hover {
    background: rgba(255,255,255,0.02);
    border-left-color: var(--accent-secondary);
}
.type-sys { border-left-color: var(--accent-primary); }
.type-warn { border-left-color: var(--accent-warn); }
.type-crit { border-left-color: var(--accent-danger); }
.term-time { color: #555; margin-right: 8px; font-size: 0.7rem; }


/* --- MAIN PANEL --- */
.artifact-panel {
    flex: 1;
    max-width: 900px;
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(2, 12, 27, 0.5);
    padding: 0;
    
    /* Vertical Flex Layout */
    display: flex;
    flex-direction: column;
    height: auto; /* Let Stretch handle it */
    min-height: 0; /* Allow shrinking */
    position: relative;
    margin: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* The "Glisten" Effect on the card */
.artifact-panel:hover {
    box-shadow: 0 30px 60px -10px rgba(2, 12, 27, 0.6), 0 0 20px rgba(100, 255, 218, 0.05);
    border-color: rgba(100, 255, 218, 0.2);
}

.artifact-panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 50%, 
        rgba(100, 255, 218, 0.02) 51%, 
        transparent 52%
    );
    background-size: 100% 6px;
    pointer-events: none;
    opacity: 0.4;
    z-index: 2;
    mix-blend-mode: overlay;
}

/* Header */
.panel-header {
    padding: 30px 40px;
    background: rgba(2, 12, 27, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 20;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.step-title {
    font-family: var(--font-sans);
    color: #fff;
    font-size: 2rem;
    margin: 0;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 0 30px rgba(100, 255, 218, 0.2);
}

.badge-sys {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-secondary);
    margin-bottom: 15px;
    display: inline-block;
    background: rgba(0, 180, 216, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 180, 216, 0.2);
}

/* Content Area */
.panel-content {
    padding: 0; 
    flex: 1; /* Take remaining space */
    overflow-y: auto; /* Scroll internally */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    /* Subtle mask at bottom only */
    mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
}
.panel-content::-webkit-scrollbar { width: 0; height: 0; }

/* Questions & Prompts */
.question-block {
    display: flex;
    flex-direction: column;
    gap: 30px; /* Enforce hard gap between question and answers */
    padding-bottom: 10px; /* Extra breathing room */
}

.term-prompt {
    font-family: var(--font-sans);
    color: #fff;
    font-size: 1.4rem; /* Classic Size */
    font-weight: 600;
    margin-bottom: 0; /* Reset margin, let gap handle it */
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    flex-shrink: 0; /* Don't shrink text */
}

/* Option Cards - Classic Style Restore */
.grid-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Classic grid */
    gap: 15px; /* Reduced gap */
    /* Safety Valve: If list is huge, scroll internally instead of pushing page */
    max-height: 55vh; 
    overflow-y: auto;
    /* Fix for hover clip: Internal padding allows card to jump up without hitting overflow edge */
    padding: 12px 8px; 
    margin: 0 -8px; /* Compensate for horizontal padding */
}

/* Custom Scrollbar for Grid */
.grid-options::-webkit-scrollbar { width: 6px; }
.grid-options::-webkit-scrollbar-thumb { background: rgba(100, 255, 218, 0.2); border-radius: 3px; }
.grid-options::-webkit-scrollbar-track { background: transparent; }

.option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px; /* Reduced padding */
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px -10px rgba(0,0,0,0.6);
    z-index: 10; /* Force top of stack */
}

.option-card.selected {
    background: rgba(100, 255, 218, 0.12);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary), 0 20px 40px -10px rgba(100, 255, 218, 0.25);
    transform: translateY(-2px);
}

.opt-content {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-sans);
    font-size: 1.05rem; /* Classic size */
}

.opt-icon-box {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s;
}

.option-card.selected .opt-icon-box {
    background: var(--accent-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.5);
}

/* Input Styling - Classic Restore */
.input-group input {
    width: 100%;
    background: rgba(2, 12, 27, 0.8); /* Classic dark input */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px 22px;
    border-radius: 12px;
    color: #fff;
    font-size: 1.15rem;
    font-family: var(--font-sans); /* Use body font like classic */
    transition: all 0.3s ease;
}


.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(100, 255, 218, 0.05);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.1);
    transform: translateY(-2px);
}

/* Range Slider */
.range-container {
    padding: 20px 0;
}

.ultra-range {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.ultra-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-primary);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 4px solid var(--bg-dark);
}

.ultra-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 30px var(--accent-primary);
}

.range-value-display {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-top: 20px;
    font-family: var(--font-mono);
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.4);
}


/* Footer Controls */
.panel-footer {
    padding: 25px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(2, 12, 27, 0.2);
}

.btn-ctrl {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex; align-items: center;
}

.btn-ctrl:hover { 
    color: #fff; 
    border-color: #fff;
    background: rgba(255,255,255,0.05);
}

.btn-next {
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    font-weight: 700;
}

.btn-next:hover {
    background: var(--accent-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.4);
    transform: translateY(-2px);
}

/* Error Pulse */
.pulse-error {
    animation: shake 0.5s ease-in-out;
    border-color: var(--accent-danger) !important;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .assessment-layout {
        flex-direction: column;
    }
    .hud-panel {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 20px;
    }
    .artifact-panel {
        width: 100%;
    }
}

/* --- TRANSITIONS (Added for smoothness) --- */
.step-transition-wrapper {
    transition: opacity 200ms cubic-bezier(0.4, 0.0, 0.2, 1), transform 200ms cubic-bezier(0.4, 0.0, 0.2, 1);
    width: 100%;
    padding: 40px 50px 30px 50px; /* Increased top padding to clear header */
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent flex shrinking */
}

.step-enter {
    opacity: 0;
    transform: translateY(15px);
}

.step-active {
    opacity: 1;
    transform: translateY(0);
}

.step-exit {
    opacity: 0;
    transform: translateY(-15px);
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%;
    pointer-events: none; /* Prevent clicks during exit */
}