/* static/css/driver_home.css */

:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --bg-body: #f1f5f9;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --success: #198754;
    --warning: #f59e0b;
    --danger: #dc3545;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Wrapper Centralizado */
.driver-content-wrapper {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    padding-top: 30px; 
}

/* HEADER DA LISTA (Botão Atualizar) */
.list-header-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.btn-refresh-text {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    display: flex; align-items: center; gap: 5px;
    cursor: pointer;
}

/* LISTA DE ROTAS */
.routes-list { display: flex; flex-direction: column; gap: 15px; }

.route-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #f1f5f9;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.route-card:active { transform: scale(0.98); }

.route-header {
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start;
    margin-bottom: 12px;
}

.route-title {
    font-size: 16px; font-weight: 700; color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
}

.route-status {
    font-size: 11px; font-weight: 700;
    padding: 4px 8px; border-radius: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.progress-container { margin-top: 15px; }
.progress-bar-bg {
    height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%; background: var(--primary); border-radius: 4px;
    transition: width 0.5s ease;
}

/* --- ESTILOS PARA DOWNLOAD DE ROTA --- */
.card-footer-actions {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: 20px; 
    padding-top: 15px; 
    border-top: 1px solid #f1f5f9;
    gap: 10px;
}

/* Botão Baixar (Padrão) */
.btn-download-action {
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #dbeafe;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-download-action:active { background: #dbeafe; }

/* Botão Baixado (Sucesso/Check) */
.btn-downloaded {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    cursor: pointer;
}

/* Botão Abrir (Seta) */
.btn-open-route {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    display: flex; align-items: center; gap: 4px;
    cursor: pointer;
}

/* Spinner e Estados */
.spinning { animation: spin 1s linear infinite; font-size: 16px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.loading { opacity: 0.7; pointer-events: none; }
.error { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* Modal de Offline (Se usado) */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-card-center { background: white; width: 85%; max-width: 320px; padding: 30px; border-radius: 20px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.modal-icon-header { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-size: 30px; }

.hidden { display: none !important; }