/* 
============================================================
   ⚡ VOLTAGE DROP CALCULATOR — MASTER DESIGN SYSTEM
   Standardized premium glassmorphic UI framework.
============================================================ 
*/

:root {
    /* Core Palette */
    --bg: #030712;
    --accent: #ea580c;
    --accent-light: #fb923c;
    --accent-glow: rgba(234, 88, 12, 0.4);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Surface / Glass */
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-radius: 24px;
    
    /* Typography */
    --text-main: #f9fafb;
    --text-muted: #d1d5db; /* Brightened for WCAG Accessibility */
    --text-dim: #9ca3af;
}

/* ─── Base Reset ────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background-color: var(--bg); 
    color: var(--text-main); 
    overflow-x: hidden; 
    line-height: 1.6; 
}

/* ─── Background & Ambient ───────────────────────────────── */
.ambient-glow {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(234, 88, 12, 0.10), transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.06), transparent 40%);
    filter: blur(80px); transform: translateZ(0); will-change: transform; pointer-events: none;
}

/* ─── Header & Navigation ────────────────────────────────── */
header {
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 24px;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 1000;
    background: rgba(3, 7, 18, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.8px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo span { color: var(--accent-light); text-shadow: 0 0 15px var(--accent-glow); }

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); text-decoration: none; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }

/* Language Toggle */
.lang-toggle { display: flex; background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 99px; padding: 3px; }
.lang-opt { padding: 6px 14px; font-size: 0.75rem; font-weight: 700; cursor: pointer; border-radius: 99px; transition: 0.2s; color: var(--text-dim); text-decoration: none; }
.lang-opt.active { background: var(--accent); color: white; box-shadow: 0 0 12px var(--accent-glow); }

/* ─── Hero Section ───────────────────────────────────────── */
.hero { padding: 80px 24px 40px; text-align: center; max-width: 900px; margin: 0 auto; }
.hero h1 { 
    font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -1.5px; margin-bottom: 20px; 
    background: linear-gradient(180deg, #fff 0%, #a1a1aa 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* ─── Calculator Components ──────────────────────────────── */
.tool-wrapper { max-width: 1000px; margin: 0 auto; padding: 0 24px 80px; }

.glass-card { 
    background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: var(--card-radius); 
    padding: 40px; box-shadow: 0 30px 60px -12px rgba(0,0,0,0.6); 
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; 
}

.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 0.7rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; }

.modern-field { 
    width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border); 
    border-radius: 12px; padding: 14px; color: white; font-size: 1rem; outline: none; transition: 0.2s; font-family: inherit; 
}
.modern-field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Pills */
.pill-select { display: flex; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 12px; padding: 4px; gap: 4px; }
.pill { flex: 1; padding: 8px; text-align: center; font-size: 0.75rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; color: var(--text-dim); }
.pill.active { background: var(--accent); color: white; box-shadow: 0 0 12px var(--accent-glow); }

/* Results Readout */
.readout { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: 20px; padding: 30px; display: flex; flex-direction: column; justify-content: space-between; }
.readout-item { margin-bottom: 20px; }
.readout-label { font-size: 0.65rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.readout-val { font-family: 'JetBrains Mono', monospace; font-size: 2.2rem; font-weight: 700; color: var(--success); display: block; }
.readout-val.blue { color: var(--accent-light); text-shadow: 0 0 15px var(--accent-glow); }
.readout-val.warning { color: var(--warning); }
.readout-val.danger { color: var(--danger); }

.status-box { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 700; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 12px; border: 1px solid var(--glass-border); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ─── Content Area Utilities ────────────────────────────── */
.content-area { max-width: 900px; margin: 0 auto 100px; padding: 0 24px; }

.content-block { background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); border-radius: 20px; padding: 40px; margin-bottom: 24px; }
.content-block h2 { font-size: 1.6rem; margin-bottom: 20px; font-weight: 800; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.content-block h2 i { font-style: normal; font-size: 1.4rem; }
.content-block h3 { font-size: 1rem; font-weight: 700; color: var(--accent-light); margin-bottom: 8px; }
.content-block p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; }
.content-block ul, .content-block ol { padding-left: 20px; color: var(--text-muted); font-size: 0.95rem; }
.content-block li { margin-bottom: 10px; }

.formula-box { background: rgba(0,0,0,0.3); border: 1px solid var(--accent); border-radius: 12px; padding: 20px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 1.2rem; margin: 20px 0; color: var(--accent-light); }

/* Grids & Cards */
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }

.scenario-card { background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border); border-left: 4px solid var(--accent); border-radius: 16px; padding: 24px; transition: 0.3s ease; }
.scenario-card:hover { border-left-color: var(--accent-light); background: rgba(255, 255, 255, 0.04); transform: translateY(-3px); }
.scenario-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-main); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.scenario-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 0; }

.glossary-card { background: rgba(0, 0, 0, 0.15); border: 1px solid var(--glass-border); border-radius: 14px; padding: 22px; transition: 0.25s ease; }
.glossary-card:hover { background: rgba(255, 255, 255, 0.03); }
.glossary-card h3 { font-size: 0.95rem; font-weight: 700; color: var(--accent-light); margin-bottom: 8px; letter-spacing: -0.3px; }
.glossary-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 0; }

.step-card { background: rgba(0, 0, 0, 0.2); border: 1px solid var(--glass-border); border-radius: 16px; padding: 24px; transition: 0.3s ease; position: relative; }
.step-card:hover { background: rgba(255, 255, 255, 0.04); transform: translateY(-3px); }
.step-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--accent-light); margin-bottom: 10px; }
.step-card p, .step-card ul { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 0; }
.step-num { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 1.8rem; font-weight: 800; color: var(--accent); opacity: 0.3; margin-bottom: 8px; }

/* ─── Dropdown & Nav Sliders ─────────────────────────────── */
#nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); z-index: 900; backdrop-filter: blur(2px); animation: fadeIn 0.25s ease; }
#nav-backdrop.active { display: block; }

.dropdown-content {
    position: absolute; top: 100%; right: 0; min-width: 260px;
    background: rgba(3, 7, 18, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 16px; padding: 10px;
    opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001; box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.dropdown:hover .dropdown-content { opacity: 1; visibility: visible; transform: translateY(5px); }

.dropdown-item { display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--text-dim); text-decoration: none; font-size: 0.85rem; font-weight: 600; border-radius: 10px; transition: 0.2s; }
.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.dropdown-item i { font-style: normal; font-size: 1.1rem; }

.nav-pro-link { background: var(--accent) !important; color: white !important; padding: 8px 20px !important; border-radius: 99px !important; font-size: 0.8rem !important; font-weight: 800 !important; box-shadow: 0 10px 15px -3px rgba(234, 88, 12, 0.3) !important; text-decoration: none !important; transition: 0.3s; }
.nav-pro-link:hover { transform: translateY(-2px); box-shadow: 0 15px 25px -5px rgba(234, 88, 12, 0.4) !important; }

/* ─── Footer ─────────────────────────────────────────────── */
footer { background: #020617; border-top: 1px solid var(--glass-border); padding: 80px 24px 40px; }
.footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; }
.footer-col h3, .footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; color: var(--accent-light); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; transition: 0.2s; }
.footer-col a:hover { color: white; }

/* ─── Responsive Adjustments ─────────────────────────────── */
@media (max-width: 1023px) {
    .glass-card { grid-template-columns: 1fr; padding: 24px; }
    .nav-toggle { display: flex !important; flex-direction: column; gap: 6px; background: none; border: none; cursor: pointer; padding: 4px; z-index: 2001; }
    .nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text-main); transition: 0.3s; }

    .nav-links {
        position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
        background: rgba(3, 7, 18, 0.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        flex-direction: column; justify-content: center; padding: 40px;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); border-left: 1px solid var(--glass-border);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5); z-index: 2000; display: flex;
    }
    /* display:flex !important overrides Tailwind's hidden class on mobile nav open */
    .nav-links.active { right: 0; display: flex !important; }
    .nav-links a { font-size: 1.1rem; width: 100%; padding: 12px 0; border-bottom: 1px solid var(--glass-border); color: var(--text-main); }
    /* Lang toggle: compact pill, not full-width */
    .nav-links .lang-toggle { width: auto; align-self: flex-start; margin-top: 20px; flex-shrink: 0; }
    .nav-links .lang-toggle a { width: auto; padding: 8px 18px; border-bottom: none; font-size: 0.75rem; font-weight: 700; }

    .dropdown-content { position: static; opacity: 1; visibility: visible; transform: none; background: transparent; border: none; padding: 0 0 0 20px; box-shadow: none; display: none; }
    .dropdown.active .dropdown-content { display: block; }
}

/* Ensure desktop nav always visible for pure-CSS pages (no Tailwind) */
@media (min-width: 1024px) {
    .nav-toggle { display: none !important; }
    .nav-links { display: flex !important; position: static; width: auto; height: auto; background: none; backdrop-filter: none; flex-direction: row; padding: 0; border: none; box-shadow: none; right: auto; }
}

@media (max-width: 640px) {
    .hero h1 { font-size: 2.2rem; }
    .input-row { grid-template-columns: 1fr; }
    .readout { padding: 20px; }
    .readout-val { font-size: 1.8rem; }
}

/* ─── Shared SEO Guide Section ──────────────────────────── */
.seo-guide-section { padding: 60px 0; border-top: 1px solid var(--glass-border); margin-top: 40px; }
.repair-timeline { margin: 60px 0; display: flex; justify-content: space-between; position: relative; gap: 20px; }
.repair-timeline::before { content: ''; position: absolute; top: 25px; left: 40px; right: 40px; height: 2px; background: var(--glass-border); z-index: 0; }
.timeline-step { flex: 1; text-align: center; position: relative; z-index: 1; }
.step-dot { width: 50px; height: 50px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; margin: 0 auto 20px; box-shadow: 0 0 15px var(--accent-glow); border: 4px solid var(--bg); }
.timeline-step h5 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.timeline-step p { font-size: 0.8rem; color: var(--text-muted); }

/* Tables responsive hack */
.table-responsive { overflow-x: auto; margin: 20px 0; border-radius: 12px; border: 1px solid var(--glass-border); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--glass-border); text-align: left; }
th { background: rgba(234, 88, 12, 0.1); color: var(--accent-light); font-weight: 700; }

/* ─── 3D Diagram Components ─────────────────────────────── */
.diagram-container {
    width: 100%; height: 200px; background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
    border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 24px 0;
    overflow: hidden; position: relative;
}
.wire-3d {
    width: 70%; height: 16px; background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--warning));
    border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); position: relative;
    transform: perspective(500px) rotateX(30deg) rotateZ(-2deg);
}
.wire-3d::after {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent); border-radius: 8px;
}
.temp-glow-3d {
    width: 100px; height: 100px; border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.3) 0%, transparent 70%);
    filter: blur(5px); animation: pulse-heat 3s infinite;
}
@keyframes pulse-heat { 0%, 100% { transform: scale(1); opacity: 0.4; } 50% { transform: scale(1.2); opacity: 0.7; } }

.gauge-visual { display: flex; align-items: flex-end; gap: 12px; }
.gauge-cylinder {
    width: 20px; background: linear-gradient(to top, #1e293b, var(--accent));
    border-radius: 10px 10px 4px 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: 0.3s;
}

/* ─── Info Badges ─────────────────────────────────────────── */
.info-badge { display: inline-block; font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; padding: 4px 12px; border-radius: 99px; margin-bottom: 12px; }
.info-badge.blue { background: rgba(37, 99, 235, 0.15); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.3); }
.info-badge.green { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.info-badge.orange { background: rgba(234, 88, 12, 0.15); color: var(--accent-light); border: 1px solid rgba(234, 88, 12, 0.3); }

/* ─── FAQ Accordion ──────────────────────────────────────── */
.faq-item { border-bottom: 1px solid var(--glass-border); padding: 20px 0; cursor: pointer; }
.faq-q { font-weight: 700; display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }
.faq-a { display: none; padding-top: 15px; color: var(--text-muted); font-size: 0.9rem; }
.faq-item.active .faq-a { display: block; }

/* ─── Tools Grid / Tool Cards ─────────────────────────────── */
.section-header { text-align: center; margin-bottom: 40px; padding: 0 24px; }
.section-header h2 { font-size: 2rem; font-weight: 800; }
.tools-grid { max-width: 1100px; margin: 0 auto 100px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 0 24px; }
.tool-card { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px; padding: 24px; text-decoration: none; color: inherit; transition: 0.3s; }
.tool-card:hover { border-color: var(--accent); transform: translateY(-5px); background: rgba(255,255,255,0.06); }
.tool-icon { font-size: 1.8rem; margin-bottom: 12px; display: block; }
.tool-name { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.tool-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Social Sharing Bar ────────────────────────────────── */
.social-share-bar {
    position: fixed; left: 0; top: 50%; transform: translateY(-50%) translateX(-100%);
    z-index: 999; display: none; flex-direction: column; gap: 8px; padding: 10px;
    background: rgba(3, 7, 18, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border); border-left: none; border-radius: 0 20px 20px 0;
    opacity: 0; transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.social-share-bar.visible { opacity: 1; transform: translateY(-50%) translateX(0); }
.social-share-bar.md-flex { display: flex; }

.share-btn {
    width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; text-decoration: none; font-size: 1.3rem;
    transition: 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    color: white;
}
.share-btn i {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
}
.share-btn:hover { transform: scale(1.15) rotate(5deg); box-shadow: 0 6px 16px rgba(0,0,0,0.4); }

.share-btn.whatsapp { background: #25d366; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.reddit { background: #ff4500; }
.share-btn.quora { background: #b92b27; }
.share-btn.pinterest { background: #bd081c; }

@media (max-width: 768px) {
    .social-share-bar.md-flex { display: none; }
}

/* ─── Ohm's Law Command Center ──────────────────────────── */
.command-center {
    background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: var(--card-radius);
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.6);
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
.input-card {
    background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border);
    border-radius: 16px; transition: 0.2s;
}
.input-card.active { border-color: var(--accent); background: rgba(234,88,12,0.06); }
.input-card label {
    display: block; font-size: 0.65rem; font-weight: 800; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px;
}
.input-card input {
    width: 100%; background: transparent; border: none; color: white;
    font-size: 1.3rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; outline: none;
}
.res-card {
    background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    border-radius: 16px; display: flex; flex-direction: column; justify-content: center; transition: 0.3s;
}
.res-card.active { border-color: var(--success); box-shadow: 0 0 20px rgba(16,185,129,0.1); }
.res-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); display: block; margin-bottom: 8px; }
.res-val { font-family: 'JetBrains Mono', monospace; font-size: 1.5rem; font-weight: 700; color: var(--success); transition: 0.3s; }
.res-val.active { color: var(--accent-light); text-shadow: 0 0 15px var(--accent-glow); }
.res-unit { font-size: 0.85rem; color: var(--text-dim); margin-left: 2px; }
.status-pill {
    display: flex; align-items: center; gap: 8px; font-weight: 700;
    background: rgba(255,255,255,0.05); padding: 10px 16px; border-radius: 99px;
    border: 1px solid var(--glass-border);
}
.btn-reset {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: var(--text-muted); border-radius: 12px; padding: 12px 24px;
    cursor: pointer; font-weight: 700; font-size: 0.85rem; transition: 0.2s; font-family: inherit;
}
.btn-reset:hover { background: rgba(255,255,255,0.08); color: white; }

/* ─── Result Grid (Spanish calculator layout) ────────────── */
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.res-item {
    background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 20px; text-align: center; transition: 0.3s;
}

/* ─── Visual Container / 3D Diagrams ────────────────────── */
.visual-container { max-width: 1100px; margin: 0 auto 20px; display: flex; gap: 20px; padding: 0 24px; }
.diagram-3d {
    flex: 1; background: var(--glass); border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 30px; display: flex; flex-direction: column;
    align-items: center; text-align: center; overflow: hidden;
}
.triangle-3d {
    width: 100px; height: 100px; position: relative;
    transform-style: preserve-3d; animation: rotate3d 8s infinite linear; margin: 10px auto;
}
.tri-face {
    position: absolute; width: 60px; height: 60px;
    background: rgba(234,88,12,0.1); border: 2px solid var(--accent);
    border-radius: 8px; display: flex; align-items: center; justify-content: center; top: 20px; left: 20px;
}
.tri-text { font-size: 1.8rem; font-weight: 900; color: var(--accent-light); }
@keyframes rotate3d { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

/* ─── Bento Grid ─────────────────────────────────────────── */
.bento-grid {
    max-width: 1100px; margin: 0 auto 60px;
    display: grid; grid-template-columns: repeat(12, 1fr);
    gap: 20px; padding: 0 24px;
}
.bento-item { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px; padding: 28px; }
.bento-item h3 { font-size: 1rem; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.bento-item h3 i { font-style: normal; }
.bento-item h5 { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; }
.bento-item p, .bento-item li { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.bento-item ul { list-style: none; padding: 0; }
.bento-large { grid-column: span 7; }
.bento-med { grid-column: span 5; }
.bento-wide { grid-column: span 12; }

/* ─── Tech Table ─────────────────────────────────────────── */
.tech-table-wrapper { overflow-x: auto; margin-top: 16px; border-radius: 12px; border: 1px solid var(--glass-border); }
.tech-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tech-table th { background: rgba(234,88,12,0.1); color: var(--accent-light); font-weight: 700; padding: 12px 16px; text-align: left; }
.tech-table td { padding: 12px 16px; border-bottom: 1px solid var(--glass-border); color: var(--text-muted); }
.tech-table tr:last-child td { border-bottom: none; }

/* ─── FAQ Section ────────────────────────────────────────── */
.faq-section { max-width: 900px; margin: 0 auto 80px; padding: 0 24px; }

/* ─── History Timeline (Ohm's Law page) ─────────────────── */
.timeline { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.time-item { display: flex; gap: 12px; align-items: flex-start; }
.time-item > span { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; font-weight: 700; color: var(--accent); min-width: 36px; padding-top: 2px; }
.time-item h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; }
.time-item p { font-size: 0.78rem; color: var(--text-muted); margin: 0; }

/* Responsive for new Ohm's Law components */
@media (max-width: 900px) {
    .command-center { grid-template-columns: 1fr; }
    .bento-large, .bento-med { grid-column: span 12; }
    .visual-container { flex-direction: column; }
    .res-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Light Theme ────────────────────────────────────────── */
[data-theme="light"] {
    --bg: #f8fafc;
    --accent: #ea580c;
    --accent-light: #c2410c;
    --accent-glow: rgba(234, 88, 12, 0.15);
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(15, 23, 42, 0.12);
    --text-main: #0f172a;
    --text-muted: #1e293b;
    --text-dim: #334155;
}

[data-theme="light"] body {
    background-color: var(--bg);
    color: var(--text-main);
}

[data-theme="light"] .ambient-glow {
    background: radial-gradient(circle at 10% 20%, rgba(234, 88, 12, 0.06), transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.04), transparent 40%);
}

[data-theme="light"] header {
    background: rgba(248, 250, 252, 0.85) !important;
    backdrop-filter: blur(12px);
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .content-block {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .readout {
    background: rgba(248, 250, 252, 0.8) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] footer {
    background: #f1f5f9 !important;
}

[data-theme="light"] .pill-select {
    background: rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] input,
[data-theme="light"] select {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: var(--text-main) !important;
}

[data-theme="light"] .dropdown-content {
    background: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] .table-responsive {
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] th {
    background: rgba(234, 88, 12, 0.06);
}

[data-theme="light"] td {
    border-color: rgba(15, 23, 42, 0.06);
}

/* Specific Tailwind Overrides for Light Mode Contrast */
[data-theme="light"] .text-slate-400 {
    color: var(--text-muted) !important;
}
[data-theme="light"] .text-slate-500 {
    color: var(--text-dim) !important;
}
[data-theme="light"] .text-slate-300,
[data-theme="light"] .text-slate-200,
[data-theme="light"] .text-slate-100,
[data-theme="light"] .text-slate-5,
[data-theme="light"] .text-slate-50,
[data-theme="light"] .text-white {
    color: var(--text-main) !important;
}
[data-theme="light"] .text-orange-400 {
    color: var(--accent-light) !important;
}
[data-theme="light"] .text-orange-500 {
    color: var(--accent) !important;
}
[data-theme="light"] .text-amber-500 {
    color: var(--warning) !important;
}
[data-theme="light"] .text-emerald-500 {
    color: var(--success) !important;
}
/* Light Mode Dynamic Background Swaps */
[data-theme="light"] .bg-\[\#030712\],
[data-theme="light"] .bg-\[\#080d1a\],
[data-theme="light"] .bg-\[\#0f172a\] {
    background-color: var(--bg) !important;
}

[data-theme="light"] .bg-\[\#030712\]\/80,
[data-theme="light"] .bg-\[\#0f172a\]\/80 {
    background-color: rgba(248, 250, 252, 0.85) !important;
}

[data-theme="light"] .bg-\[\#030712\]\/95,
[data-theme="light"] .bg-\[\#0f172a\]\/95,
[data-theme="light"] .bg-\[\#0f172a\]\/98 {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] .bg-\[\#020617\] {
    background-color: #f1f5f9 !important;
}

[data-theme="light"] .bg-slate-900,
[data-theme="light"] .bg-slate-900\/90,
[data-theme="light"] .bg-slate-900\/80,
[data-theme="light"] .bg-slate-800 {
    background-color: rgba(255, 255, 255, 0.75) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .bg-slate-800\/40 {
    background-color: rgba(248, 250, 252, 0.8) !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] body {
    background-color: var(--bg) !important;
    color: var(--text-main) !important;
}

/* Force active/colored elements to keep high-contrast white text */
[data-theme="light"] button.text-white,
[data-theme="light"] a.text-white,
[data-theme="light"] .bg-orange-600,
[data-theme="light"] .bg-orange-600 *,
[data-theme="light"] .active-pill,
[data-theme="light"] .pill.active,
[data-theme="light"] .pill-btn.active-pill {
    color: #ffffff !important;
}

[data-theme="light"] .bg-black\/20 {
    background-color: rgba(15, 23, 42, 0.04) !important;
}
[data-theme="light"] .bg-black\/30 {
    background-color: rgba(15, 23, 42, 0.05) !important;
}
[data-theme="light"] .bg-black\/40 {
    background-color: rgba(15, 23, 42, 0.06) !important;
}
[data-theme="light"] .bg-white\/5 {
    background-color: rgba(15, 23, 42, 0.03) !important;
}
[data-theme="light"] .bg-white\/\[0\.02\] {
    background-color: rgba(255, 255, 255, 0.6) !important;
}
[data-theme="light"] .border-white\/5 {
    border-color: rgba(15, 23, 42, 0.08) !important;
}
[data-theme="light"] .border-white\/10 {
    border-color: rgba(15, 23, 42, 0.1) !important;
}
[data-theme="light"] .history-table tr:hover td {
    background-color: rgba(15, 23, 42, 0.02) !important;
}
[data-theme="light"] .history-table td {
    border-bottom-color: rgba(15, 23, 42, 0.04) !important;
}

/* Light Theme Navigation & Hero Overrides */
[data-theme="light"] .hero h1 {
    background: linear-gradient(180deg, #0f172a 0%, #334155 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .drop-trigger:hover,
[data-theme="light"] .dropdown:hover .drop-trigger {
    color: var(--accent) !important;
}
[data-theme="light"] .hover\:text-slate-300:hover {
    color: var(--text-main) !important;
}
[data-theme="light"] .hover\:text-white:hover {
    color: var(--text-main) !important;
}

/* ─── Shake Warning Animation ────────────────────────────── */
@keyframes shake-warning {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.shake-warning {
    animation: shake-warning 0.6s ease-in-out;
}

/* ─── Enhanced Pill Transitions ──────────────────────────── */
.pill {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.pill:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}
.pill.active {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ─── Info Tooltips ──────────────────────────────────────── */
.tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tooltip-btn {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: all 0.2s;
    flex-shrink: 0;
}
.tooltip-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.15);
}
.tooltip-bubble {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.5;
    width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}
.tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(3, 7, 18, 0.95);
}
.tooltip-btn:hover + .tooltip-bubble,
.tooltip-bubble:hover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

[data-theme="light"] .tooltip-btn {
    background: rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .tooltip-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: #334155;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .tooltip-bubble::after {
    border-top-color: rgba(255, 255, 255, 0.95);
}

/* ─── History Panel ──────────────────────────────────────── */
.history-panel {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 16px;
}
.history-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 40px;
}
.history-card h3 {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.history-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--glass-border);
    background: transparent;
}
.history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
}
.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}
.history-table .pass { color: var(--success); font-weight: 800; }
.history-table .warn { color: var(--warning); font-weight: 800; }
.history-table .fail { color: var(--danger); font-weight: 800; }
.history-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.history-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}
.btn-clear-history {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-clear-history:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* ─── SVG Gauge Dial ─────────────────────────────────────── */
.gauge-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 16px 0;
}
.gauge-svg {
    width: 200px;
    height: 120px;
    overflow: visible;
}
.gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 14;
    stroke-linecap: round;
}
[data-theme="light"] .gauge-track {
    stroke: rgba(15, 23, 42, 0.06);
}
.gauge-fill {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                stroke 0.4s ease;
    filter: drop-shadow(0 0 6px currentColor);
}
.gauge-label-text {
    fill: var(--text-dim);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-anchor: middle;
}
.gauge-value-text {
    font-size: 28px;
    font-weight: 900;
    fill: var(--text-main);
    text-anchor: middle;
}
.gauge-zone-label {
    fill: var(--text-dim);
    font-size: 7px;
    font-weight: 600;
}

/* ─── Dynamic Wire Visualization ─────────────────────────── */
.wire-3d {
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.4s ease,
                box-shadow 0.4s ease;
}
.wire-3d.copper {
    background: linear-gradient(90deg, #b87333, #da8a4e, #e8a66a) !important;
    box-shadow: 0 5px 15px rgba(184, 115, 51, 0.3);
}
.wire-3d.aluminum {
    background: linear-gradient(90deg, #8a9ba8, #b0bec5, #cfd8dc) !important;
    box-shadow: 0 5px 15px rgba(138, 155, 168, 0.3);
}

/* ─── Theme Toggle Button ────────────────────────────────── */
.theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
    padding: 0;
}
.theme-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.1) rotate(15deg);
}
[data-theme="light"] .theme-toggle {
    background: rgba(15, 23, 42, 0.06);
}

/* ─── Scroll Top Enhancement ─────────────────────────────── */
#scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.3);
}
#scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(234, 88, 12, 0.4);
}

/* ─── Result Card Pulse ──────────────────────────────────── */
@keyframes result-pulse {
    0% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.3); }
    70% { box-shadow: 0 0 0 14px rgba(234, 88, 12, 0); }
    100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}
.result-pulse {
    animation: result-pulse 0.6s ease-out;
}

/* ─── Input Focus Glow ───────────────────────────────────── */
.glass-card input:focus,
.glass-card select:focus {
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(234, 88, 12, 0.08) !important;
}
