/* ============================================================================
   LOTTI TIMELINE WORKFLOW - CSS
   Da aggiungere a: /wwwroot/css/site.css o creare file separato
   ============================================================================ */

/* Timeline Workflow Container */
.workflow-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin: 0;
}

/* Timeline Step */
.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

/* Linea connettore tra step */
.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

/* Linea verde per step completati */
.timeline-step.completed::after {
    background: #198754;
}

/* Cerchio step */
.timeline-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: white;
    border: 2px solid #dee2e6;
    cursor: default;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

/* Step completato */
.timeline-step.completed .timeline-circle {
    background: #198754;
    border-color: #198754;
    color: white;
}

/* Step attivo */
.timeline-step.active .timeline-circle {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
}

/* Step futuro */
.timeline-step.future .timeline-circle {
    background: white;
    border-color: #dee2e6;
    color: #adb5bd;
}

/* Hover effect per step cliccabili */
.timeline-step.clickable .timeline-circle {
    cursor: pointer;
}

.timeline-step.clickable .timeline-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Label sotto step */
.timeline-label {
    margin-top: 8px;
    font-size: 0.7rem;
    text-align: center;
    font-weight: 500;
    color: #6c757d;
}

.timeline-step.active .timeline-label {
    color: #0d6efd;
    font-weight: 600;
}

.timeline-step.completed .timeline-label {
    color: #198754;
}

/* Animation per transizione stato */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.timeline-step.animating .timeline-circle {
    animation: pulse 0.6s ease-in-out;
}

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

/* Tablet */
@media (max-width: 992px) {
    .workflow-timeline {
        padding: 15px 0;
    }
    
    .timeline-label {
        font-size: 0.65rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .workflow-timeline {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timeline-step {
        flex-direction: row;
        width: 100%;
        margin-bottom: 15px;
        justify-content: flex-start;
    }

    .timeline-step::after {
        display: none;
    }

    /* Aggiungi linea verticale tra step su mobile */
    .timeline-step:not(:last-child)::before {
        content: '';
        position: absolute;
        left: 14px;
        top: 30px;
        width: 2px;
        height: 100%;
        background: #dee2e6;
        z-index: 0;
    }

    .timeline-step.completed:not(:last-child)::before {
        background: #198754;
    }

    .timeline-label {
        margin-top: 0;
        margin-left: 12px;
        text-align: left;
        font-size: 0.75rem;
    }

    .timeline-circle {
        flex-shrink: 0;
    }
}

/* ============================================================================
   STATI BADGE COLORS (per coerenza UI)
   ============================================================================ */

.badge.stato-bozza {
    background-color: #6c757d !important;
}

.badge.stato-invalutazione {
    background-color: #0dcaf0 !important;
}

.badge.stato-approvato {
    background-color: #198754 !important;
}

.badge.stato-rifiutato {
    background-color: #dc3545 !important;
}

.badge.stato-inelaborazione {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.stato-presentato {
    background-color: #0d6efd !important;
}

.badge.stato-inesame {
    background-color: #0d6efd !important;
}

.badge.stato-richiestaintegrazione {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.stato-vinto {
    background-color: #198754 !important;
}

.badge.stato-perso {
    background-color: #dc3545 !important;
}

.badge.stato-scartato {
    background-color: #212529 !important;
}

.badge.stato-annullato {
    background-color: #6c757d !important;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.sticky-top-custom {
    position: sticky;
    top: 20px;
    z-index: 100;
}

.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .workflow-timeline {
        break-inside: avoid;
    }
    
    .timeline-step::after,
    .timeline-step::before {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .timeline-circle {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
