/* ============================================
   logistica.css — Estilos del módulo logístico
   Mobile-first responsive design
   ============================================ */

/* === Variables === */
:root {
    --log-primary: #0d6efd;
    --log-success: #198754;
    --log-danger: #dc3545;
    --log-warning: #ffc107;
}

/* === General === */
body {
    font-size: 14px;
}

/* === Cards KPI === */
.card.border-start {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card.border-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* === Barras de progreso === */
.progress {
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar {
    transition: width 0.6s ease;
}

/* === Feed de actividad === */
#activity-feed .list-group-item {
    transition: background-color 0.5s ease;
    border-left: 3px solid transparent;
}
#activity-feed .list-group-item.bg-light {
    border-left-color: var(--log-primary);
}

/* === QR Etiquetas (impresión) === */
.qr-etiqueta {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* === Vista movil del chofer === */
@media (max-width: 576px) {
    body {
        font-size: 15px;
    }
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 1.1rem;
    }
    .card-body {
        padding: 0.75rem;
    }
    .navbar-brand {
        font-size: 1rem;
    }
    .table {
        font-size: 0.85rem;
    }
    /* Paradas: botones mas grandes para touch */
    .parada-card .btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    /* Header sticky mas compacto */
    #headerChofer {
        top: 50px;
    }
    /* FABs ajuste movil */
    .fab-btn {
        bottom: 16px !important;
        right: 16px !important;
    }
    .fab-btn-secondary {
        bottom: 16px !important;
        right: 78px !important;
    }
}

/* === Parada cards (ruta chofer) === */
.parada-card {
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.parada-card:active {
    transform: scale(0.98);
}

/* Siguiente parada highlight pulse */
.parada-card.border-primary.border-2 {
    animation: nextStopPulse 2s infinite;
}
@keyframes nextStopPulse {
    0% { box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3); }
    50% { box-shadow: 0 2px 16px rgba(13, 110, 253, 0.15); }
    100% { box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3); }
}

/* === Firma digital === */
#firmaCanvas {
    cursor: crosshair;
    background: #fff;
}

/* === Escaneo QR === */
#qr-reader {
    border-radius: 8px;
    overflow: hidden;
    transition: border 0.3s ease;
}
#qr-reader video {
    border-radius: 8px;
}

/* === Botón flotante (FAB) === */
.btn.rounded-circle.position-fixed {
    transition: transform 0.2s ease;
}
.btn.rounded-circle.position-fixed:hover {
    transform: scale(1.1);
}

/* === Timeline === */
.timeline-item {
    transition: opacity 0.2s ease;
}

/* === Print === */
@media print {
    .navbar,
    .d-print-none,
    .btn:not(.d-print-inline),
    .fab-btn,
    .fab-btn-secondary,
    #toastContainer,
    #offlineBanner,
    #signalrStatus,
    footer {
        display: none !important;
    }
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
    .card-header {
        background: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .badge {
        border: 1px solid #999 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body {
        font-size: 12px;
    }
    .container, .container-fluid {
        max-width: 100% !important;
        padding: 0 !important;
    }
    img.img-thumbnail {
        max-height: 120px !important;
    }
    .progress-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* === Sticky bottom button (POD) === */
.sticky-bottom {
    position: sticky;
    bottom: 0;
    padding-top: 0.5rem;
}

/* === Indicador de conexión SignalR === */
#signalrStatus {
    font-size: 0.75rem;
}

/* === Animación de entrada para items del feed === */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
#activity-feed .list-group-item:first-child {
    animation: slideIn 0.3s ease;
}
