/* ==========================================================================
   Ohm's Law Virtual Laboratory Simulator Stylesheet
   Theme: University Engineering & Physics Laboratory (Clean Light Theme)
   ========================================================================== */

/* --- CSS Variables & Design System --- */
:root {
    --primary: #0284c7;            /* Electric / Lab Blue */
    --primary-dark: #0369a1;
    --primary-light: #e0f2fe;
    --accent: #2563eb;             /* Voltmeter / Highlight Blue */
    --accent-dark: #1d4ed8;
    --secondary: #475569;          /* Neutral Slate */
    --success: #059669;            /* Verification Green */
    --success-light: #d1fae5;
    --warning: #d97706;            /* Alert Amber */
    --danger: #dc2626;             /* Power / Ammeter Red */
    
    --bg-page: #f1f5f9;            /* Lab Light Background */
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;
    --border-color: #cbd5e1;
    --border-focus: #38bdf8;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', monospace;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* --- Basic Resets --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Header Layout --- */
.lab-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 24px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lab-icon {
    width: 44px;
    height: 44px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(2, 132, 199, 0.2);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.brand .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.verification-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: var(--transition-normal);
}

.verification-badge.verified {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.3);
}

.verification-badge.unverified {
    background-color: #fef3c7;
    color: var(--warning);
    border: 1px solid rgba(217, 119, 6, 0.3);
}

/* --- Container & Layout Grid --- */
.lab-container {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Shared Panel Card Styles --- */
.panel-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* --- Mode Selector Bar --- */
.mode-bar-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.mode-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.mode-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tab-group {
    display: flex;
    background-color: var(--bg-subtle);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 4px;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background-color: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.mode-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    background-color: var(--primary-light);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

/* --- Experiment Main Grid (Desktop Layout) --- */
.experiment-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

/* --- Controls Panel --- */
.controls-panel {
    background-color: var(--bg-card);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.off {
    background-color: var(--text-muted);
    box-shadow: none;
}

/* Circuit Switch UI */
.switch-group {
    background-color: var(--bg-subtle);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.control-label-main {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.switch-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition-normal);
}

.switch-btn.switch-on {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.switch-btn.switch-off {
    background-color: #fef2f2;
    color: var(--danger);
    border-color: #fecaca;
}

.switch-slider {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: currentColor;
}

.switch-indicator-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Control Group Sliders & Numerical Display */
.divider {
    border: 0;
    height: 1px;
    background-color: #f1f5f9;
    margin: 4px 0;
}

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

.control-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.control-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.numeric-input-wrap {
    display: flex;
    align-items: center;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
}

.numeric-input-wrap input {
    width: 60px;
    border: none;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
    color: var(--text-primary);
    outline: none;
}

.numeric-input-wrap .unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-left: 4px;
}

/* Modern Range Slider Styling */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #ffffff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--primary-dark);
}

.presets-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.preset-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-preset {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-preset:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Action Buttons */
.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-outline {
    background-color: transparent;
    color: var(--secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* --- SVG Circuit Schematic Hero Section --- */
.circuit-hero-panel {
    background-color: var(--bg-card);
}

.circuit-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 4px;
    border-radius: 2px;
}

.wire-color {
    background-color: #475569;
}

.particle-color {
    background-color: #0284c7;
}

.svg-circuit-wrapper {
    width: 100%;
    background: radial-gradient(circle at center, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#circuit-svg {
    width: 100%;
    height: auto;
    max-height: 480px;
    display: block;
}

/* --- Live Telemetry Cards Row --- */
.telemetry-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.telemetry-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-voltage { background-color: #eff6ff; color: var(--accent); }
.icon-resistance { background-color: #fefce8; color: #ca8a04; }
.icon-current { background-color: #e0f2fe; color: var(--primary); }
.icon-power { background-color: #fef2f2; color: var(--danger); }

.card-content {
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-valueHighlight {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.card-value .unit, .card-valueHighlight .unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Analysis Grid (Chart & Observation Table) --- */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    justify-content: center;
}

#vi-graph-canvas {
    width: 100%;
    height: auto;
    max-height: 340px;
    display: block;
}

.chart-footer-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.dot-legend {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-theoretical { background-color: var(--primary); }
.dot-experimental { background-color: var(--danger); }

/* --- Table Styling --- */
.table-count {
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 340px;
    overflow-y: auto;
}

.lab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: center;
}

.lab-table th {
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.lab-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.lab-table tbody tr:hover {
    background-color: var(--primary-light);
}

.empty-row td {
    font-family: var(--font-main);
    color: var(--text-muted);
    padding: 36px 16px;
}

/* --- Educational Section --- */
.educational-section {
    background-color: var(--bg-card);
}

.edu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.edu-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.edu-card {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edu-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.edu-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.equation-box {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--primary-dark);
    font-weight: 600;
    overflow-x: auto;
    max-width: 100%;
}

.equation-box .eq-main {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.equation-box .eq-sub {
    font-size: 0.9rem;
}

/* MathJax Container Overflow Protection */
.mjx-chtml, .MathJax, mjx-container {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin: 4px 0 !important;
}

.procedure-list, .apps-list {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    line-height: 1.5;
}

/* --- Footer --- */
.lab-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    padding: 16px 24px;
    margin-top: 40px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN ADAPTATIONS
   ========================================================================== */

/* Tablet (Portrait & Landscape down to 992px) */
@media (max-width: 1024px) {
    .experiment-grid {
        grid-template-columns: 1fr;
    }

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

/* Mobile Stacked Layout (Portrait < 768px) */
@media (max-width: 768px) {
    .lab-header {
        padding: 12px 16px;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .lab-container {
        padding: 0 12px;
        margin: 16px auto;
    }

    .mode-selector {
        flex-direction: column;
        align-items: flex-start;
    }

    .tab-group {
        width: 100%;
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
    }

    .telemetry-row {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 480px) {
    .telemetry-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   DARK THEME DESIGN SYSTEM OVERRIDES (Ohm's Law Virtual Lab)
   ========================================================================== */

html[data-theme="dark"],
html.dark,
:root[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --primary-light: rgba(56, 189, 248, 0.12);
    --accent: #60a5fa;
    --accent-dark: #3b82f6;
    --secondary: #94a3b8;
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg-page: #0b0f19;
    --bg-card: #111827;
    --bg-subtle: #1e293b;
    --border-color: #334155;
    --border-focus: #38bdf8;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] body,
html.dark body {
    background-color: #0b0f19;
    color: #f8fafc;
}

/* Header */
html[data-theme="dark"] .lab-header,
html.dark .lab-header {
    background-color: #111827;
    border-bottom-color: #1f2937;
}

html[data-theme="dark"] .lab-icon,
html.dark .lab-icon {
    background-color: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.25);
}

html[data-theme="dark"] .brand h1,
html.dark .brand h1 {
    color: #f8fafc;
}

html[data-theme="dark"] .brand .subtitle,
html.dark .brand .subtitle {
    color: #94a3b8;
}

/* Mode Bar */
html[data-theme="dark"] .mode-bar-card,
html.dark .mode-bar-card {
    background-color: #111827;
    border-color: #1f2937;
}

html[data-theme="dark"] .tab-group,
html.dark .tab-group {
    background-color: #0f172a;
    border-color: #1e293b;
}

html[data-theme="dark"] .tab-btn,
html.dark .tab-btn {
    color: #94a3b8;
}

html[data-theme="dark"] .tab-btn:hover,
html.dark .tab-btn:hover {
    color: #f8fafc;
}

html[data-theme="dark"] .tab-btn.active,
html.dark .tab-btn.active {
    background-color: #1e293b;
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

html[data-theme="dark"] .mode-description,
html.dark .mode-description {
    background-color: rgba(56, 189, 248, 0.1);
    color: #bae6fd;
    border-left: 3px solid #38bdf8;
}

/* Panels */
html[data-theme="dark"] .panel-card,
html.dark .panel-card {
    background-color: #111827;
    border-color: #1f2937;
}

html[data-theme="dark"] .panel-header,
html.dark .panel-header {
    border-bottom-color: #1f2937;
}

html[data-theme="dark"] .panel-header h2,
html.dark .panel-header h2 {
    color: #f8fafc;
}

html[data-theme="dark"] .panel-subtitle,
html.dark .panel-subtitle {
    color: #94a3b8;
}

/* Switch & Controls */
html[data-theme="dark"] .switch-group,
html.dark .switch-group {
    background-color: #0f172a;
    border-color: #1e293b;
}

html[data-theme="dark"] .switch-btn.switch-on,
html.dark .switch-btn.switch-on {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

html[data-theme="dark"] .switch-btn.switch-off,
html.dark .switch-btn.switch-off {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

html[data-theme="dark"] .switch-indicator-status,
html.dark .switch-indicator-status {
    background-color: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

html[data-theme="dark"] .divider,
html.dark .divider {
    background-color: #1f2937;
}

html[data-theme="dark"] .numeric-input-wrap,
html.dark .numeric-input-wrap {
    background-color: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .numeric-input-wrap input,
html.dark .numeric-input-wrap input {
    color: #f8fafc;
}

html[data-theme="dark"] .range-slider,
html.dark .range-slider {
    background: #1e293b;
}

html[data-theme="dark"] .range-slider::-webkit-slider-thumb,
html.dark .range-slider::-webkit-slider-thumb {
    background: #38bdf8;
    border-color: #0f172a;
}

html[data-theme="dark"] .btn-preset,
html.dark .btn-preset {
    background-color: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme="dark"] .btn-preset:hover,
html.dark .btn-preset:hover {
    background-color: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border-color: #38bdf8;
}

html[data-theme="dark"] .btn-primary,
html.dark .btn-primary {
    background-color: #0284c7;
    color: #ffffff;
}

html[data-theme="dark"] .btn-primary:hover,
html.dark .btn-primary:hover {
    background-color: #0369a1;
}

html[data-theme="dark"] .btn-secondary,
html.dark .btn-secondary {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .btn-secondary:hover,
html.dark .btn-secondary:hover {
    background-color: #334155;
}

html[data-theme="dark"] .btn-outline,
html.dark .btn-outline {
    background-color: transparent;
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme="dark"] .btn-outline:hover,
html.dark .btn-outline:hover {
    background-color: #1e293b;
    color: #f8fafc;
}

/* SVG Schematic Hero */
html[data-theme="dark"] .svg-circuit-wrapper,
html.dark .svg-circuit-wrapper {
    background: radial-gradient(circle at center, #0f172a 0%, #090d16 100%);
    border-color: #1e293b;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] #circuit-wires path,
html.dark #circuit-wires path {
    stroke: #64748b;
}

html[data-theme="dark"] #component-ammeter circle:nth-of-type(1),
html.dark #component-ammeter circle:nth-of-type(1) {
    fill: #0f172a;
    stroke: #334155;
}

html[data-theme="dark"] #component-ammeter circle:nth-of-type(2),
html.dark #component-ammeter circle:nth-of-type(2) {
    fill: rgba(56, 189, 248, 0.15);
    stroke: #38bdf8;
}

html[data-theme="dark"] #component-ammeter text:nth-of-type(1),
html.dark #component-ammeter text:nth-of-type(1) {
    fill: #38bdf8;
}

html[data-theme="dark"] #svg-ammeter-read,
html.dark #svg-ammeter-read {
    fill: #f8fafc;
}

html[data-theme="dark"] #component-ammeter text:nth-of-type(3),
html.dark #component-ammeter text:nth-of-type(3) {
    fill: #38bdf8;
}

html[data-theme="dark"] #component-voltmeter rect:nth-of-type(2),
html.dark #component-voltmeter rect:nth-of-type(2) {
    fill: #0f172a;
    stroke: #334155;
}

html[data-theme="dark"] #component-voltmeter text:nth-of-type(3),
html.dark #component-voltmeter text:nth-of-type(3) {
    fill: #60a5fa;
}

html[data-theme="dark"] #svg-voltmeter-read,
html.dark #svg-voltmeter-read {
    fill: #f8fafc;
}

html[data-theme="dark"] #component-switch rect,
html.dark #component-switch rect {
    fill: #1e293b;
    stroke: #475569;
}

html[data-theme="dark"] #component-switch text:first-of-type,
html.dark #component-switch text:first-of-type {
    fill: #94a3b8;
}

/* Telemetry Cards */
html[data-theme="dark"] .telemetry-card,
html.dark .telemetry-card {
    background-color: #111827;
    border-color: #1f2937;
}

html[data-theme="dark"] .icon-voltage,
html.dark .icon-voltage { background-color: rgba(96, 165, 250, 0.15); color: #60a5fa; }

html[data-theme="dark"] .icon-resistance,
html.dark .icon-resistance { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }

html[data-theme="dark"] .icon-current,
html.dark .icon-current { background-color: rgba(56, 189, 248, 0.15); color: #38bdf8; }

html[data-theme="dark"] .icon-power,
html.dark .icon-power { background-color: rgba(239, 68, 68, 0.15); color: #f87171; }

html[data-theme="dark"] .card-title,
html.dark .card-title {
    color: #94a3b8;
}

html[data-theme="dark"] .card-value,
html.dark .card-value {
    color: #f8fafc;
}

html[data-theme="dark"] .card-valueHighlight,
html.dark .card-valueHighlight {
    color: #38bdf8;
}

html[data-theme="dark"] .card-value .unit,
html[data-theme="dark"] .card-valueHighlight .unit,
html.dark .card-value .unit,
html.dark .card-valueHighlight .unit {
    color: #94a3b8;
}

/* Graph & Table */
html[data-theme="dark"] .canvas-wrapper,
html.dark .canvas-wrapper {
    background-color: #0f172a;
    border-color: #1e293b;
}

html[data-theme="dark"] .chart-footer-note,
html.dark .chart-footer-note {
    color: #94a3b8;
}

html[data-theme="dark"] .table-count,
html.dark .table-count {
    background-color: #1e293b;
    color: #94a3b8;
}

html[data-theme="dark"] .table-responsive,
html.dark .table-responsive {
    border-color: #1f2937;
}

html[data-theme="dark"] .lab-table th,
html.dark .lab-table th {
    background-color: #0f172a;
    color: #94a3b8;
    border-bottom-color: #1e293b;
}

html[data-theme="dark"] .lab-table td,
html.dark .lab-table td {
    border-bottom-color: #1e293b;
    color: #f8fafc;
}

html[data-theme="dark"] .lab-table tbody tr:hover,
html.dark .lab-table tbody tr:hover {
    background-color: rgba(56, 189, 248, 0.08);
}

/* Educational Cards */
html[data-theme="dark"] .educational-section,
html.dark .educational-section {
    background-color: #111827;
}

html[data-theme="dark"] .edu-header,
html.dark .edu-header {
    border-bottom-color: #1f2937;
}

html[data-theme="dark"] .edu-icon,
html.dark .edu-icon {
    background-color: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

html[data-theme="dark"] .edu-card,
html.dark .edu-card {
    background-color: #0f172a;
    border-color: #1e293b;
}

html[data-theme="dark"] .edu-card h3,
html.dark .edu-card h3 {
    color: #f8fafc;
}

html[data-theme="dark"] .edu-card p,
html.dark .edu-card p {
    color: #94a3b8;
}

html[data-theme="dark"] .equation-box,
html.dark .equation-box {
    background-color: #1e293b;
    border-color: #334155;
    color: #38bdf8;
}

html[data-theme="dark"] .procedure-list,
html[data-theme="dark"] .apps-list,
html.dark .procedure-list,
html.dark .apps-list {
    color: #94a3b8;
}

/* Footer */
html[data-theme="dark"] .lab-footer,
html.dark .lab-footer {
    background-color: #111827;
    border-top-color: #1f2937;
    color: #64748b;
}
