/* ==========================================================================
   EasyToolio Ohm's Law Calculator - HD Circuit Simulation & High-Precision UI
   ========================================================================== */

/* Design Tokens */
:root {
    --ol-primary: #1a73e8;       /* Google Blue */
    --ol-primary-hover: #1557b0;
    --ol-wire: #e2e8f0;
    --ol-card-bg: #ffffff;
    --ol-card-border: #e4e4e7;
}

.dark {
    --ol-primary: #38bdf8;
    --ol-primary-hover: #0284c7;
    --ol-wire: #334155;
    --ol-card-bg: rgba(24, 24, 27, 0.75);
    --ol-card-border: rgba(255, 255, 255, 0.08);
}

/* Glassmorphism & Apple-style Cards */
.apple-glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .apple-glass {
    background: rgba(18, 18, 20, 0.85);
}

.apple-card {
    background: #ffffff;
    border: 1px solid #e4e4e7;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dark .apple-card {
    background: rgba(24, 24, 27, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.apple-card:hover {
    border-color: rgba(26, 115, 232, 0.35);
    box-shadow: 0 10px 30px -10px rgba(26, 115, 232, 0.12);
}

/* Top Toolbar Main Tab Buttons */
.ol-tab-btn {
    flex: 1;
    padding: 0.55rem 0.95rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.65rem;
    border: 1px solid transparent;
    color: #4b5563 !important;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

.dark .ol-tab-btn {
    color: #9ca3af !important;
}

.ol-tab-btn:hover {
    color: #111827 !important;
    background: rgba(0, 0, 0, 0.04);
}

.dark .ol-tab-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06);
}

.ol-tab-btn.active {
    background: #1a73e8 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-color: #1a73e8 !important;
    box-shadow: 0 2px 8px -1px rgba(26, 115, 232, 0.35) !important;
}

.dark .ol-tab-btn.active {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

/* Target to Solve Buttons (Solve for V, Solve for I, Solve for R - Google Segmented Control) */
.ol-solve-btn {
    flex: 1;
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    color: #4b5563 !important;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
}

.dark .ol-solve-btn {
    color: #9ca3af !important;
}

.ol-solve-btn:hover {
    color: #111827 !important;
    background: rgba(0, 0, 0, 0.04);
}

.dark .ol-solve-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.06);
}

.ol-solve-btn.active {
    background: #1a73e8 !important;
    border-color: #1a73e8 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px -1px rgba(26, 115, 232, 0.45) !important;
}

.dark .ol-solve-btn.active {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px -1px rgba(2, 132, 199, 0.45) !important;
}

/* Interactive Circuit Simulation Container (Clean HD) */
.circuit-stage {
    position: relative;
    width: 100%;
    background: #ffffff;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.dark .circuit-stage {
    background: #090d16;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Crisp HD Animated Circuit Charges (Small, Solid Dots like Google) */
.circuit-dot {
    fill: #1a73e8;
    stroke: #ffffff;
    stroke-width: 0.5px;
    transition: fill 0.2s ease;
}

.dark .circuit-dot {
    fill: #38bdf8;
    stroke: #090d16;
}

/* Resistor Zigzag Dynamic Path */
#circuit-resistor-zigzag {
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

/* Ohm's Law Triangle Sectors */
.ol-tri-sector {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ol-tri-sector polygon {
    fill: rgba(248, 250, 252, 0.6);
    stroke: #e2e8f0;
    stroke-width: 1.5;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.dark .ol-tri-sector polygon {
    fill: rgba(24, 24, 27, 0.6);
    stroke: rgba(255, 255, 255, 0.08);
}

.ol-tri-sector rect {
    fill: #ffffff;
    stroke: #e2e8f0;
    stroke-width: 1.2;
    transition: stroke 0.2s ease, fill 0.2s ease;
}

.dark .ol-tri-sector rect {
    fill: #18181b;
    stroke: rgba(255, 255, 255, 0.1);
}

.ol-tri-sector:hover polygon {
    fill: rgba(238, 242, 255, 0.8);
}

/* Solved Sector Highlight (Google Blue) */
.ol-tri-sector.active-target polygon {
    fill: rgba(232, 240, 254, 0.9) !important;
    stroke: #1a73e8 !important;
    stroke-width: 2 !important;
}

.dark .ol-tri-sector.active-target polygon {
    fill: rgba(26, 115, 232, 0.18) !important;
    stroke: #38bdf8 !important;
}

.ol-tri-sector.active-target rect {
    fill: #ffffff !important;
    stroke: #1a73e8 !important;
    stroke-width: 2 !important;
}

.dark .ol-tri-sector.active-target rect {
    fill: #0f172a !important;
    stroke: #38bdf8 !important;
}

.ol-tri-sector.active-target text {
    fill: #1a73e8 !important;
    font-weight: 800 !important;
}

.dark .ol-tri-sector.active-target text {
    fill: #38bdf8 !important;
}

.ol-tri-sector:not(.active-target) polygon {
    fill: rgba(248, 250, 252, 0.4);
    stroke: #e2e8f0;
    stroke-width: 1.5;
}

.ol-tri-sector:not(.active-target) rect {
    fill: #ffffff;
    stroke: #e2e8f0;
    stroke-width: 1.2;
}

.ol-tri-sector:not(.active-target) text:first-of-type {
    fill: #374151 !important;
}

.ol-tri-sector:not(.active-target) text:last-of-type {
    fill: #4b5563 !important;
}

.dark .ol-tri-sector:not(.active-target) polygon {
    fill: rgba(24, 24, 27, 0.4);
    stroke: rgba(255, 255, 255, 0.08);
}

.dark .ol-tri-sector:not(.active-target) rect {
    fill: #18181b;
    stroke: rgba(255, 255, 255, 0.1);
}

.dark .ol-tri-sector:not(.active-target) text {
    fill: #9ca3af !important;
}

/* Range Sliders */
.ol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
    margin: 0.35rem 0 0.15rem 0;
    transition: background 0.2s ease;
}

.dark .ol-slider {
    background: rgba(255, 255, 255, 0.12);
}

.ol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a73e8;
    border: 2.5px solid #ffffff;
    box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.25);
    cursor: grab;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .ol-slider::-webkit-slider-thumb {
    background: #38bdf8;
    border-color: #18181b;
}

.ol-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #1557b0;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.25);
}

.dark .ol-slider::-webkit-slider-thumb:hover {
    background: #0284c7;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25);
}

.ol-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.ol-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a73e8;
    border: 2.5px solid #ffffff;
    box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.25);
    cursor: grab;
}

/* Unified Stepper Control (Clean, Sleek Pill - No Text Clipping) */
.ol-stepper-wrap {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e4e4e7;
    border-radius: 0.75rem;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dark .ol-stepper-wrap {
    background: #090d16;
    border-color: rgba(255, 255, 255, 0.1);
}

.ol-stepper-btn {
    width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #64748b;
    border: none;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.ol-stepper-btn:hover {
    background: #1a73e8;
    color: #ffffff;
}

.dark .ol-stepper-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

.dark .ol-stepper-btn:hover {
    background: #38bdf8;
    color: #0b0b12;
}

.ol-stepper-input {
    width: 3.5rem;
    padding: 0.25rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #0f172a;
    background: transparent;
    border: none;
    border-left: 1px solid #e4e4e7;
    border-right: 1px solid #e4e4e7;
    text-align: center;
    outline: none;
}

.dark .ol-stepper-input {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.08);
}

.ol-stepper-select {
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #475569;
    background: #f8fafc;
    border: none;
    border-right: 1px solid #e4e4e7;
    outline: none;
    cursor: pointer;
}

.dark .ol-stepper-select {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Thermal Dissipation Gauge */
.gauge-bar-segment {
    transition: all 0.3s ease;
}

.gauge-bar-segment.active-segment {
    filter: brightness(1.2) drop-shadow(0 0 6px currentColor);
    transform: scaleY(1.15);
}

.indicator-arrow {
    transition: left 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap !important;
    width: max-content !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    pointer-events: none;
    z-index: 10;
}

#gauge-pointer {
    white-space: nowrap !important;
    width: max-content !important;
}

#gauge-value {
    color: #ffffff !important;
    font-weight: 800 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 10px !important;
    padding: 2.5px 7px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    display: inline-block !important;
    line-height: 1.25 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

/* Resistor Networks Arrangement Switch */
.ol-net-mode-btn {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.55rem;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    text-align: center;
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
}

.dark .ol-net-mode-btn {
    color: #9ca3af;
}

.ol-net-mode-btn:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}

.dark .ol-net-mode-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.ol-net-mode-btn.active {
    background: #1a73e8 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.35);
}

.dark .ol-net-mode-btn.active {
    background: #0284c7 !important;
    color: #ffffff !important;
}

/* Presets & Chips */
.preset-chip {
    transition: all 0.2s ease;
}

.preset-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(26, 115, 232, 0.15);
}

/* Circular Ohm's Law Wheel (Restored Classic Design) */
.ol-wheel {
    width: 100%;
    max-width: 18.5rem;
    height: auto;
    margin: 0 auto;
    display: block;
}

.ol-wheel .ol-q path {
    fill: #f8fafc;
    stroke: #cbd5e1;
    stroke-width: 1.5;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.dark .ol-wheel .ol-q path {
    fill: rgba(255, 255, 255, 0.04);
    stroke: rgba(255, 255, 255, 0.1);
}

.ol-wheel .ol-q.ol-on path.ol-in {
    fill: rgba(26, 115, 232, 0.18);
    stroke: #1a73e8;
}

.dark .ol-wheel .ol-q.ol-on path.ol-in {
    fill: rgba(56, 189, 248, 0.25);
    stroke: #38bdf8;
}

.ol-wheel text {
    fill: #1e293b;
    font-size: 10.5px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: middle;
    font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.dark .ol-wheel text {
    fill: #f1f5f9;
}

.ol-wheel .ol-big {
    font-size: 22px;
    font-weight: 900;
    fill: #1a73e8;
}

.dark .ol-wheel .ol-big {
    fill: #38bdf8;
}

.ol-wheel .ol-un {
    font-size: 9px;
    fill: #64748b;
}

.dark .ol-wheel .ol-un {
    fill: #94a3b8;
}

@media (max-width: 640px) {
    .circuit-stage {
        border-radius: 1rem;
    }
}
