/* ============================================
   WAREHOUSE DIGITAL TWIN V.3.2 - STYLES
   ============================================ */

/* WAREHOUSE ANIMATIONS */
.warehouse-block {
    transition: all 0.3s ease;
}

.warehouse-block:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.cell {
    transition: all 0.3s ease;
}

.cell.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

#staffPut, #staffGet {
    transition: transform 0.3s ease;
}

#staffPut:hover, #staffGet:hover {
    transform: scale(1.2);
}

/* TOWER LAMP INDUSTRIAL */
.tower-lamp {
    width: 30px;
    height: 70px;
    position: relative;
    margin: 10px auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Base/Mount */
.tower-lamp::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 8px;
    background: linear-gradient(to bottom, #334155, #1e293b);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Pole */
.tower-lamp::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 100%;
    background: linear-gradient(to right, #475569, #334155);
    border-radius: 2px;
    z-index: -1;
}

/* Lamp Segments */
.tower-segment {
    width: 28px;
    height: 18px;
    border-radius: 3px;
    position: relative;
    border: 2px solid #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.tower-segment.active {
    animation: towerPulse 1.5s ease-in-out infinite;
}

.tower-segment.green {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.tower-segment.red {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.tower-segment.yellow {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.tower-segment.off {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes towerPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 15px currentColor, inset 0 2px 4px rgba(255, 255, 255, 0.3);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 25px currentColor, inset 0 2px 4px rgba(255, 255, 255, 0.3);
    }
}

/* RACK LOCATION LABEL */
.rack-label {
    position: absolute;
    top: -2px;
    left: -2px;
    background: white;
    border: 2px solid #1e293b;
    border-radius: 2px;
    padding: 2px 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 6px;
    font-weight: bold;
    color: #000;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 2px;
    pointer-events: none;
}

.rack-label::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 1px;
    height: 8px;
    background: #64748b;
    box-shadow: 1px 0 0 #64748b;
}

.label-color {
    width: 8px;
    height: 12px;
    border-radius: 1px;
    border: 1px solid #1e293b;
}

.label-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.label-barcode {
    width: 20px;
    height: 10px;
    background: linear-gradient(90deg, 
        #000 0%, #000 10%, 
        #fff 10%, #fff 15%,
        #000 15%, #000 20%,
        #fff 20%, #fff 22%,
        #000 22%, #000 28%,
        #fff 28%, #fff 30%,
        #000 30%, #000 35%,
        #fff 35%, #fff 40%,
        #000 40%, #000 100%
    );
    background-size: 100% 100%;
    border: 1px solid #000;
    margin-left: 2px;
}

/* ANIMATED PATHS */
.flow-path {
    fill: none;
    stroke-width: 3;
    stroke-dasharray: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.flow-path.active {
    opacity: 1;
    animation: flowDash 2s linear infinite;
}

.flow-path.gate-in {
    stroke: #22c55e;
    filter: drop-shadow(0 0 5px #22c55e);
}

.flow-path.gate-out {
    stroke: #3b82f6;
    filter: drop-shadow(0 0 5px #3b82f6);
}

.flow-path.to-monitor {
    stroke: #a855f7;
    stroke-width: 2;
    stroke-dasharray: 5;
    filter: drop-shadow(0 0 3px #a855f7);
}

@keyframes flowDash {
    to {
        stroke-dashoffset: -20;
    }
}

/* TV MONITOR - TOP CENTER */
@keyframes screenGlare {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

/* GATE ENHANCEMENTS */
.gate-container {
    position: relative;
}

.gate-indicator {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: indicatorBlink 1s ease-in-out infinite;
}

.gate-indicator.active {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

@keyframes indicatorBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
    .tv-monitor-center {
        min-width: 220px;
        padding: 12px;
        font-size: 0.85em;
    }
    
    .iot-lamp {
        width: 40px;
        height: 40px;
    }
}
