/* ============================================
   ResistorShack - Main Stylesheet
   Aesthetic: Retro-tech / Electronics workbench
   ============================================ */

:root {
    /* Dark workbench theme */
    --bg-primary: #0a0e14;
    --bg-secondary: #111820;
    --bg-card: #151d28;
    --bg-elevated: #1a2332;
    
    /* Text */
    --text-primary: #e6edf3;
    --text-secondary: #b8c4ce;
    --text-muted: #6b7a8a;
    
    /* Accent - PCB Green / Oscilloscope */
    --accent: #00ff9d;
    --accent-dim: #00cc7d;
    --accent-glow: rgba(0, 255, 157, 0.4);
    --accent-subtle: rgba(0, 255, 157, 0.1);
    
    /* Secondary accents */
    --warning: #ffb800;
    --error: #ff4757;
    --info: #00b8ff;
    
    /* Resistor band colors */
    --band-black: #1a1a1a;
    --band-brown: #8b4513;
    --band-red: #dc143c;
    --band-orange: #ff8c00;
    --band-yellow: #ffd700;
    --band-green: #228b22;
    --band-blue: #0066cc;
    --band-violet: #8b008b;
    --band-grey: #808080;
    --band-white: #f5f5f5;
    --band-gold: #daa520;
    --band-silver: #c0c0c0;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Typography */
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    
    /* Effects */
    --border-radius: 4px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Scanline effect overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* Subtle noise texture */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

code, .mono {
    font-family: var(--font-mono);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

/* Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 20, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 255, 157, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--accent);
    font-size: 1.5rem;
}

.logo-icon-img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
}

.logo:hover .logo-icon {
    text-shadow: 0 0 10px var(--accent-glow);
}

.logo:hover .logo-icon-img {
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    position: relative;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Dropdown menu */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: var(--space-sm) 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    list-style: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    transition: all 0.15s ease;
}

.dropdown-menu a:hover {
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent);
}

/* Mobile hamburger menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px var(--space-xl) var(--space-xl);
        gap: 0;
        transition: right 0.3s ease;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: var(--space-md) 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 1rem;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 0 var(--space-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-dropdown.open .dropdown-menu {
        max-height: 500px;
    }
    
    .dropdown-menu a {
        padding: var(--space-sm) 0;
        font-size: 0.875rem;
        border-bottom: none;
    }
    
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 99;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition-normal);
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
    min-height: 70vh;
}

.terminal-prompt {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.prompt-symbol {
    opacity: 0.7;
}

.typing-text {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

.hero h1 {
    margin-bottom: var(--space-lg);
}

.highlight {
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

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

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Hero Circuit Graphic */
.hero-graphic {
    display: flex;
    justify-content: center;
    align-items: center;
}

.circuit-diagram {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 3/2;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    position: relative;
}

.circuit-diagram::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, var(--accent-subtle), transparent 70%);
    pointer-events: none;
}

.circuit-svg {
    width: 100%;
    height: 100%;
}

.led-glow {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.current-arrow {
    animation: flow 1.5s linear infinite;
}

@keyframes flow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Tools Grid Section */
.tools-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.title-decoration {
    color: var(--accent);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: var(--space-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    border-color: rgba(0, 255, 157, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: var(--space-lg);
    font-family: var(--font-mono);
}

.card h3 {
    margin-bottom: var(--space-sm);
}

.card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: var(--space-lg);
}

.card-formula {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: inline-block;
}

/* Mini Resistor Icon */
.mini-resistor {
    display: flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(180deg, #d4b896 0%, #c4a882 50%, #b89c76 100%);
    padding: 8px 12px;
    border-radius: 4px;
    width: fit-content;
}

.mini-resistor .band {
    width: 6px;
    height: 24px;
    border-radius: 1px;
}

/* ASCII Preview */
.ascii-preview {
    font-size: 1.25rem;
    background: var(--bg-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 255, 157, 0.2);
}

/* Quick Reference Section */
.quick-reference {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.reference-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
}

.reference-card h4 {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.formula-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.formula-block code {
    font-size: 0.9375rem;
    color: var(--accent);
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-xl);
    text-align: center;
}

.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: var(--space-xl);
        min-height: auto;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-graphic {
        order: -1;
    }
    
    .nav-links {
        gap: var(--space-md);
    }
    
    .nav-links a {
        font-size: 0.75rem;
    }
}

/* ============================================
   Page-specific styles
   ============================================ */

/* Calculator Pages */
.calculator-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.page-header {
    margin-bottom: var(--space-2xl);
}

.page-header h1 {
    margin-bottom: var(--space-sm);
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Input Groups */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.input-group {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    transition: border-color var(--transition-fast);
}

.input-group:focus-within {
    border-color: var(--accent);
}

.input-group.has-value {
    border-color: rgba(0, 255, 157, 0.3);
}

.input-group.calculated {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.input-label label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.input-label .symbol {
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 700;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.input-wrapper input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-primary);
    width: 100%;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.unit-select {
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent);
    cursor: pointer;
    min-width: 70px;
}

.unit-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Results Display */
.results-display {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: var(--border-radius);
    padding: var(--space-xl);
    text-align: center;
    margin-bottom: var(--space-xl);
}

.results-display h3 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.result-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Action Buttons */
.calculator-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* Explanation Section */
.explanation {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: var(--space-xl);
    margin-top: var(--space-2xl);
}

.explanation h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.explanation h2::before {
    content: '?';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
}

.explanation p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.explanation p:last-child {
    margin-bottom: 0;
}

/* Resistor Color Code Page */
.resistor-calculator {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.resistor-visual {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resistor-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #e8d5b7 0%, #d4c4a8 30%, #c9b89c 50%, #d4c4a8 70%, #e8d5b7 100%);
    width: 100%;
    max-width: 400px;
    height: 80px;
    border-radius: 8px;
    position: relative;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Wire leads */
.resistor-body::before,
.resistor-body::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: linear-gradient(180deg, #c0c0c0, #808080, #c0c0c0);
    top: 50%;
    transform: translateY(-50%);
}

.resistor-body::before {
    left: -60px;
}

.resistor-body::after {
    right: -60px;
}

.color-bands {
    display: flex;
    gap: 16px;
    padding: 0 30px;
}

.color-band {
    width: 24px;
    height: 60px;
    border-radius: 2px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}

.color-band:hover {
    transform: scaleY(1.1);
}

.color-band.tolerance {
    margin-left: 20px;
}

.band-label {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Color Picker */
.band-selectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    width: 100%;
}

.band-selector {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--space-md);
}

.band-selector h4 {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.color-option[data-color="black"] { background: var(--band-black); }
.color-option[data-color="brown"] { background: var(--band-brown); }
.color-option[data-color="red"] { background: var(--band-red); }
.color-option[data-color="orange"] { background: var(--band-orange); }
.color-option[data-color="yellow"] { background: var(--band-yellow); }
.color-option[data-color="green"] { background: var(--band-green); }
.color-option[data-color="blue"] { background: var(--band-blue); }
.color-option[data-color="violet"] { background: var(--band-violet); }
.color-option[data-color="grey"] { background: var(--band-grey); }
.color-option[data-color="white"] { background: var(--band-white); }
.color-option[data-color="gold"] { background: var(--band-gold); }
.color-option[data-color="silver"] { background: var(--band-silver); }

/* Resistor Result */
.resistor-result {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: var(--border-radius);
    padding: var(--space-xl);
    text-align: center;
    margin-bottom: var(--space-xl);
}

.resistor-result h3 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.resistor-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: var(--space-sm);
}

.resistor-tolerance {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Color Reference Table */
.color-reference {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: var(--space-xl);
    margin-top: var(--space-2xl);
    overflow-x: auto;
}

.color-reference h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

.color-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.color-table th,
.color-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.color-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.color-table td:first-child {
    text-align: left;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: var(--space-sm);
}

/* ASCII Table Page */
.ascii-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.ascii-controls {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: var(--space-md) var(--space-lg);
    padding-left: 44px;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-box::before {
    content: '⌕';
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.filter-buttons {
    display: flex;
    gap: var(--space-sm);
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

/* ASCII Table */
.ascii-table-container {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.ascii-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.ascii-table th {
    background: var(--bg-secondary);
    padding: var(--space-md);
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ascii-table th:hover {
    color: var(--accent);
}

.ascii-table th.sorted::after {
    content: ' ↓';
    color: var(--accent);
}

.ascii-table th.sorted.desc::after {
    content: ' ↑';
}

.ascii-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ascii-table tr:hover {
    background: rgba(0, 255, 157, 0.05);
}

.ascii-table .char-cell {
    font-size: 1.25rem;
    color: var(--accent);
    min-width: 50px;
}

.ascii-table .hex-cell {
    color: var(--info);
}

.ascii-table .bin-cell {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.ascii-table .desc-cell {
    color: var(--text-secondary);
}

.control-char {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--warning);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .color-bands {
        gap: 8px;
        padding: 0 15px;
    }
    
    .color-band {
        width: 18px;
        height: 50px;
    }
    
    .resistor-body {
        height: 60px;
    }
    
    .ascii-table .bin-cell {
        display: none;
    }
}
