/* ============================================================
   SISTEMA TRACKING VISIVO STILE AMAZON - MAGAZZINO
   File: warehouse-tracking.css
   Versione: 1.0
   ============================================================ */

/* Container principale timeline magazzino */
.warehouse-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    position: relative;
    width: 100%;
}

/* Singolo step della timeline */
.warehouse-timeline .timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

/* Dot/cerchio dello stato */
.warehouse-timeline .timeline-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #ffffff;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
}

/* Stato completato - VERDE BRILLANTE */
.warehouse-timeline .timeline-step.completed .timeline-dot {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #4CAF50;
    color: white;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
    transform: scale(1.05);
}

/* Stato attivo (in corso) - BLU ANIMATO */
.warehouse-timeline .timeline-step.active .timeline-dot {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border-color: #2196F3;
    color: white;
    animation: pulse-smooth 2s ease-in-out infinite;
    box-shadow: 0 0 0 6px rgba(33, 150, 243, 0.15);
    transform: scale(1.1);
    font-weight: bold;
}

/* Stato pendente (da fare) - GRIGIO CHIARO */
.warehouse-timeline .timeline-step.pending .timeline-dot {
    background: #fafafa;
    border-color: #e0e0e0;
    color: #bdbdbd;
}

/* Animazione pulsazione più smooth */
@keyframes pulse-smooth {
    0%, 100% {
        box-shadow: 0 0 0 6px rgba(33, 150, 243, 0.15);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(33, 150, 243, 0.08);
    }
}

/* Label sotto il dot */
.warehouse-timeline .timeline-label {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    color: #333;
    max-width: 80px;
    line-height: 1.2;
}

.warehouse-timeline .timeline-step.completed .timeline-label {
    color: #4CAF50;
    font-weight: 700;
}

.warehouse-timeline .timeline-step.active .timeline-label {
    color: #2196F3;
    font-weight: 700;
}

.warehouse-timeline .timeline-step.pending .timeline-label {
    color: #999;
    font-weight: 500;
}

/* Data e ora */
.warehouse-timeline .timeline-date {
    font-size: 10px;
    color: #666;
    margin-top: 3px;
    text-align: center;
    white-space: nowrap;
}

.warehouse-timeline .timeline-step.completed .timeline-date {
    color: #4CAF50;
}

.warehouse-timeline .timeline-step.active .timeline-date {
    color: #2196F3;
}

/* Nome utente */
.warehouse-timeline .timeline-user {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    text-align: center;
    font-style: italic;
    white-space: nowrap;
}

/* Linea di connessione tra gli step - PIÙ SPESSA */
.warehouse-timeline .timeline-line {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    position: relative;
    margin: 0 -8px;
    z-index: 1;
    border-radius: 2px;
    transition: all 0.4s ease;
}

.warehouse-timeline .timeline-line.completed {
    background: linear-gradient(90deg, #4CAF50 0%, #66BB6A 100%);
    box-shadow: 0 1px 3px rgba(76, 175, 80, 0.3);
}

/* ============================================================
   VERSIONE COMPATTA (per lista ordini)
   ============================================================ */

.warehouse-timeline.compact {
    padding: 12px 0;
    justify-content: center;
    gap: 8px;
}

.warehouse-timeline.compact .timeline-step {
    flex: 0 0 auto;
}

.warehouse-timeline.compact .timeline-dot {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-width: 3px;
}

.warehouse-timeline.compact .timeline-step.completed .timeline-dot {
    transform: scale(1);
}

.warehouse-timeline.compact .timeline-step.active .timeline-dot {
    transform: scale(1.05);
}

/* MOSTRA le etichette anche nella versione compatta */
.warehouse-timeline.compact .timeline-label {
    display: block;
    font-size: 9px;
    margin-top: 4px;
    max-width: 70px;
}

/* MOSTRA date e utenti nella versione compatta */
.warehouse-timeline.compact .timeline-date {
    display: block;
    font-size: 8px;
    margin-top: 2px;
}

.warehouse-timeline.compact .timeline-user {
    display: block;
    font-size: 8px;
    margin-top: 1px;
}

.warehouse-timeline.compact .timeline-line {
    flex: 0 0 24px;
    width: 24px;
    height: 3px;
    margin: 0;
}

/* ============================================================
   VERSIONE COMPLETA (per dettaglio ordine)
   ============================================================ */

.warehouse-timeline.full {
    padding: 30px 20px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        transparent 18px,
        #f8f9fa 18px, 
        #f8f9fa 100%
    );
    border-radius: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.warehouse-timeline.full .timeline-step {
    flex: 1;
}

.warehouse-timeline.full .timeline-dot {
    width: 44px;
    height: 44px;
    font-size: 20px;
}

.warehouse-timeline.full .timeline-line {
    margin: 0 -12px;
}

/* ============================================================
   EFFETTI HOVER
   ============================================================ */

.warehouse-timeline .timeline-step:hover .timeline-dot {
    transform: scale(1.1);
    cursor: help;
}

.warehouse-timeline .timeline-step.completed:hover .timeline-dot {
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.warehouse-timeline .timeline-step.active:hover .timeline-dot {
    box-shadow: 0 0 0 8px rgba(33, 150, 243, 0.2);
}

.warehouse-timeline .timeline-step.pending:hover .timeline-dot {
    border-color: #bdbdbd;
    background: #f5f5f5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .warehouse-timeline.full {
        padding: 20px 10px;
    }
    
    .warehouse-timeline.full .timeline-dot {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .warehouse-timeline .timeline-label {
        font-size: 10px;
        max-width: 60px;
    }
    
    .warehouse-timeline .timeline-date,
    .warehouse-timeline .timeline-user {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    /* OTTIMIZZAZIONE MOBILE - Timeline magazzino più piccola */
    .warehouse-timeline.compact {
        padding: 8px 0;
        gap: 4px;
        transform: scale(0.9);
        transform-origin: center center;
    }
    
    .warehouse-timeline.compact .timeline-dot {
        width: 24px;
        height: 24px;
        font-size: 12px;
        border-width: 2px;
    }
    
    .warehouse-timeline.compact .timeline-label {
        font-size: 7px;
        margin-top: 3px;
        max-width: 50px;
    }
    
    .warehouse-timeline.compact .timeline-date {
        font-size: 6px;
        margin-top: 1px;
    }
    
    .warehouse-timeline.compact .timeline-user {
        font-size: 6px;
        margin-top: 1px;
    }
    
    .warehouse-timeline.compact .timeline-line {
        width: 12px;
        height: 2px;
    }
    
    /* Timeline full - dettaglio ordine */
    .warehouse-timeline.full {
        padding: 15px 5px;
    }
    
    .warehouse-timeline.full .timeline-dot {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .warehouse-timeline.full .timeline-label {
        font-size: 8px;
        max-width: 55px;
    }
    
    .warehouse-timeline.full .timeline-date,
    .warehouse-timeline.full .timeline-user {
        font-size: 7px;
    }
}

/* ============================================================
   INTEGRAZIONE CON STILE ESISTENTE
   ============================================================ */

/* Sostituisce eventuali barre percentuale negli ordini */
.order-card .order-progress {
    padding: 8px 0;
    background: transparent;
    border: none;
    margin-top: 10px;
}

.order-card .warehouse-timeline.compact {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: 12px;
}

/* ============================================================
   STAMPA (per PDF)
   ============================================================ */

@media print {
    .warehouse-timeline {
        page-break-inside: avoid;
    }
    
    .warehouse-timeline .timeline-step.active .timeline-dot {
        animation: none;
    }
}
