:root {
    --bg-dark: #0a0e1a;
    --bg-darker: #050810;
    --circuit-green: #00ff41;
    --accent-green: #00cc33;
    --dim-green: #00661a;
    --grid-color: rgba(0, 255, 65, 0.08);
    --glow-green: rgba(0, 255, 65, 0.4);
}

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

body {
    font-family: 'Courier New', monospace;
    background: var(--bg-dark);
    color: var(--circuit-green);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Grid Background */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* Circuit Container */
.circuit-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Circuit Traces (SVG Lines) */
.circuit-traces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.trace {
    fill: none;
    stroke: var(--circuit-green);
    stroke-width: 3;
    filter: drop-shadow(0 0 8px var(--glow-green));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawTrace 2s ease-out forwards;
}

.trace-1 { animation-delay: 0.2s; }
.trace-2 { animation-delay: 0.6s; }
.trace-3 { animation-delay: 0.9s; }
.trace-4 { animation-delay: 0.6s; }
.trace-5 { animation-delay: 1.2s; }
.trace-6 { animation-delay: 1.5s; }
.trace-7 { animation-delay: 1.8s; }
.trace-8 { animation-delay: 1.8s; }
.trace-9 { animation-delay: 1.8s; }
.trace-10 { animation-delay: 2.1s; }
.trace-11 { animation-delay: 2.4s; }

@keyframes drawTrace {
    to {
        stroke-dashoffset: 0;
    }
}

.junction-point {
    fill: var(--circuit-green);
    filter: drop-shadow(0 0 6px var(--glow-green));
    opacity: 0;
    animation: pointFadeIn 0.5s ease-out forwards;
}

.junction-1 { animation-delay: 0.5s; }
.junction-2 { animation-delay: 0.8s; }
.junction-3 { animation-delay: 1.1s; }
.junction-4 { animation-delay: 2.0s; }
.junction-5 { animation-delay: 2.2s; }
.junction-6 { animation-delay: 2.4s; }

.power-point {
    fill: var(--circuit-green);
    filter: drop-shadow(0 0 10px var(--glow-green));
    opacity: 0;
    animation: pointFadeIn 0.5s ease-out 0.3s forwards, powerPulse 2s ease-in-out 2s infinite;
}

.ground-point {
    fill: var(--circuit-green);
    filter: drop-shadow(0 0 10px var(--glow-green));
    opacity: 0;
    animation: pointFadeIn 0.5s ease-out 2.6s forwards;
}

@keyframes pointFadeIn {
    to {
        opacity: 1;
    }
}

@keyframes powerPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 10px var(--glow-green));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 20px var(--glow-green));
        transform: scale(1.3);
    }
}

/* Component Container */
.component-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none; 
    display: block;
}

/* Individual Components */
.component {
    position: absolute;
    transform: translate(-50%, -50%); 
    margin: 0;
    
    /* CRITICAL: Add these properties that were missing */
    text-decoration: none;
    color: var(--circuit-green);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: componentSlideIn 0.8s ease-out forwards;
}

.component:visited {
    color: var(--circuit-green);
}

.resistor {
    animation-delay: 0.6s;
    top: 299px; 
    left: 851px;
}

.capacitor {
    animation-delay: 0.9s;
    top: 412px;
    left: 851px;
}

.inductor {
    animation-delay: 1.2s;
    top: 187px;
    left: 851px;
}

@keyframes componentSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

.component-svg {
    width: 280px;
    height: 120px;
    filter: drop-shadow(0 0 12px var(--glow-green));
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.component:hover .component-svg {
    filter: drop-shadow(0 0 25px var(--circuit-green));
}

.component:active .component-svg {
    transform: scale(1.05);
}

.component-label {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 3px;
    text-shadow: 0 0 10px var(--glow-green);
    transition: all 0.3s ease;
    position: relative;
}

.component-label::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--circuit-green);
    box-shadow: 0 0 10px var(--circuit-green);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateX(-50%);
}

.component:hover .component-label::after {
    width: 100%;
}

.component:hover .component-label {
    text-shadow: 0 0 20px var(--circuit-green);
    letter-spacing: 4px;
}

.component-value {
    font-size: 1rem;
    color: var(--accent-green);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.component:hover .component-value {
    opacity: 1;
}

/* Header */
.header {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    animation: headerFadeIn 1s ease-out 0.2s forwards;
}

@keyframes headerFadeIn {
    to {
        opacity: 1;
    }
}

.portfolio-title {
    font-size: 2.5rem;
    letter-spacing: 8px;
    text-shadow: 0 0 20px var(--glow-green);
    margin-bottom: 20px;
    font-weight: 300;
}

/* Voltage Indicator - Moved below circuit */
.voltage-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    animation: headerFadeIn 1s ease-out 0.4s forwards;
}

.voltage-value {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 60px;
}

.voltage-bar {
    width: 150px;
    height: 8px;
    background: var(--bg-darker);
    border: 2px solid var(--circuit-green);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.voltage-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--dim-green), var(--circuit-green));
    box-shadow: 0 0 15px var(--glow-green);
    animation: voltageFlicker 3s ease-in-out infinite;
}

@keyframes voltageFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Ground Symbol */
.ground-symbol {
    position: relative;
    bottom: -33px;
    left: 600px;
    z-index: 10;
    opacity: 0;
    animation: groundFadeIn 4.5s ease-out 1.8s forwards;
}

@keyframes groundFadeIn {
    to {
        opacity: 0.6;
    }
}

/* Responsive Design */
/* Responsive Scaling */
@media (max-width: 1024px) {
    .circuit-board {
        transform: scale(0.8);
    }
}

@media (max-width: 768px) {
    .circuit-board {
        transform: scale(0.6);
    }
}

@media (max-width: 480px) {
    .circuit-board {
        transform: scale(0.4);
    }
}

/* Cursor effect */
body::before {
    content: '';
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--circuit-green);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Loading Animation */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

.circuit-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to bottom, 
        transparent, 
        var(--circuit-green), 
        transparent);
    opacity: 0.3;
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 100;
}

/* Fallback if you aren't using the text-group wrapper */
.inductor .component-label,
.inductor .component-value {
    top: -50px !important; /* Negative number pulls it UP above the line */
    position: relative;    /* Ensures the top value takes effect */
}

.resistor .component-label,
.resistor .component-value {
    top: -20px !important; /* Negative number pulls it UP above the line */
    position: relative;    /* Ensures the top value takes effect */
}

.capacitor .component-label,
.capacitor .component-value {
    top: -10px !important; /* Negative number pulls it UP above the line */
    position: relative;    /* Ensures the top value takes effect */
}

