/* LED and Transition Animations */

/* LED Glow Base */
.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    transition: all 0.3s ease;
}

/* LED States */
.led.off {
    background: #222;
    box-shadow: none;
}

.led.idle {
    background: #444;
    box-shadow: 0 0 2px rgba(255,255,255,0.1);
}

.led.power {
    background: #22c55e;
    box-shadow: 
        0 0 5px #22c55e,
        0 0 10px #22c55e,
        0 0 20px rgba(34,197,94,0.5);
}

.led.dragging,
.led.blue-pulse {
    background: #3b82f6;
    animation: bluePulse 1s ease-in-out infinite;
}

.led.near-slot,
.led.yellow-flicker {
    background: #f59e0b;
    animation: yellowFlicker 0.15s ease-in-out infinite;
}

.led.connected,
.led.green-solid {
    background: #22c55e;
    box-shadow: 
        0 0 8px #22c55e,
        0 0 16px rgba(34,197,94,0.6),
        0 0 32px rgba(34,197,94,0.3);
}

.led.error,
.led.red-flash {
    background: #ef4444;
    animation: redFlash 0.3s ease-in-out infinite;
}

/* Keyframe Animations */
@keyframes bluePulse {
    0%, 100% {
        box-shadow: 
            0 0 5px #3b82f6,
            0 0 10px #3b82f6,
            0 0 20px rgba(59,130,246,0.5);
        opacity: 1;
    }
    50% {
        box-shadow: 
            0 0 10px #3b82f6,
            0 0 20px #3b82f6,
            0 0 40px rgba(59,130,246,0.8);
        opacity: 0.8;
    }
}

@keyframes yellowFlicker {
    0%, 100% {
        opacity: 1;
        box-shadow: 
            0 0 5px #f59e0b,
            0 0 10px rgba(245,158,11,0.5);
    }
    50% {
        opacity: 0.4;
        box-shadow: 0 0 2px #f59e0b;
    }
}

@keyframes redFlash {
    0%, 100% {
        background: #ef4444;
        box-shadow: 0 0 10px #ef4444;
    }
    50% {
        background: #7f1d1d;
        box-shadow: none;
    }
}

@keyframes greenGlow {
    0%, 100% {
        box-shadow: 
            0 0 8px #22c55e,
            0 0 16px rgba(34,197,94,0.6);
    }
    50% {
        box-shadow: 
            0 0 12px #22c55e,
            0 0 24px rgba(34,197,94,0.8);
    }
}

/* Slot Animations */
.slot {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slot.drag-over {
    transform: scale(1.05);
    border-color: #f59e0b !important;
    background: rgba(245,158,11,0.1);
}

.slot.drop-ready {
    transform: scale(1.08);
    border-color: #22c55e !important;
    background: rgba(34,197,94,0.15);
}

.slot.filled {
    border-color: #22c55e !important;
    background: rgba(34,197,94,0.1);
}

/* Product Tile Animations */
.usb-product {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.usb-product:hover {
    transform: translateY(-4px) rotateX(5deg);
}

.usb-product.dragging {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0.9;
}

.usb-product.connected {
    opacity: 0.4;
    transform: scale(0.95);
    pointer-events: none;
}

/* Snap Animation */
@keyframes snapIn {
    0% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.slot .product-in-slot {
    animation: snapIn 0.3s ease-out;
}

/* Popover Fade */
.popover {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease-out;
}

.popover.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Cart Update Animation */
@keyframes cartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cart-total.updated {
    animation: cartPulse 0.3s ease-out;
}
