/* =====================================================
   Estilos para Nuevas Funcionalidades
   ===================================================== */

/* Toggle Switch para Online/Offline */
.online-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #10b981;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

#online-status-text {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Indicador de Drivers Disponibles */
.drivers-available {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 0.75rem;
    border: 2px solid #86efac;
    margin: 1rem 0;
}

.drivers-available span {
    font-size: 1.5rem;
}

#online-drivers-count {
    font-size: 1.5rem;
    font-weight: bold;
    color: #15803d;
}

/* Badge de Distancia en Pedidos */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Mapa de Calor */
.heatmap-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.heatmap-controls select {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

#heatmap-container {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.hotspots-list h4 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.hotspot-card {
    padding: 1rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 0.75rem;
    border-left: 4px solid #f59e0b;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hotspot-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Control de Gastos */
.expense-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card div:first-child {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card div:last-child {
    font-size: 1.5rem;
    font-weight: bold;
}

#expense-form {
    display: grid;
    gap: 0.75rem;
}

#expense-form select,
#expense-form input,
#expense-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
}

#expense-form select:focus,
#expense-form input:focus,
#expense-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#fuel-fields {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: #f0f9ff;
    border-radius: 0.5rem;
    border: 1px solid #bae6fd;
}

.expense-item {
    padding: 1rem;
    margin: 0.5rem 0;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.expense-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.expense-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Animaciones */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Indicador de Nuevo Pedido */
.new-order-indicator {
    position: relative;
}

.new-order-indicator::after {
    content: "NUEVO";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
    height: 80px;
    margin: 0.5rem 0;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .expense-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hotspot-card {
        font-size: 0.9rem;
    }
    
    .drivers-available {
        font-size: 0.9rem;
    }
}

/* Total Preview Mejorado */
.total-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.total-preview span {
    font-size: 1.5rem;
}

/* Mejoras a Order Cards */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.order-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.order-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #1e293b;
}

.order-details {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.6;
}

.order-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.order-actions .btn {
    flex: 1;
}
