/* Sistema de Controle de Carros - Estilos CSS */

/* Variáveis CSS para modo claro e escuro */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Modo Claro */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Modo Escuro */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #555555;
    --shadow: rgba(255, 255, 255, 0.1);
}

/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background-color: var(--bg-primary);
    box-shadow: 0 2px 10px var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Navegação */
.nav {
    background-color: var(--primary-color);
    padding: 0.5rem 0;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-dark);
}

/* Dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--shadow);
    border-radius: 4px;
    min-width: 200px;
    z-index: 1000;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.dropdown-link:hover {
    background-color: var(--bg-tertiary);
}

/* Botão hambúrguer */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
}

/* Main content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background-color: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.card-header {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

/* Formulários */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control:disabled {
    background-color: var(--bg-tertiary);
    cursor: not-allowed;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background-color: var(--success-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-warning { background-color: var(--warning-color); color: #212529; }
.btn-secondary { background-color: var(--secondary-color); color: white; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }

/* Tabelas */
.table-responsive { overflow-x: auto; margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; background-color: var(--bg-primary); }
.table th,
.table td { padding: 0.75rem; border-bottom: 1px solid var(--border-color); text-align: left; }
.table th { background-color: var(--bg-tertiary); font-weight: 600; position: sticky; top: 0; }
.table tbody tr:hover { background-color: var(--bg-tertiary); }

/* Alertas */
.alert { padding: 1rem; margin-bottom: 1rem; border: 1px solid transparent; border-radius: 4px; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-warning { color: #856404; background-color: #fff3cd; border-color: #ffeaa7; }
.alert-info { color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb; }

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

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
}

.stat-number { font-size: 2.5rem; font-weight: bold; margin-bottom: 0.5rem; }
.stat-label { font-size: 1rem; opacity: 0.9; }

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.login-card {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px var(--shadow);
    width: 100%;
    max-width: 400px;
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { color: var(--primary-color); margin-bottom: 0.5rem; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 2000; }
.modal-content {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background-color: var(--bg-primary); padding: 2rem; border-radius: 8px; box-shadow: 0 10px 30px var(--shadow);
    max-width: 500px; width: 90%;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); }

/* ===== Responsividade ===== */
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 1rem; }

    .nav-toggle { display: block; margin-left: auto; margin-right: 1rem; }

    .nav-list { display: none; flex-direction: column; width: 100%; background-color: var(--primary-color); border-top: 1px solid var(--border-color); }
    .nav-list.active { display: flex; }

    .nav-item { width: 100%; }
    .nav-link { padding: 1rem; border-bottom: 1px solid var(--primary-dark); }

    .nav-item.dropdown .dropdown-content { display: none; position: static; background: var(--primary-dark); box-shadow: none; }
    .nav-item.dropdown.open .dropdown-content { display: flex; flex-direction: column; }
    .dropdown-link { color: white; padding-left: 2rem; }

    .dashboard-grid { grid-template-columns: 1fr; }
    .table-responsive { font-size: 0.875rem; }
    .card-body { padding: 1rem; }
    .btn { width: 100%; margin-right: 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 10px; }
    .main-content { padding: 1rem 0; }
    .login-card { margin: 1rem; padding: 1.5rem; }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.5s ease; }

/* Utilitários */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.d-none { display: none; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 1rem; }
.w-100 { width: 100%; }


/* Footer */
.footer {
    background-color: var(--bg-primary);
    padding: 1rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}
.footer p {
    margin: 0;
    line-height: 1.6;
}
.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}
.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
.footer small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
