/* ========================================
   ORDERS - KitchenFlow
   Stili per la gestione ordini e timeline
   ======================================== */

/* ========================================
   Article Thumbnail Stack (per liste ordini)
   Cerchi sovrapposti con badge "+N"
   ======================================== */

.article-thumbnail-stack {
    display: flex;
    align-items: center;
    position: relative;
}

.article-thumbnail-stack img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bs-white);
    object-fit: cover;
    margin-left: -10px;
    box-shadow: 0 1px 3px rgba(var(--bs-black-rgb), 0.2);
}

.article-thumbnail-stack img:first-child {
    margin-left: 0;
    z-index: 3;
}

.article-thumbnail-stack img:nth-child(2) {
    z-index: 2;
}

.article-thumbnail-stack img:nth-child(3) {
    z-index: 1;
}

.article-thumbnail-stack .more-badge {
    margin-left: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bs-secondary);
    color: var(--bs-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid var(--bs-white);
    box-shadow: 0 1px 3px rgba(var(--bs-black-rgb), 0.2);
    z-index: 0;
}

/* Responsive adjustments per mobile */
@media (max-width: 767.98px) {
    .article-thumbnail-stack img {
        width: 28px;
        height: 28px;
        margin-left: -8px;
    }

    .article-thumbnail-stack .more-badge {
        width: 28px;
        height: 28px;
        margin-left: -8px;
        font-size: 0.65rem;
    }
}

/* ========================================
   ORDER TIMELINE - Mobile First Design
   ======================================== */

.order-timeline {
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--bs-tertiary-bg) 0%, var(--bs-secondary-bg) 100%);
    border-radius: 0.5rem;
}

/* Layout verticale su mobile */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.timeline-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.timeline-step.active,
.timeline-step.completed {
    opacity: 1;
}

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

/* Icona step */
.timeline-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 1.25rem;
    border: 3px solid var(--bs-white);
    box-shadow: 0 2px 4px rgba(var(--bs-black-rgb), 0.1);
    transition: all 0.3s ease;
    z-index: 2;
}

.timeline-step.active .timeline-icon {
    background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 80%, black));
    color: var(--bs-white);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.4);
    animation: pulse 2s infinite;
}

.timeline-step.completed .timeline-icon {
    background: linear-gradient(135deg, var(--bs-success), color-mix(in srgb, var(--bs-success) 80%, black));
    color: var(--bs-white);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.4); }
    50% { box-shadow: 0 4px 20px rgba(var(--bs-primary-rgb), 0.6); }
}

/* Label */
.timeline-content {
    display: flex;
    flex-direction: column;
}

.timeline-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.timeline-sublabel {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.timeline-step.active .timeline-label {
    color: var(--bs-primary);
}

.timeline-step.completed .timeline-label {
    color: var(--bs-success);
}

/* Connettore verticale mobile */
.timeline-connector {
    width: 4px;
    height: 24px;
    background-color: var(--bs-border-color);
    margin-left: 22px;
    transition: background-color 0.3s ease;
}

.timeline-connector.completed {
    background: linear-gradient(180deg, var(--bs-success), color-mix(in srgb, var(--bs-success) 80%, black));
}

/* Stato Annullato */
.timeline-cancelled {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--bs-danger-bg-subtle);
    border: 2px solid var(--bs-danger);
    border-radius: 0.375rem;
}

.timeline-cancelled i {
    font-size: 1.25rem;
}

/* RESPONSIVE: Desktop ≥768px - Layout Orizzontale */
@media (min-width: 768px) {
    .timeline-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    .timeline-step {
        flex: 1;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    /* Connettore orizzontale */
    .timeline-connector {
        flex: 1;
        width: auto;
        height: 4px;
        margin: 0;
        margin-top: -34px;
    }

    .timeline-icon {
        width: 56px;
        height: 56px;
        min-width: 56px;
        font-size: 1.5rem;
    }

    .timeline-label {
        font-size: 1.1rem;
    }

    .timeline-sublabel {
        font-size: 0.9rem;
    }
}

@media (min-width: 992px) {
    .order-timeline {
        padding: 1.5rem 2rem;
    }

    .timeline-icon {
        width: 64px;
        height: 64px;
        min-width: 64px;
        font-size: 1.75rem;
    }
}

/* ========================================
   DROPDOWN GENERAZIONE MESSAGGIO
   ======================================== */

.dropdown-menu .dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
}

.fab-action.dropdown-toggle {
    width: 100%;
}

.fab-actions .dropdown-menu {
    min-width: 100%;
}

.fab-actions .dropup .dropdown-menu {
    bottom: 100%;
    top: auto;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .btn-group .dropdown-menu {
        box-shadow: 0 4px 12px rgba(var(--bs-black-rgb), 0.15);
    }
}

/* ========================================
   ORDER TIMELINE VERTICAL (Sidebar)
   ======================================== */

.order-timeline-vertical {
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border-radius: 0.5rem;
}

.order-timeline-vertical .timeline-steps {
    display: flex;
    flex-direction: column;
    position: relative;
}

.order-timeline-vertical .timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    padding-bottom: 1.25rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.order-timeline-vertical .timeline-step:last-child {
    padding-bottom: 0;
}

.order-timeline-vertical .timeline-step.active,
.order-timeline-vertical .timeline-step.completed {
    opacity: 1;
}

/* Marker (icona) */
.order-timeline-vertical .timeline-marker {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 1rem;
    border: 2px solid var(--bs-white);
    box-shadow: 0 2px 4px rgba(var(--bs-black-rgb), 0.1);
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.order-timeline-vertical .timeline-step.active .timeline-marker {
    background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 80%, black));
    color: var(--bs-white);
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.3);
}

.order-timeline-vertical .timeline-step.completed .timeline-marker {
    background: linear-gradient(135deg, var(--bs-success), color-mix(in srgb, var(--bs-success) 80%, black));
    color: var(--bs-white);
}

/* Linea verticale connettore */
.order-timeline-vertical .timeline-step:not(:last-child) .timeline-marker::after {
    content: '';
    position: absolute;
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background-color: var(--bs-border-color);
    z-index: 1;
}

.order-timeline-vertical .timeline-step.completed:not(:last-child) .timeline-marker::after {
    background: linear-gradient(180deg, var(--bs-success), color-mix(in srgb, var(--bs-success) 80%, black));
}

/* Info (label e sublabel) */
.order-timeline-vertical .timeline-info {
    display: flex;
    flex-direction: column;
    padding-top: 0.25rem;
}

.order-timeline-vertical .timeline-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bs-body-color);
    line-height: 1.2;
}

.order-timeline-vertical .timeline-sublabel {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    line-height: 1.2;
}

.order-timeline-vertical .timeline-step.active .timeline-label {
    color: var(--bs-primary);
}

.order-timeline-vertical .timeline-step.completed .timeline-label {
    color: var(--bs-success);
}

/* Stato Annullato */
.order-timeline-vertical .timeline-cancelled {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: var(--bs-danger-bg-subtle);
    border: 2px solid var(--bs-danger);
    border-radius: 0.375rem;
}

.order-timeline-vertical .timeline-cancelled i {
    font-size: 1.5rem;
}

/* ========================================
   ORDER TIMELINE COMPACT (Sidebar Horizontal)
   ======================================== */

.order-timeline-compact {
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--bs-tertiary-bg) 0%, var(--bs-secondary-bg) 100%);
    border-radius: 0.5rem;
}

.order-timeline-compact .timeline-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Nodi timeline */
.order-timeline-compact .timeline-node {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    border: 2px solid var(--bs-white);
    box-shadow: 0 2px 4px rgba(var(--bs-black-rgb), 0.1);
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    opacity: 0.6;
}

.order-timeline-compact .timeline-node.active,
.order-timeline-compact .timeline-node.completed {
    opacity: 1;
}

.order-timeline-compact .timeline-node.active {
    background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 80%, black));
    color: var(--bs-white);
    box-shadow: 0 4px 8px rgba(var(--bs-primary-rgb), 0.3);
    transform: scale(1.1);
}

.order-timeline-compact .timeline-node.completed {
    background: linear-gradient(135deg, var(--bs-success), color-mix(in srgb, var(--bs-success) 80%, black));
    color: var(--bs-white);
}

/* Linee connettori */
.order-timeline-compact .timeline-line {
    flex: 1;
    height: 3px;
    background-color: var(--bs-border-color);
    margin: 0 0.25rem;
    transition: background-color 0.3s ease;
}

.order-timeline-compact .timeline-line.completed {
    background: linear-gradient(90deg, var(--bs-success), color-mix(in srgb, var(--bs-success) 80%, black));
}

/* Stato Annullato */
.order-timeline-compact .timeline-cancelled-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    background-color: var(--bs-danger-bg-subtle);
    border: 1px solid var(--bs-danger);
    border-radius: 0.25rem;
}

.order-timeline-compact .timeline-cancelled-compact i {
    font-size: 1rem;
}

