/* ── ABG Interpreter & Acid-Base Machine Simulator CSS ── */


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

.abg-page {
    max-width: 1400px;
    margin: 85px auto 40px;
    padding: 0 20px;
    color: #e2e8f0;
    font-family: 'Outfit', 'Inter', sans-serif;
}

/* Nav Header */
.sim-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sim-nav-header .back-link {
    color: #00f0ff;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: transform 0.2s, color 0.2s;
}

.sim-nav-header .back-link:hover {
    color: #00c2a8;
    transform: translateX(-4px);
}

.sim-title-tag {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

/* Console Layout Grid */
.abg-layout {
    display: grid;
    grid-template-columns: 380px 1fr 380px;
    gap: 24px;
    min-height: 720px;
}

@media (max-width: 1200px) {
    .abg-layout {
        grid-template-columns: 360px 1fr;
    }
    .right-panel {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .abg-layout {
        grid-template-columns: 1fr;
    }
    .sliders-panel, .center-telemetry, .right-panel {
        grid-column: span 1;
    }
}

/* Cards Styling */
.abg-card {
    background: rgba(10, 15, 30, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.abg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #00f0ff, #00c2a8);
    opacity: 0.8;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
    color: #e2e8f0;
}

.panel-header i {
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.panel-header-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.panel-header-sub i {
    color: #00c2a8;
}

/* Toggle Switches */
.slider-toggle-wrap {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.slider-toggle-wrap:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
}

.switch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.switch-text-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.switch-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.1px;
}

.switch-subtitle {
    font-size: 0.73rem;
    font-weight: 500;
    color: #64748b;
}

.switch-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.switch-input-wrap input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background-color: #cbd5e1;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.switch-input-wrap input:checked + .switch-slider {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border-color: rgba(45, 212, 191, 0.5);
}

.switch-input-wrap input:checked + .switch-slider::before {
    transform: translateX(20px);
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Sliders List */
.sliders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.slider-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-info label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-ph { background: rgba(0, 240, 255, 0.15); border: 1px solid rgba(0, 240, 255, 0.3); color: #00f0ff; }
.badge-pco2 { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #f59e0b; }
.badge-hco3 { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #10b981; }
.badge-na { background: rgba(236, 72, 153, 0.15); border: 1px solid rgba(236, 72, 153, 0.3); color: #ec4899; }
.badge-cl { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.3); color: #a855f7; }

/* LED Digital Displays */
.digital-display {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 60px;
    text-align: center;
}

.ph-display { color: #00f0ff; text-shadow: 0 0 8px rgba(0, 240, 255, 0.4); }
.pco2-display { color: #f59e0b; text-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.hco3-display { color: #10b981; text-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.na-display { color: #ec4899; text-shadow: 0 0 8px rgba(236, 72, 153, 0.4); }
.cl-display { color: #a855f7; text-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }

/* Custom Sliders */
.custom-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    transition: background 0.3s;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s, background-color 0.15s;
}

.custom-range:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.custom-range:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}

.ph-range::-webkit-slider-thumb { background-color: #00f0ff; box-shadow: 0 0 8px #00f0ff; }
.ph-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.pco2-range::-webkit-slider-thumb { background-color: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.pco2-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.hco3-range::-webkit-slider-thumb { background-color: #10b981; box-shadow: 0 0 8px #10b981; }
.hco3-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.na-range::-webkit-slider-thumb { background-color: #ec4899; box-shadow: 0 0 8px #ec4899; }
.na-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.cl-range::-webkit-slider-thumb { background-color: #a855f7; box-shadow: 0 0 8px #a855f7; }
.cl-range::-webkit-slider-thumb:hover { transform: scale(1.2); }

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #64748b;
}

/* Center Telemetry Panel */
.center-telemetry {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.diagram-wrapper {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 480px;
}

#davenportCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background-color: #050811;
}

/* Analyzer Output LED box */
.analyzer-output-box {
    width: 100%;
    background: radial-gradient(ellipse at center, rgba(16, 24, 48, 0.9) 0%, rgba(8, 12, 24, 0.95) 100%);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.output-led-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #00f0ff;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.diagnostic-readout {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    margin-bottom: 16px;
    border-bottom: 1.5px dashed rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
    min-height: 40px;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tele-val-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.tele-val-box .lbl {
    font-size: 0.74rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.tele-val-box .val {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}

.tele-val-box .cyan-glow {
    color: #00f0ff;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.tele-val-box .sub {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

/* Tabs System */
.panel-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #94a3b8;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #e2e8f0;
}

.tab-btn.active {
    background: rgba(0, 240, 255, 0.1);
    color: #00f0ff;
    box-shadow: 0 2px 10px rgba(0, 240, 255, 0.05);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.tab-content.active {
    display: flex;
}

/* Case Scenarios Presets */
.case-scenarios-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.case-scenarios-selector label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.custom-select {
    background: rgba(13, 18, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 12px;
    border-radius: 10px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.86rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-select:hover {
    border-color: rgba(0, 240, 255, 0.3);
}

.custom-select:focus {
    border-color: #00f0ff;
}

.preset-case-info-card {
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 14px;
    padding: 16px;
    animation: fadeIn 0.4s ease-out forwards;
}

.preset-case-info-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #00f0ff;
    margin-bottom: 6px;
}

.preset-case-info-card p {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin-bottom: 12px;
}

.preset-case-details {
    font-size: 0.76rem;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.quick-cheat-sheet {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 16px;
}

.quick-cheat-sheet h5 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.quick-cheat-sheet ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-cheat-sheet li {
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

.quick-cheat-sheet li strong {
    color: #cbd5e1;
}

/* Quiz Mode Interface */
.quiz-welcome {
    text-align: center;
    padding: 30px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.quiz-welcome h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.quiz-welcome p {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.5;
}

.quiz-rewards-notice {
    background: rgba(249, 223, 123, 0.06);
    border: 1px solid rgba(249, 223, 123, 0.15);
    padding: 10px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: #cbd5e1;
}

.quiz-rewards-notice i {
    font-size: 1.1rem;
}

.btn-primary-glow {
    background: linear-gradient(135deg, #00f0ff 0%, #00c2a8 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    color: #070a13;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    transition: all 0.3s;
    width: 100%;
}

.btn-primary-glow:hover {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
    transform: translateY(-2px);
}

.btn-secondary-glow {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 12px;
    padding: 12px 24px;
    color: #00f0ff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-secondary-glow:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: #00f0ff;
}

/* Quiz Gameplay HUD */
.quiz-gameplay {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.4s ease-out forwards;
}

.quiz-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.quiz-timer {
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quiz-progress {
    color: #cbd5e1;
}

.quiz-telemetry-panel {
    background: #050811;
    border: 1px dashed rgba(0, 240, 255, 0.2);
    padding: 12px;
    border-radius: 10px;
}

.tele-grid-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    font-size: 0.72rem;
    color: #94a3b8;
}

.tele-grid-mini strong {
    color: #e2e8f0;
}

.quiz-case-description {
    font-size: 0.84rem;
    color: #cbd5e1;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: 12px;
    min-height: 80px;
}

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

.quiz-option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-option-group label {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* Quiz Results Screen */
.quiz-results {
    text-align: center;
    padding: 30px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: fadeIn 0.4s ease-out forwards;
}

.results-shield {
    width: 64px;
    height: 64px;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
    margin-bottom: 8px;
}

.results-shield.fail {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.quiz-results h4 {
    font-size: 1.15rem;
    font-weight: 700;
}

.quiz-results p {
    font-size: 0.84rem;
    color: #94a3b8;
}

.xp-payout-banner {
    background: linear-gradient(135deg, rgba(249, 223, 123, 0.12) 0%, rgba(249, 223, 123, 0.02) 100%);
    border: 1px solid #f9df7b;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: #f9df7b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    width: 100%;
    animation: beacon 1.8s infinite;
}

/* Diagnostic History Panel */
.attempts-history-card {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    margin-top: auto;
}

.attempts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 160px;
    overflow-y: auto;
}

.attempt-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attempt-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.attempt-date span {
    font-size: 0.74rem;
    color: #cbd5e1;
}

.attempt-date small {
    font-size: 0.64rem;
    color: #64748b;
}

.badge-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #10b981; }
.badge-fail { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; }

.empty-attempts {
    font-size: 0.74rem;
    color: #64748b;
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes beacon {
    0% { box-shadow: 0 0 10px rgba(249, 223, 123, 0.2); }
    50% { box-shadow: 0 0 20px rgba(249, 223, 123, 0.4); }
    100% { box-shadow: 0 0 10px rgba(249, 223, 123, 0.2); }
}

/* ================================================================
   RESPONSIVE DESIGN FOR ABG INTERPRETER & ACID-BASE MACHINE
   ================================================================ */

@media (max-width: 991px) {
    .abg-page {
        margin-top: 75px;
        padding: 0 16px;
    }
    .abg-card {
        padding: 20px;
        border-radius: 16px;
    }
}

@media (max-width: 768px) {
    .abg-page {
        margin-top: 70px;
        padding: 0 12px;
    }
    .sim-nav-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .diagram-wrapper {
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .abg-page {
        margin-top: 65px;
        padding: 0 10px;
    }
    .abg-card {
        padding: 16px 14px;
        border-radius: 12px;
    }
    .telemetry-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .digital-display {
        font-size: 1rem;
        min-width: 50px;
    }
    .btn-primary-glow, .btn-secondary-glow {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
    .quiz-timer, .quiz-progress {
        font-size: 0.78rem;
    }
}

@media (max-width: 360px) {
    .abg-page {
        padding: 0 8px;
    }
    .panel-header {
        font-size: 0.95rem;
    }
}

