/**
 * Módulo Frota - Estilos CSS
 * Estilos específicos para o módulo de gestão de frota
 */

/* ===== CORES E VARIÁVEIS =====
   Usa variáveis centralizadas de _css-variables.css
   com fallbacks para compatibilidade */
:root {
    --frota-primary: var(--color-primary-500, #1976D2);
    --frota-secondary: var(--color-orange-500, #F97316);
    --frota-success: var(--color-success-500, #10B981);
    --frota-danger: var(--color-error-500, #EF4444);
    --frota-warning: var(--color-warning-500, #F59E0B);
    --frota-info: var(--color-info-500, #3B82F6);
    --frota-light: var(--color-neutral-50, #F9FAFB);
    --frota-dark: var(--color-neutral-900, #1F2937);
    --frota-border: var(--border-default, #E0E7ED);
    --frota-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
}

/* ===== LAYOUT GERAL ===== */
.frota-container {
    padding: 1rem;
}

.frota-header {
    background: linear-gradient(135deg, var(--frota-primary), #1976d2);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
}

.frota-header h1 {
    margin: 0;
    font-weight: 300;
}

.frota-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* ===== CARDS E COMPONENTES ===== */
.frota-card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--frota-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.frota-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.frota-card-header {
    background: var(--frota-light);
    border-bottom: 1px solid var(--frota-border);
    font-weight: 600;
    color: var(--frota-dark);
}

/* ===== INDICADORES E KPIS ===== */
.frota-kpi-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--frota-shadow);
    border-left: 4px solid var(--frota-primary);
    transition: all 0.3s ease;
}

.frota-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 3rem 0 rgba(58, 59, 69, 0.3);
}

.frota-kpi-card.success {
    border-left-color: var(--frota-success);
}

.frota-kpi-card.warning {
    border-left-color: var(--frota-warning);
}

.frota-kpi-card.danger {
    border-left-color: var(--frota-danger);
}

.frota-kpi-card.info {
    border-left-color: var(--frota-info);
}

.frota-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--frota-dark);
}

.frota-kpi-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.frota-kpi-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.3;
}

/* ===== DASHBOARD ===== */
.frota-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.frota-chart-container {
    position: relative;
    height: 300px;
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: var(--frota-shadow);
}

.frota-chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--frota-dark);
}

/* ===== ALERTAS ===== */
.frota-alerts {
    max-height: 400px;
    overflow-y: auto;
}

.frota-alert-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--frota-border);
    transition: background-color 0.2s ease;
}

.frota-alert-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.frota-alert-item:last-child {
    border-bottom: none;
}

.frota-alert-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.frota-alert-content {
    flex: 1;
}

.frota-alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.frota-alert-message {
    font-size: 0.875rem;
    color: #6c757d;
}

.frota-alert-action {
    margin-left: 0.5rem;
}

/* ===== FORMULÁRIOS ===== */
.frota-form-section {
    margin-bottom: 2rem;
}

.frota-form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--frota-primary);
    color: var(--frota-primary);
}

.frota-form-group {
    margin-bottom: 1rem;
}

.frota-form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--frota-dark);
}

.frota-form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.frota-form-control:focus {
    border-color: var(--frota-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.25);
}

/* ===== TABELAS ===== */
.frota-table {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--frota-shadow);
}

.frota-table thead th {
    background: var(--frota-primary);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
}

.frota-table tbody tr {
    transition: background-color 0.2s ease;
}

.frota-table tbody tr:hover {
    background-color: rgba(30, 136, 229, 0.05);
}

.frota-table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid var(--frota-border);
}

/* ===== BADGES E STATUS ===== */
.frota-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.frota-status-ativo {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--frota-success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.frota-status-inativo {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

.frota-status-manutencao {
    background-color: rgba(255, 152, 0, 0.1);
    color: var(--frota-warning);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.frota-status-vencido {
    background-color: rgba(244, 67, 54, 0.1);
    color: var(--frota-danger);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* ===== BOTÕES ===== */
.frota-btn {
    border-radius: 0.375rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.frota-btn-primary {
    background: var(--frota-primary);
    border-color: var(--frota-primary);
    color: white;
}

.frota-btn-primary:hover {
    background: #1976d2;
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 1rem rgba(30, 136, 229, 0.3);
}

.frota-btn-success {
    background: var(--frota-success);
    border-color: var(--frota-success);
    color: white;
}

.frota-btn-success:hover {
    background: #45a049;
    border-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 1rem rgba(76, 175, 80, 0.3);
}

.frota-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ===== FILTROS ===== */
.frota-filters {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--frota-shadow);
}

.frota-filters-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--frota-primary);
}

.frota-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.frota-filters-col {
    flex: 1;
    min-width: 200px;
}

.frota-filters-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== MODAL CUSTOMIZADO ===== */
.frota-modal .modal-header {
    background: var(--frota-primary);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

.frota-modal .modal-header .close {
    color: white;
    opacity: 0.8;
}

.frota-modal .modal-header .close:hover {
    opacity: 1;
}

.frota-modal .modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ===== TABS ===== */
.frota-tabs .nav-tabs {
    border-bottom: 2px solid var(--frota-border);
}

.frota-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 600;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease;
}

.frota-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--frota-primary);
}

.frota-tabs .nav-link.active {
    background: none;
    border-color: var(--frota-primary);
    color: var(--frota-primary);
}

/* ===== LOADING ===== */
.frota-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.frota-loading i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite; /* Uses spin from _animations.css */
}

/* ===== TIMELINE ===== */
.frota-timeline {
    position: relative;
    padding: 1rem 0;
}

.frota-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--frota-border);
}

.frota-timeline-item {
    position: relative;
    padding: 1rem 0 1rem 50px;
    margin-bottom: 1rem;
}

.frota-timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--frota-primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--frota-primary);
}

.frota-timeline-content {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: var(--frota-shadow);
}

.frota-timeline-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.frota-timeline-date {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .frota-dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .frota-filters-row {
        flex-direction: column;
    }
    
    .frota-filters-col {
        min-width: 100%;
    }
    
    .frota-filters-actions {
        width: 100%;
        justify-content: center;
    }
    
    .frota-kpi-card {
        margin-bottom: 1rem;
    }
    
    .frota-chart-container {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .frota-container {
        padding: 0.5rem;
    }
    
    .frota-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .frota-kpi-value {
        font-size: 1.5rem;
    }
    
    .frota-chart-container {
        height: 200px;
        padding: 0.5rem;
    }
}

/* ===== UTILITÁRIOS ===== */
.frota-text-primary { color: var(--frota-primary) !important; }
.frota-text-success { color: var(--frota-success) !important; }
.frota-text-warning { color: var(--frota-warning) !important; }
.frota-text-danger { color: var(--frota-danger) !important; }
.frota-text-info { color: var(--frota-info) !important; }

.frota-bg-primary { background-color: var(--frota-primary) !important; }
.frota-bg-success { background-color: var(--frota-success) !important; }
.frota-bg-warning { background-color: var(--frota-warning) !important; }
.frota-bg-danger { background-color: var(--frota-danger) !important; }
.frota-bg-info { background-color: var(--frota-info) !important; }

.frota-shadow { box-shadow: var(--frota-shadow) !important; }
.frota-shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }

.frota-rounded { border-radius: 0.5rem !important; }
.frota-rounded-lg { border-radius: 1rem !important; }

/* ===== PRINT ===== */
@media print {
    .frota-btn,
    .frota-filters,
    .frota-alert-action {
        display: none !important;
    }

    .frota-card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }

    .frota-table {
        box-shadow: none !important;
    }
}

/* ================================================================
   DARK MODE SUPPORT
   ================================================================ */

.dark .frota-kpi-card {
    background: #374151;
    color: #F9FAFB;
}

.dark .frota-kpi-label {
    color: #9CA3AF;
}

.dark .frota-chart-container {
    background: #1F2937;
    color: #F9FAFB;
}

.dark .frota-filters {
    background: #374151;
    color: #F9FAFB;
}

.dark .frota-filters-title {
    color: #60A5FA;
}

.dark .frota-timeline-content {
    background: #374151;
    color: #F9FAFB;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(0, 0, 0, 0.3);
}

.dark .frota-card {
    background: #1F2937;
    border-color: var(--frota-border);
}

.dark .frota-table thead {
    background: #374151;
    color: #F9FAFB;
}

.dark .frota-table tbody tr {
    border-color: #4B5563;
}

.dark .frota-table tbody tr:hover {
    background: #374151;
}

.dark .frota-alert {
    background: #374151;
    border-color: #4B5563;
}

.dark .frota-header {
    background: linear-gradient(135deg, var(--frota-primary) 0%, #1E40AF 100%);
}

/* Additional dark mode coverage */
.dark .frota-kpi-value {
    color: #F9FAFB;
}

.dark .frota-card-header {
    background: #27272A;
    border-color: #3F3F46;
    color: #F9FAFB;
}

.dark .frota-form-control {
    background-color: #18181B;
    border-color: #3F3F46;
    color: #F9FAFB;
}

.dark .frota-form-control:focus {
    border-color: #60A5FA;
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
}

.dark .frota-form-label {
    color: #E5E7EB;
}

.dark .frota-modal .modal-content {
    background-color: #18181B;
    border-color: #3F3F46;
}

.dark .frota-modal .modal-body {
    color: #E5E7EB;
}

.dark .frota-tabs .nav-link {
    color: #9CA3AF;
}

.dark .frota-tabs .nav-link:hover {
    color: #60A5FA;
}

.dark .frota-tabs .nav-link.active {
    color: #60A5FA;
    border-color: #60A5FA;
}

.dark .frota-loading {
    color: #9CA3AF;
}

.dark .frota-timeline::before {
    background: #3F3F46;
}

.dark .frota-timeline-date {
    color: #9CA3AF;
}

.dark .frota-alert-item {
    border-color: #3F3F46;
}

.dark .frota-alert-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark .frota-alert-message {
    color: #9CA3AF;
}

.dark .frota-chart-title {
    color: #F9FAFB;
}

.dark .frota-form-section-title {
    color: #60A5FA;
    border-color: #60A5FA;
}

.dark .frota-table tbody td {
    border-color: #3F3F46;
    color: #E5E7EB;
}

.dark .frota-status-inativo {
    background-color: rgba(107, 114, 128, 0.2);
    color: #9CA3AF;
}