/* ==========================================================================
   HỌC VIỆN PHÒNG CHÁY CHỮA CHÁY VÀ CỨU NẠN, CỨU HỘ
   KHOA CƠ SỞ NGÀNH PCCC (K6)
   3D Simulation Virtual Laboratory Stylesheet (Three.js WebGL)
   simulations.css
   ========================================================================== */

/* 1. Hero Header */
.sim-hero {
    background: linear-gradient(135deg, #07172b 0%, #0b2545 60%, #164070 100%);
    color: #ffffff;
    padding: 36px 0 28px;
    border-bottom: 3px solid var(--accent, #b71c1c);
    position: relative;
    overflow: hidden;
}

.sim-hero::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: radial-gradient(circle at 85% 20%, rgba(183, 28, 28, 0.25) 0%, transparent 60%),
                radial-gradient(circle at 15% 80%, rgba(212, 136, 6, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.sim-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sim-badge-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fbbf24;
    width: fit-content;
}

.sim-hero-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
    color: #ffffff;
}

.sim-hero-desc {
    font-size: 14.5px;
    color: #cbd5e1;
    max-width: 900px;
    margin: 0;
    line-height: 1.65;
}

.sim-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.sim-stat-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 14px;
    backdrop-filter: blur(4px);
}

.sim-stat-box .stat-num {
    font-size: 20px;
    font-weight: 800;
    color: #fbbf24;
    line-height: 1.2;
}

.sim-stat-box .stat-label {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 500;
}

/* 2. Simulation Tabs */
.sim-tabs-wrapper {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.sim-tabs-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.sim-tabs-nav::-webkit-scrollbar {
    display: none;
}

.sim-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.sim-tab-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.sim-tab-btn.active {
    background: var(--primary, #0b2545);
    color: #ffffff;
    border-color: var(--primary, #0b2545);
    box-shadow: 0 4px 12px rgba(11, 37, 69, 0.25);
}

.sim-tab-btn .tab-ch-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.08);
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
}

.sim-tab-btn.active .tab-ch-tag {
    background: #d48806;
    color: #ffffff;
}

/* 3. Main Workspace Layout */
.sim-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 24px 0 40px;
}

@media (min-width: 992px) {
    .sim-workspace {
        grid-template-columns: 1.45fr 1fr;
        align-items: start;
    }
}

/* 4. 3D Viewport Stage */
.sim-stage-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.sim-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #0f172a;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    gap: 8px;
}

.sim-stage-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sim-stage-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #f8fafc;
}

.sim-stage-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    background: #b71c1c;
    color: #ffffff;
}

.sim-stage-hud-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-hud {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #f8fafc;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-hud:hover {
    background: rgba(255,255,255,0.22);
    border-color: #fbbf24;
    color: #ffffff;
}

.sim-canvas-container {
    position: relative;
    width: 100%;
    height: 480px;
    min-height: 420px;
    background: radial-gradient(circle at 50% 50%, #111e33 0%, #070e1a 100%);
    overflow: hidden;
    touch-action: none;
}

@media (max-width: 768px) {
    .sim-canvas-container {
        height: 380px;
        min-height: 340px;
    }
}

.sim-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    outline: none;
}

/* 3D Viewport Floating Overlay Controls */
.sim-canvas-overlay-ctrls {
    position: absolute;
    bottom: 14px;
    left: 14px;
    display: flex;
    gap: 6px;
    z-index: 10;
    flex-wrap: wrap;
}

.sim-canvas-legend {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    color: #ffffff;
    font-size: 11.5px;
    z-index: 10;
    backdrop-filter: blur(6px);
    max-width: 220px;
}

.sim-legend-gradient {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #3b82f6 0%, #10b981 30%, #eab308 60%, #ef4444 100%);
    margin: 6px 0 4px;
}

.sim-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #94a3b8;
    font-weight: 700;
}

/* 5. Controls & Calculations Sidebar */
.sim-controls-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.sim-ctrl-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sim-ctrl-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-ctrl-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 850px;
    overflow-y: auto;
}

/* Preset selector */
.sim-preset-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.sim-preset-label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sim-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
}

.sim-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Parameter Sliders */
.sim-param-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sim-param-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.sim-param-name {
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sim-param-badge {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 800;
    color: #0b2545;
    font-family: monospace;
}

.sim-range-input {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.sim-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0b2545;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.1s;
}

.sim-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: #b71c1c;
}

/* Layer Switcher Pills */
.sim-layer-tabs {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.sim-layer-tab {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.15s ease;
}

.sim-layer-tab.active {
    background: #ffffff;
    color: #0b2545;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 6. Results & Calculations Display */
.sim-results-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.sim-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.sim-kpi-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}

.sim-kpi-box.highlight {
    border-color: #fca5a5;
    background: #fff5f5;
}

.sim-kpi-box.highlight-gold {
    border-color: #fde68a;
    background: #fffbeb;
}

.sim-kpi-box.highlight-blue {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.sim-kpi-lbl {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sim-kpi-val {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    font-family: 'Be Vietnam Pro', sans-serif;
    line-height: 1.2;
}

.sim-kpi-val small {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

/* PCCC Safety Evaluation Box */
.sim-pccc-eval {
    margin: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 5px solid;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.sim-pccc-eval.pass {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #14532d;
}

.sim-pccc-eval.warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #78350f;
}

.sim-pccc-eval.danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #7f1d1d;
}

.sim-eval-icon {
    font-size: 22px;
    line-height: 1;
}

.sim-eval-content h5 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 800;
}

.sim-eval-content p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
}

/* Mathematical Formula Derivation Box */
.sim-formula-box {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.sim-formula-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sim-step-calc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 8px;
    overflow-x: auto;
}

/* 2D Canvas Chart */
.sim-chart-wrap {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

.sim-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sim-chart-header h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.sim-chart-canvas {
    width: 100%;
    height: 140px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: block;
}

/* Instructions & Theory Accordion */
.sim-theory-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sim-theory-title {
    font-size: 16px;
    font-weight: 800;
    color: #0b2545;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-theory-text {
    font-size: 13.5px;
    line-height: 1.65;
    color: #334155;
    margin: 0;
}
