/* LIMBIC Study Mode v3.0 - Evolving Visualization UI */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-elevated: #22222f;
    --text-primary: #f0f0f5;
    --text-secondary: #888899;
    --text-muted: #555566;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --border: #252535;
    --radius: 8px;

    /* Category colors */
    --reactivity: #ef4444;
    --intensity: #f59e0b;
    --persistence: #22c55e;
    --regulation: #06b6d4;
    --trigger: #8b5cf6;
    --context: #ec4899;
    --baseline: #6366f1;
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   SPLIT VIEW LAYOUT
   ======================================== */

#split-view {
    display: grid;
    grid-template-columns: 1fr 480px;
    height: 100vh;
}

/* ========================================
   VISUALIZATION PANEL
   ======================================== */

#viz-panel {
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
}

#viz-canvas {
    width: 100%;
    height: 100%;
}

#axis-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.axis-label {
    position: absolute;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

.x-pos {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--reactivity);
}

.x-neg {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--reactivity);
}

.y-pos {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--success);
}

.y-neg {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--success);
}

.z-pos {
    right: 20px;
    bottom: 80px;
    color: var(--intensity);
}

.z-neg {
    left: 20px;
    top: 80px;
    color: var(--intensity);
}

/* Stats Overlay */
#stats-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: rgba(18, 18, 26, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Prediction Panel */
#prediction-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 16px 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
}

#prediction-panel.hidden {
    display: none;
}

.prediction-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

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

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.prediction-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Monaco', monospace;
    color: var(--text-primary);
}

.prediction-range {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   ASSESSMENT PANEL
   ======================================== */

#assessment-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 20px;
    color: var(--accent);
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

.phase-indicator {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ========================================
   SCREENS
   ======================================== */

.screen {
    display: none;
    flex: 1;
    padding: 32px 24px;
    overflow-y: auto;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ========================================
   START SCREEN
   ======================================== */

#start-screen {
    justify-content: center;
}

.screen-content {
    text-align: center;
}

.screen-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.screen-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
}

.feature-icon {
    color: var(--accent);
}

/* ========================================
   QUESTION SCREEN
   ======================================== */

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.category-badge {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent);
}

.category-badge.verification {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.question-number {
    font-size: 12px;
    color: var(--text-muted);
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.question-context {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}

.options-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
}

.option-item.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent);
}

.option-marker {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.option-item.selected .option-marker {
    border-color: var(--accent);
    background: var(--accent);
}

.option-marker::after {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.option-item.selected .option-marker::after {
    opacity: 1;
}

.option-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.option-value {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Monaco', monospace;
    opacity: 0.6;
}

.question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.selection-info {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   VERIFICATION SCREEN
   ======================================== */

.verification-header {
    text-align: center;
    margin-bottom: 24px;
}

.phase-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.verification-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.verification-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.verification-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.v-stat {
    text-align: center;
}

.v-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--success);
}

.v-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ========================================
   RESULTS SCREEN
   ======================================== */

.results-header {
    text-align: center;
    margin-bottom: 24px;
}

.results-header h2 {
    font-size: 22px;
}

.results-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.result-card {
    flex: 1;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    text-align: center;
}

.result-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.profile-summary {
    flex: 1;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow-y: auto;
}

.results-actions {
    display: flex;
    gap: 12px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
    flex: 1;
    padding: 14px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #5558e3;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* ========================================
   NAME INPUT SECTION
   ======================================== */

.name-input-section {
    margin: 32px 0;
    text-align: left;
}

.name-input-section label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.name-input-section input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.2s;
}

.name-input-section input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-elevated);
}

.name-input-section input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ========================================
   ASSESSMENT INFO
   ======================================== */

.assessment-info {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 28px 0;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-icon {
    font-size: 18px;
}

.info-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   CHART CONTAINER
   ======================================== */

.chart-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    max-height: 300px;
}

.chart-container canvas {
    max-height: 260px !important;
}

/* ========================================
   PARTICIPANT NAME
   ======================================== */

.participant-name {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   RESULTS ACTIONS ENHANCED
   ======================================== */

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.results-actions .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.results-actions .btn-primary span {
    font-size: 18px;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}