/* Estilos personalizados para OTD Dashboard */

/* ===== INDICADORES VISUALES PARA ESTADOS DE PEDIDOS ===== */

/* Estilos removidos - sin indicador visual para pedidos parcialmente completados */

/* ===== MEJORAS GENERALES DE UI/UX ===== */

/* Fuente y estilos base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Mejora de tarjetas */
.orden-card {
    border-radius: 8px;
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem !important;
}

/* Botón flotante ETL */
.floating-etl-button {
    position: fixed !important;
    bottom: 30px !important;
    left: 30px !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    /* Animación removida para que esté completamente fijo */
}

.orden-card:hover {
    /* Se eliminó el efecto de elevación */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    padding: 0.8rem 1.25rem;
    border-bottom: none;
}

/* Mejora de tablas */
.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border-bottom-width: 1px;
    background-color: #f8f9fa;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Colores tenues para las filas de productos según estado de entrega */
.table-danger.bg-opacity-25 {
    background-color: rgba(248, 215, 218, 0.25) !important;
}

.table-warning.bg-opacity-25 {
    background-color: rgba(255, 243, 205, 0.25) !important;
}

.table-success.bg-opacity-25 {
    background-color: rgba(209, 231, 221, 0.25) !important;
}

/* Asegurar que los colores sean visibles pero no demasiado intensos */
tr.table-danger.bg-opacity-25:hover {
    background-color: rgba(248, 215, 218, 0.4) !important;
}

tr.table-warning.bg-opacity-25:hover {
    background-color: rgba(255, 243, 205, 0.4) !important;
}

tr.table-success.bg-opacity-25:hover {
    background-color: rgba(209, 231, 221, 0.4) !important;
}

/* Mejora de badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
    border-radius: 4px;
    font-size: 0.85em;
    letter-spacing: 0.3px;
}

/* ID único con estilo compacto */
.badge.bg-primary {
    background-color: #0d6efd !important;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0px;
    font-size: 0.6rem !important;
    padding: 0.15em 0.3em !important;
    font-weight: 500 !important;
}

/* Estilos para botones de acción */
.btn-completar {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    border-radius: 6px;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
}

.btn-completar:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

.btn-problema {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
    border-radius: 6px;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
}

.btn-problema:hover {
    background-color: #e0a800 !important;
    border-color: #d39e00 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.2);
}

/* Botón de historial más elegante */
.btn-info {
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
    color: white !important;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
}

.btn-info:hover {
    background-color: #138496 !important;
    border-color: #117a8b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.2);
}

/* Estilo para claves de productos */
.codigo-producto {
    font-family: 'Roboto Mono', monospace;
    font-weight: 500;
    color: #0056b3;
    background-color: #f8f9fa;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid #dee2e6;
    font-size: 0.65rem !important;
}

/* Estilo para ID único más pequeño */
.id-unico {
    font-size: 0.65rem !important;
    font-family: 'Roboto Mono', monospace;
    color: #495057;
}

/* Mejora de la barra de navegación */
.bg-primary {
    background: linear-gradient(135deg, #0062cc, #0d6efd) !important;
}

.btn-light {
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Mejora de la experiencia en dispositivos móviles */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 8px;
        overflow-x: auto;
    }
    
    .orden-card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .card-header div:last-child {
        margin-top: 0.5rem;
    }
    
    /* Ajustes para la barra de navegación en móviles */
    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .nav-buttons .btn {
        margin-bottom: 0.5rem;
        padding: 0.375rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .nav-text {
        display: none;
    }
    
    .badge-counter {
        margin-bottom: 0.5rem;
    }
    
    /* Ajustes para el contenedor principal */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Animaciones suaves */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mejora visual para los tooltips */
.tooltip .tooltip-inner {
    background-color: #343a40;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Mejora de los modales */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* ===== BOTÓN FLOTANTE ETL - CONFIGURACIÓN SUPERIOR ===== */

.floating-etl-button .btn {
    border-radius: 50px;
    padding: 15px 25px;
    font-weight: 600;
    font-size: 0.9rem;
    background: linear-gradient(135deg, #0C2857 0%, #1e3a8a 100%);
    border: none;
    box-shadow: 0 8px 25px rgba(12, 40, 87, 0.3);
    transition: all 0.3s ease;
    min-width: 180px;
}

.floating-etl-button .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(12, 40, 87, 0.4);
    background: linear-gradient(135deg, #1e3a8a 0%, #0C2857 100%);
}

.floating-etl-button .btn:active {
    transform: translateY(-1px);
}

.floating-etl-button .btn.executing {
    background: linear-gradient(135deg, #05D9E8 0%, #0891b2 100%);
    cursor: not-allowed;
}

.floating-etl-button .btn.executing:hover {
    transform: none;
    background: linear-gradient(135deg, #05D9E8 0%, #0891b2 100%);
}

/* Animación float removida - botón ahora completamente fijo */

/* Modal ETL personalizado */
#etlResultModal .modal-header.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

#etlResultModal .modal-header.error {
    background: linear-gradient(135deg, #F44336 0%, #d32f2f 100%);
    color: white;
}

#etlResultModal .modal-header.processing {
    background: linear-gradient(135deg, #05D9E8 0%, #0891b2 100%);
    color: white;
}

.log-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.log-container pre {
    margin: 0;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .floating-etl-button {
        bottom: 20px !important;
        left: 20px !important;
    }
    
    .floating-etl-button .btn {
        padding: 12px 20px;
        font-size: 0.8rem;
        min-width: 150px;
    }
    
    .floating-etl-button .btn-text {
        display: none;
    }
}
