/* QTrainer Main Styles - Extracted from qtrainer.html */

:root {
    --bg-gradient: linear-gradient(135deg, #0c0c1e 0%, #1a1a2e 50%, #16213e 100%);
    --primary-cyan: #00ffff;
    --success-green: #00ff88;
    --error-red: #ff6b6b;
    --text-white: #ffffff;
    --text-gray: #cccccc;
    --panel-bg: rgba(255, 255, 255, 0.05);
    --border-cyan: rgba(0, 255, 255, 0.2);
    --border-primary: rgba(0, 255, 255, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-white);
    min-height: 100vh;
    padding: 20px;
}

/* User Mode: Simplified UI for real users (Scott 2025-12-03) */
body.user-mode .verbose-only {
    display: none !important;
}
body.user-mode .header {
    display: none !important;
}
body.user-mode .panels-grid {
    display: none !important;
}
body.user-mode .visualization-area {
    height: calc(100vh - 60px);
    margin-bottom: 0;
}
body.user-mode .integrated-stats-panel {
    /* User mode: Compact panel showing only Combined stats */
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
}
/* User mode: Change header title */
body.user-mode #stats-panel-title {
    font-size: 0 !important;
}
body.user-mode #stats-panel-title::after {
    content: 'SESSION';
    font-size: 13px;
    letter-spacing: 2px;
}

/* User Mode Controls Bar (Scott Dec 6: "What's missing is user controls") */
.user-mode-controls {
    display: none;  /* Hidden by default, shown in user mode */
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,20,40,0.95);
    border: 1px solid rgba(0,255,255,0.5);
    border-radius: 8px;
    padding: 8px 16px;
    gap: 12px;
    z-index: 100;
    align-items: center;
    font-size: 12px;
}
body.user-mode .user-mode-controls {
    display: flex !important;
}
.user-mode-controls .control-group {
    display: flex;
    align-items: center;
    gap: 4px;
}
.user-mode-controls .control-label {
    color: var(--text-gray);
    margin-right: 4px;
}
.user-mode-controls .focus-btn,
.user-mode-controls .aim-btn {
    padding: 4px 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-gray);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}
.user-mode-controls .focus-btn:hover,
.user-mode-controls .aim-btn:hover {
    background: rgba(0,255,255,0.1);
    border-color: rgba(0,255,255,0.4);
}
.user-mode-controls .focus-btn.active,
.user-mode-controls .aim-btn.active {
    background: rgba(0,255,255,0.3);
    border: 2px solid var(--primary-cyan);
    color: var(--primary-cyan);
    font-weight: bold;
}
.user-mode-controls select {
    padding: 4px 8px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(0,255,255,0.3);
    color: var(--text-white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.user-mode-controls .reset-btn {
    padding: 4px 10px;
    background: rgba(255,100,100,0.2);
    border: 1px solid rgba(255,100,100,0.5);
    color: #ff6666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.user-mode-controls .reset-btn:hover {
    background: rgba(255,100,100,0.4);
}

/* Mode toggle button */
.mode-toggle-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    padding: 8px 16px;
    font-size: 12px;
    background: rgba(0,20,40,0.9);
    color: #00ffff;
    border: 1px solid rgba(0,255,255,0.5);
    border-radius: 4px;
    cursor: pointer;
    font-family: monospace;
    transition: all 0.3s;
}
.mode-toggle-btn:hover {
    background: rgba(0,255,255,0.2);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary-cyan);
    padding-bottom: 20px;
}

.header h1 {
    font-size: 2.5em;
    color: var(--primary-cyan);
    text-shadow: 0 0 20px var(--primary-cyan);
    margin-bottom: 10px;
}

.header p {
    color: var(--text-gray);
    font-size: 1.1em;
}

.visualization-area {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-cyan);
    border-radius: 15px;
    height: 350px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;  /* Elevate stacking context above panels-grid */
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#icosphere-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 15px;
    /* Offset to center between asymmetric panels (left: 415px, right: 215px) */
    margin-left: 100px;
}

.status-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-gray);
    backdrop-filter: blur(5px);
    z-index: 10;
}

.panels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    grid-auto-flow: column;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
    align-items: start;
}

@media (max-width: 900px) {
    .panels-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, auto);
    }
}

@media (max-width: 800px) {
    .panels-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, auto);
    }
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-cyan);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.panel.primary {
    border-color: var(--border-primary);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

.panel h3 {
    color: var(--primary-cyan);
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: bold;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.status-label {
    color: var(--text-gray);
}

.status-value {
    color: var(--text-white);
    font-weight: 500;
}

.status-value.positive {
    color: var(--success-green);
}

.status-value.negative {
    color: var(--error-red);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    margin: 5px;
}

.btn:hover {
    transform: scale(1.03);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), #0088cc);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #666, #444);
    color: var(--text-white);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-red), #cc4444);
    color: var(--text-white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

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

.stat-value {
    color: var(--primary-cyan);
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
}

.stat-label {
    color: var(--text-gray);
    font-size: 0.85em;
    margin-top: 4px;
}

.radio-group {
    margin: 15px 0;
}

.radio-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.radio-item input[type="radio"] {
    margin-right: 10px;
    accent-color: var(--primary-cyan);
}

.progress-section {
    margin-top: 15px;
    display: none;
}

.progress-section.active {
    display: block;
}

.progress-bar {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-cyan), var(--success-green));
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-family: 'Courier New', monospace;
    margin-top: 5px;
}

.system-log {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.log-entry {
    color: var(--text-gray);
    margin-bottom: 5px;
}

.log-entry.success {
    color: var(--success-green);
}

.log-entry.error {
    color: var(--error-red);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
}

.status-dot.green {
    background: var(--success-green);
    box-shadow: 0 0 8px var(--success-green);
}

.status-dot.red {
    background: var(--error-red);
    box-shadow: 0 0 8px var(--error-red);
}

.status-dot.cyan {
    background: var(--primary-cyan);
    box-shadow: 0 0 8px var(--primary-cyan);
}

.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--error-red);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.significant {
    color: var(--success-green) !important;
    font-weight: bold;
}

/* Trial result states */
.hit-state {
    color: var(--success-green) !important;
    text-shadow: 0 0 10px var(--success-green);
}

.miss-state {
    color: var(--error-red) !important;
    text-shadow: 0 0 10px var(--error-red);
}

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

    .visualization-area {
        height: 250px;
    }

    .header h1 {
        font-size: 2em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1400px) {
    .panels-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Scott's Baseline Testing 4-Tier Decision System Styles */
.tier-decision {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    margin: 8px 0;
}

.tier-pass {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

.tier-retest-mild {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid #ffaa00;
}

.tier-retest-moderate {
    background: rgba(255, 136, 0, 0.2);
    color: #ff8800;
    border: 1px solid #ff8800;
}

.tier-fail {
    background: rgba(255, 107, 107, 0.2);
    color: var(--error-red);
    border: 1px solid var(--error-red);
}

.baseline-controls {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.baseline-controls .btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    font-size: 0.9em;
}

/* Pulse animation for value changes (Scott Jan 2026) */
@keyframes pulse-cyan {
    0% {
        color: #fff;
        text-shadow: 0 0 12px rgba(0,255,255,0.8);
    }
    100% {
        color: var(--primary-cyan);
        text-shadow: none;
    }
}

/* APM Cell Hover Effects (from inline style block) */
@keyframes shimmer {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

.apm-cell:hover {
    background: linear-gradient(180deg, rgba(0,255,255,0.12) 0%, rgba(0,200,255,0.06) 100%) !important;
    border-color: rgba(0,255,255,0.3) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,255,255,0.15);
}

/* APM Method Family Visual Grouping (Verbose mode)
   Strong visual differentiation WITHOUT implying correct/incorrect
   Uses distinct hues that are neutral (not red/green traffic light colors) */

/* Core Methods: MV, RWBA - Electric Blue */
#apm-stats-row .apm-cell:nth-child(1),
#apm-stats-row .apm-cell:nth-child(10) {
    background: rgba(0,150,255,0.25) !important;
    border: 2px solid rgba(0,180,255,0.7) !important;
    box-shadow: inset 0 0 10px rgba(0,150,255,0.2);
}

/* Autocorrelation: AC1 - Violet/Purple */
#apm-stats-row .apm-cell:nth-child(2) {
    background: rgba(140,80,220,0.25) !important;
    border: 2px solid rgba(160,100,255,0.7) !important;
    box-shadow: inset 0 0 10px rgba(140,80,220,0.2);
}

/* Runs Analysis: RA1-RA5 - Gold/Yellow (neutral warm, not warning orange) */
#apm-stats-row .apm-cell:nth-child(3),
#apm-stats-row .apm-cell:nth-child(4),
#apm-stats-row .apm-cell:nth-child(5),
#apm-stats-row .apm-cell:nth-child(6) {
    background: rgba(200,170,50,0.25) !important;
    border: 2px solid rgba(220,190,80,0.7) !important;
    box-shadow: inset 0 0 10px rgba(200,170,50,0.2);
}

/* Cluster Analysis: CA7, CA15, CA23 - Teal/Aquamarine */
#apm-stats-row .apm-cell:nth-child(7),
#apm-stats-row .apm-cell:nth-child(8),
#apm-stats-row .apm-cell:nth-child(9) {
    background: rgba(0,180,150,0.25) !important;
    border: 2px solid rgba(0,210,180,0.7) !important;
    box-shadow: inset 0 0 10px rgba(0,180,150,0.2);
}
