/* ==========================================================================
   PrayogSetu - RTD (Pt100) Laboratory Simulator Design System
   ========================================================================== */

:root {
    /* Color Palette */
    --primary-dark: #0f172a;
    --primary-blue: #0284c7;
    --accent-blue: #38bdf8;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* State Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Box Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 2rem;
}

/* ================= HEADER ================= */
.lab-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-md);
    border-bottom: 4px solid var(--primary-blue);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    font-size: 2.2rem;
    color: var(--accent-blue);
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background-color: var(--primary-blue);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.brand-text p {
    font-size: 0.85rem;
    color: #94a3b8;
}

.exp-title h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--accent-blue);
}

/* ================= MAIN LAYOUT ================= */
.lab-main {
    max-width: 1600px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.experiment-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1.5rem;
}

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

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

/* ================= LAB CARDS ================= */
.lab-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    background: #f1f5f9;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header i {
    font-size: 1.1rem;
    color: var(--primary-blue);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    flex-grow: 1;
}

.status-pill {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ================= SVG CONTAINER ================= */
.setup-card {
    height: 100%;
}

.svg-container {
    width: 100%;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px fill var(--card-border);
}

.svg-container svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Dynamic SVG Keyframe Animations */
@keyframes rippleAnim {
    0% { d: path("M 234,240 Q 297,236 360,240 Q 423,244 486,240 L 486,245 L 234,245 Z"); }
    50% { d: path("M 234,240 Q 297,244 360,240 Q 423,236 486,240 L 486,245 L 234,245 Z"); }
    100% { d: path("M 234,240 Q 297,236 360,240 Q 423,244 486,240 L 486,245 L 234,245 Z"); }
}

.water-active {
    animation: rippleAnim 2s infinite ease-in-out;
}

@keyframes steamFloat {
    0% { transform: translateY(0px); opacity: 0.2; }
    50% { transform: translateY(-10px); opacity: 0.7; }
    100% { transform: translateY(-20px); opacity: 0; }
}

.steam-active {
    animation: steamFloat 2.5s infinite ease-out;
}

/* ================= CONTROLS & BUTTONS ================= */
.controls-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.btn {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

.btn-success { background-color: #10b981; color: #ffffff; }
.btn-success:hover:not(:disabled) { background-color: #059669; }

.btn-warning { background-color: #f59e0b; color: #ffffff; }
.btn-warning:hover:not(:disabled) { background-color: #d97706; }

.btn-danger { background-color: #ef4444; color: #ffffff; }
.btn-danger:hover:not(:disabled) { background-color: #dc2626; }

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
}
.btn-outline:hover {
    background-color: rgba(2, 132, 199, 0.08);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.toggle-box {
    display: flex;
    justify-content: center;
}

.toggle-box .btn {
    width: 100%;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--card-border);
}

/* Radio Tiles for Wiring */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.radio-tile-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}

.radio-tile {
    position: relative;
    cursor: pointer;
}

.radio-tile input {
    position: absolute;
    opacity: 0;
}

.tile-content {
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.6rem 0.5rem;
    text-anchor: center;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.tile-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
}

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

.radio-tile input:checked + .tile-content {
    border-color: var(--primary-blue);
    background: rgba(2, 132, 199, 0.08);
    box-shadow: 0 0 0 1px var(--primary-blue);
}

/* Power Buttons */
.power-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.btn-power {
    background: #f1f5f9;
    border: 1px solid var(--card-border);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-power.active {
    background: var(--primary-dark);
    color: #ffffff;
    border-color: var(--primary-dark);
}

/* Range Slider */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-val {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1rem;
}

input[type=range] {
    width: 100%;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

/* ================= TELEMETRY READOUTS ================= */
.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.telemetry-box {
    background: #f8fafc;
    border: 1px solid var(--card-border);
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

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

.tele-value {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
}

.text-blue { color: var(--primary-blue); }
.text-green { color: var(--success); }
.text-amber { color: var(--warning); }
.text-purple { color: var(--purple); }
.text-danger { color: var(--danger); }

.wire-info-banner {
    background: rgba(2, 132, 199, 0.08);
    border-left: 4px solid var(--primary-blue);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-main);
}

/* ================= CHART & ATOMIC THEORY ================= */
.chart-wrapper {
    position: relative;
    height: 260px;
    width: 100%;
}

.atomic-visualizer-container {
    width: 100%;
    background: #0f172a;
    border-radius: 6px;
    padding: 0.5rem;
}

.atomic-visualizer-container svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Atomic Lattice Vibrations */
@keyframes atomVibrate {
    0% { transform: translate(0px, 0px); }
    25% { transform: translate(2px, -2px); }
    50% { transform: translate(-2px, 2px); }
    75% { transform: translate(2px, 2px); }
    100% { transform: translate(0px, 0px); }
}

.vibrate-low .atom { animation: atomVibrate 0.8s infinite linear; }
.vibrate-med .atom { animation: atomVibrate 0.3s infinite linear; }
.vibrate-high .atom { animation: atomVibrate 0.1s infinite linear; }

.principle-steps {
    padding-left: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ================= TABLES ================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.lab-table th, .comparison-table th {
    background: #f1f5f9;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--card-border);
}

.lab-table td, .comparison-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--card-border);
}

.lab-table tbody tr:hover, .comparison-table tbody tr:hover {
    background: #f8fafc;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* ================= FOOTER ================= */
.lab-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: 2rem;
}

/* ================= RESPONSIVE MEDIA QUERIES ================= */

/* Tablet & Smaller Desktop Screens */
@media screen and (max-width: 1024px) {
    .experiment-grid {
        grid-template-columns: 1fr;
    }
    .bottom-grid {
        grid-template-columns: 1fr;
    }
    .lab-main {
        padding: 0 1rem;
        margin: 1rem auto;
        gap: 1rem;
    }
    .lab-header {
        padding: 1rem;
    }
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .exp-title h2 {
        font-size: 1rem;
    }
}

/* Mobile Portrait Mode */
@media screen and (max-width: 767px) and (orientation: portrait) {
    .experiment-grid {
        display: flex;
        flex-direction: column;
    }
    .setup-card {
        order: 1 !important;
    }
    .controls-column {
        order: 2 !important;
    }
    .bottom-grid {
        display: flex;
        flex-direction: column;
    }
    .observation-card {
        order: 1 !important;
    }
    
    /* Touch Target Sizing (min 44px) */
    .btn, button, select, input[type="range"] {
        min-height: 44px;
        font-size: 16px !important;
    }
    
    .control-group {
        padding: 0.75rem 0.5rem;
    }
    
    .svg-container svg {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }
}

/* Mobile Landscape Mode */
@media screen and (max-width: 950px) and (orientation: landscape) {
    .experiment-grid {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        gap: 1rem;
    }
    .bottom-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    .lab-main {
        padding: 0 0.5rem;
        margin: 0.5rem auto;
    }
}

/* ==========================================================================
   RTD DUAL THEME ENGINE (WHITE THEME & DARK THEME COMPATIBILITY)
   ========================================================================== */

/* Remove any background gridlines */
html body,
html[data-theme="light"] body,
html.light body,
html:not([data-theme="dark"]) body {
    background-image: none !important;
}

/* ================= SVG INSTRUMENTS HIGH-CONTRAST DIGITAL READOUTS ================= */
#svg-digital-temp {
    fill: #38bdf8 !important;
    font-weight: 700 !important;
}

#svg-digital-res {
    fill: #34d399 !important;
    font-weight: 700 !important;
}

.mounting-bar-text {
    fill: #ffffff !important;
    font-weight: 600 !important;
}

.heater-power-text {
    fill: #cbd5e1 !important;
}

/* ================= LIGHT MODE (WHITE THEME) ================= */
html[data-theme="light"],
html.light,
html:not([data-theme="dark"]) {
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

html[data-theme="light"] body,
html.light body,
html:not([data-theme="dark"]) body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    background-image: none !important;
}

html[data-theme="light"] .lab-header,
html.light .lab-header,
html:not([data-theme="dark"]) .lab-header {
    background: #ffffff !important;
    border-bottom: 3px solid #0284c7 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .brand-text h1,
html.light .brand-text h1,
html:not([data-theme="dark"]) .brand-text h1 {
    color: #0f172a !important;
}

html[data-theme="light"] .brand-text p,
html.light .brand-text p,
html:not([data-theme="dark"]) .brand-text p {
    color: #64748b !important;
}

html[data-theme="light"] .exp-title h2,
html.light .exp-title h2,
html:not([data-theme="dark"]) .exp-title h2 {
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border-left: 3px solid #0284c7 !important;
}

html[data-theme="light"] .lab-card,
html.light .lab-card,
html:not([data-theme="dark"]) .lab-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .card-header,
html.light .card-header,
html:not([data-theme="dark"]) .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .card-header h3,
html.light .card-header h3,
html:not([data-theme="dark"]) .card-header h3 {
    color: #0f172a !important;
}

html[data-theme="light"] .card-header i,
html.light .card-header i,
html:not([data-theme="dark"]) .card-header i {
    color: #0284c7 !important;
}

html[data-theme="light"] .status-pill,
html.light .status-pill,
html:not([data-theme="dark"]) .status-pill {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .svg-container,
html.light .svg-container,
html:not([data-theme="dark"]) .svg-container {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* SVG Digital Instruments in Light Mode */
html[data-theme="light"] .inst-chassis,
html.light .inst-chassis,
html:not([data-theme="dark"]) .inst-chassis {
    fill: #f1f5f9 !important;
    stroke: #64748b !important;
}

html[data-theme="light"] .inst-screen,
html.light .inst-screen,
html:not([data-theme="dark"]) .inst-screen {
    fill: #090d16 !important;
}

html[data-theme="light"] .inst-title,
html.light .inst-title,
html:not([data-theme="dark"]) .inst-title {
    fill: #475569 !important;
}

html[data-theme="light"] .inst-label-badge,
html.light .inst-label-badge,
html:not([data-theme="dark"]) .inst-label-badge {
    fill: #ffffff !important;
    stroke: #cbd5e1 !important;
}

html[data-theme="light"] .inst-label-text,
html.light .inst-label-text,
html:not([data-theme="dark"]) .inst-label-text {
    fill: #0f172a !important;
    font-weight: 700 !important;
}

/* Wiring Tiles in Light Mode */
html[data-theme="light"] .tile-content,
html.light .tile-content,
html:not([data-theme="dark"]) .tile-content {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .tile-label,
html.light .tile-label,
html:not([data-theme="dark"]) .tile-label {
    color: #0f172a !important;
}

html[data-theme="light"] .tile-sub,
html.light .tile-sub,
html:not([data-theme="dark"]) .tile-sub {
    color: #64748b !important;
}

html[data-theme="light"] .radio-tile input:checked + .tile-content,
html.light .radio-tile input:checked + .tile-content,
html:not([data-theme="dark"]) .radio-tile input:checked + .tile-content {
    background: #eff6ff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 1px #0284c7 !important;
}

/* Power Buttons in Light Mode */
html[data-theme="light"] .btn-power,
html.light .btn-power,
html:not([data-theme="dark"]) .btn-power {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .btn-power:hover,
html.light .btn-power:hover,
html:not([data-theme="dark"]) .btn-power:hover {
    background: #e2e8f0 !important;
}

html[data-theme="light"] .btn-power.active,
html.light .btn-power.active,
html:not([data-theme="dark"]) .btn-power.active {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}

/* Telemetry in Light Mode */
html[data-theme="light"] .telemetry-box,
html.light .telemetry-box,
html:not([data-theme="dark"]) .telemetry-box {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .tele-title,
html.light .tele-title,
html:not([data-theme="dark"]) .tele-title {
    color: #64748b !important;
}

html[data-theme="light"] .wire-info-banner,
html.light .wire-info-banner,
html:not([data-theme="dark"]) .wire-info-banner {
    background: #f0f9ff !important;
    border-left: 4px solid #0284c7 !important;
    color: #0369a1 !important;
}

html[data-theme="light"] .btn-outline,
html.light .btn-outline,
html:not([data-theme="dark"]) .btn-outline {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .btn-outline:hover,
html.light .btn-outline:hover,
html:not([data-theme="dark"]) .btn-outline:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

/* Tables in Light Mode */
html[data-theme="light"] .lab-table th,
html[data-theme="light"] .comparison-table th,
html.light .lab-table th,
html.light .comparison-table th,
html:not([data-theme="dark"]) .lab-table th,
html:not([data-theme="dark"]) .comparison-table th {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

html[data-theme="light"] .lab-table td,
html[data-theme="light"] .comparison-table td,
html.light .lab-table td,
html.light .comparison-table td,
html:not([data-theme="dark"]) .lab-table td,
html:not([data-theme="dark"]) .comparison-table td {
    color: #334155 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* ================= DARK MODE ================= */
html[data-theme="dark"],
html.dark {
    --bg-light: #0b0f19;
    --card-bg: #0f172a;
    --card-border: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

html[data-theme="dark"] .lab-header,
html.dark .lab-header {
    background: #0f172a !important;
    border-bottom: 3px solid #0284c7 !important;
}

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

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

html[data-theme="dark"] .exp-title h2,
html.dark .exp-title h2 {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-left: 3px solid #38bdf8 !important;
}

html[data-theme="dark"] .lab-card,
html.dark .lab-card {
    background: #0f172a !important;
    border-color: #1e293b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .card-header,
html.dark .card-header {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
}

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

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

html[data-theme="dark"] .status-pill,
html.dark .status-pill {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .svg-container,
html.dark .svg-container {
    background: #0b0f19 !important;
    border-color: #1e293b !important;
}

/* SVG Digital Instruments in Dark Mode */
html[data-theme="dark"] .inst-chassis,
html.dark .inst-chassis {
    fill: #1e293b !important;
    stroke: #334155 !important;
}

html[data-theme="dark"] .inst-screen,
html.dark .inst-screen {
    fill: #0f172a !important;
}

html[data-theme="dark"] .inst-title,
html.dark .inst-title {
    fill: #94a3b8 !important;
}

html[data-theme="dark"] .inst-label-badge,
html.dark .inst-label-badge {
    fill: #1e293b !important;
    stroke: #475569 !important;
}

html[data-theme="dark"] .inst-label-text,
html.dark .inst-label-text {
    fill: #f1f5f9 !important;
    font-weight: 700 !important;
}

/* Wiring Tiles in Dark Mode */
html[data-theme="dark"] .tile-content,
html.dark .tile-content {
    background: #1e293b !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .tile-label,
html.dark .tile-label {
    color: #f8fafc !important;
}

html[data-theme="dark"] .tile-sub,
html.dark .tile-sub {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .radio-tile input:checked + .tile-content,
html.dark .radio-tile input:checked + .tile-content {
    background: rgba(2, 132, 199, 0.25) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 1px #38bdf8 !important;
}

/* Power Buttons in Dark Mode */
html[data-theme="dark"] .btn-power,
html.dark .btn-power {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

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

html[data-theme="dark"] .btn-power.active,
html.dark .btn-power.active {
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}

/* Telemetry in Dark Mode */
html[data-theme="dark"] .telemetry-box,
html.dark .telemetry-box {
    background: #1e293b !important;
    border-color: #334155 !important;
}

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

html[data-theme="dark"] .wire-info-banner,
html.dark .wire-info-banner {
    background: rgba(2, 132, 199, 0.15) !important;
    border-left: 4px solid #38bdf8 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-outline,
html.dark .btn-outline {
    background: rgba(2, 132, 199, 0.12) !important;
    border-color: #0284c7 !important;
    color: #38bdf8 !important;
}

html[data-theme="dark"] .btn-outline:hover,
html.dark .btn-outline:hover {
    background: rgba(2, 132, 199, 0.22) !important;
}

html[data-theme="dark"] .slider-val,
html.dark .slider-val {
    color: #38bdf8 !important;
}

/* Tables in Dark Mode */
html[data-theme="dark"] .lab-table th,
html[data-theme="dark"] .comparison-table th,
html.dark .lab-table th,
html.dark .comparison-table th {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-bottom: 2px solid #334155 !important;
}

html[data-theme="dark"] .lab-table td,
html[data-theme="dark"] .comparison-table td,
html.dark .lab-table td,
html.dark .comparison-table td {
    color: #cbd5e1 !important;
    border-bottom: 1px solid #1e293b !important;
}

html[data-theme="dark"] .lab-table tbody tr:hover,
html[data-theme="dark"] .comparison-table tbody tr:hover,
html.dark .lab-table tbody tr:hover,
html.dark .comparison-table tbody tr:hover {
    background: #131d2e !important;
}

html[data-theme="dark"] .atomic-visualizer-container,
html.dark .atomic-visualizer-container {
    background: #090d16 !important;
    border: 1px solid #1e293b !important;
}

html[data-theme="dark"] .principle-steps,
html.dark .principle-steps {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .divider,
html.dark .divider {
    background: #334155 !important;
}

html[data-theme="dark"] .lab-footer,
html.dark .lab-footer {
    border-color: #1e293b !important;
    color: #64748b !important;
}
