/* Efectos de la portada animada */
.lightning-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13,110,253,0.1) 0%, rgba(255,255,255,0) 50%, rgba(13,110,253,0.1) 100%);
    opacity: 0;
    animation: lightning 8s infinite;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particles-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.8) 100%);
}

.circuit-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.circuit-line {
    position: absolute;
    background: rgba(13, 110, 253, 0.3);
}

.circuit-line.horizontal {
    width: 100%;
    height: 2px;
}

.circuit-line.vertical {
    width: 2px;
    height: 100%;
}

.circuit-line.top {
    top: 20%;
    animation: circuitGlowHorizontal 6s infinite;
}

.circuit-line.bottom {
    bottom: 20%;
    animation: circuitGlowHorizontal 6s infinite 2s;
}

.circuit-line.left {
    left: 20%;
    animation: circuitGlowVertical 5s infinite 1s;
}

.circuit-line.right {
    right: 20%;
    animation: circuitGlowVertical 5s infinite 3s;
}

.electron-flow {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border: 2px dashed rgba(13, 110, 253, 0.2);
    border-radius: 50%;
    animation: electronPulse 4s infinite alternate;
}

.electron-flow::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: #4dabf7;
    border-radius: 50%;
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    animation: electronMove 3s linear infinite;
}

/* Animaciones */
@keyframes lightning {
    0%, 100% { opacity: 0; }
    2%, 5% { opacity: 0.3; }
    3%, 4% { opacity: 0.6; }
}

@keyframes circuitGlowHorizontal {
    0%, 100% { box-shadow: 0 0 5px rgba(13, 110, 253, 0); }
    50% { box-shadow: 0 0 15px rgba(13, 110, 253, 0.5); }
}

@keyframes circuitGlowVertical {
    0%, 100% { box-shadow: 0 0 5px rgba(13, 110, 253, 0); }
    50% { box-shadow: 0 0 15px rgba(13, 110, 253, 0.5); }
}

@keyframes electronPulse {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.05); opacity: 0.6; }
}

@keyframes electronMove {
    0% { transform: translateY(-50%) translateX(0); }
    25% { transform: translateY(-100%) translateX(25%); }
    50% { transform: translateY(-50%) translateX(50%); }
    75% { transform: translateY(0%) translateX(25%); }
    100% { transform: translateY(-50%) translateX(0); }
}

.animate-flicker {
    animation: textFlicker 8s infinite;
}

@keyframes textFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 20px #0d6efd,
            0 0 30px #0d6efd;
    }
    20%, 24%, 55% { 
        text-shadow: none;
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(13, 110, 253, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

    .circuit-element {
        width: 60px;
        height: 60px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 5px;
        cursor: move;
        transition: transform 0.2s;
    }
    
    .circuit-element:hover {
        transform: scale(1.1);
    }

   /* Añade esto a tu archivo CSS */
#ohmChart {
    max-height: 120px;
    width: 100% !important;
    margin-top: 10px;
}

.card-body .display-4 {
    font-size: 2rem; /* Reduce el tamaño del título grande */
    margin-bottom: 0.5rem;
}

.card-body h2 {
    font-size: 1.5rem; /* Reduce el tamaño del resultado */
    margin-bottom: 0.5rem;
}
    .component-placed {
        position: absolute;
        cursor: move;
        width: 60px;
        height: 60px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Estilos para los componentes específicos */
    .component-placed[data-component="battery"] {
        background-color: #0d6efd;
        color: white;
    }
    
    .component-placed[data-component="resistor"] {
        background-color: #dc3545;
        color: white;
    }
    
    .component-placed[data-component="led"] {
        background-color: #ffc107;
        color: black;
    }
    
    .component-placed[data-component="switch"] {
        background-color: #198754;
        color: white;
    }
    .interactive-diagram {
        height: 200px;
        background-color: #343a40;
        border-radius: 10px;
        position: relative;
        overflow: hidden;
        margin-bottom: 20px;
    }

    .electron {
        position: absolute;
        width: 8px;
        height: 8px;
        background-color: #0dcaf0;
        border-radius: 50%;
        box-shadow: 0 0 10px #0dcaf0;
        animation: electronMove 3s linear infinite;
    }
    
    .conductor {
        position: absolute;
        height: 4px;
        background-color: #6c757d;
        top: 50%;
        left: 20px;
        right: 20px;
        transform: translateY(-50%);
    }
    
    /* Animación para los electrones */
    @keyframes electronMove {
        0% {
            transform: translateX(-20px);
            opacity: 0;
        }
        10% {
            opacity: 1;
        }
        90% {
            opacity: 1;
        }
        100% {
            transform: translateX(calc(100% + 20px));
            opacity: 0;
        }
    }
    