/* ===================================
   FICHIER CSS MODERNE - MyMotorBills
   ================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    line-height: 1.6;
}

/* Variables de couleurs */
:root {
    --primary-color: #48c9b0;
    --primary-hover: #3db89d;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --text-lighter: #999;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --error-color: #c33;
    --error-bg: #fee;
    --success-color: #48c9b0;
}

/* ===================================
   NAVIGATION
   ================================== */
nav {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 3%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    height: 45px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 0.6rem 1.2rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    background: #e8f9f6;
    color: var(--primary-color);
}

.vehicle-selector {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--bg-light);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
}

.vehicle-selector i {
    color: var(--primary-color);
}

.vehicle-name {
    font-weight: 600;
    color: var(--text-dark);
}

.total-badge {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.user-menu:hover {
    background: #e8f9f6;
    color: var(--primary-color);
}

/* Menu hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 3%;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropdown-menu a:hover {
    background: #e8f9f6;
    color: var(--primary-color);
}

/* ===================================
   CONTAINERS & LAYOUT
   ================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3%;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 3%;
}

/* ===================================
   HEADERS & TITLES
   ================================== */
.header-section {
    text-align: center;
    margin-bottom: 3rem;
}

.header-section h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
}

/* ===================================
   CARDS & SECTIONS
   ================================== */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}

.card-header h2,
.card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-dark);
}

.card-header i {
    color: var(--primary-color);
}

/* ===================================
   FORMS
   ================================== */
.form-group {
    margin-bottom: 1.2rem;
}

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(72, 201, 176, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===================================
   BUTTONS
   ================================== */
.btn-primary,
.myButton {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary:hover,
.myButton:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 201, 176, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    padding: 0.9rem 2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: #dc3545;
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    color: var(--primary-color);
}

/* ===================================
   TABLES
   ================================== */
.table-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-light);
}

thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: var(--bg-light);
}

tbody td {
    padding: 1rem;
    color: var(--text-dark);
}

tbody td a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

tbody td a:hover {
    color: var(--primary-hover);
}

/* ===================================
   VEHICLE CARDS (Grid)
   ================================== */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.vehicle-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.vehicle-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.vehicle-card-placeholder {
    width: 100%;
    height: 200px;
    background: var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.vehicle-card-placeholder i {
    font-size: 3rem;
    color: var(--primary-color);
}

.vehicle-card h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.vehicle-card-info {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

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

.delete-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 35px;
    height: 35px;
    background: rgba(220, 53, 69, 0.9);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ===================================
   MESSAGES & ALERTS
   ================================== */
.error-message {
    background: var(--error-bg);
    color: var(--error-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #fcc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message {
    background: #e8f9f6;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-message {
    background: #e7f3ff;
    color: #0066cc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #99ccff;
}

/* ===================================
   LOGIN & REGISTER PAGES
   ================================== */
.auth-container {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    padding: 3rem 2.5rem;
    margin: 0 auto;
}

.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-section img {
    height: 60px;
    margin-bottom: 1rem;
}

.slogan {
    color: var(--text-light);
    font-size: 0.95rem;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--white);
    padding: 0 1rem;
    position: relative;
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.auth-link {
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.forgot-password a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ===================================
   FOOTER
   ================================== */
footer {
    background: var(--text-dark);
    color: var(--text-lighter);
    padding: 2rem 3%;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.8;
    margin-top: 4rem;
}

/* ===================================
   RESPONSIVE
   ================================== */
@media (max-width: 968px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .container,
    .page-container {
        padding: 1.5rem 4%;
    }

    .vehicles-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.5rem;
    }

    .table-container {
        padding: 1rem;
    }

    table {
        font-size: 0.9rem;
    }

    thead th,
    tbody td {
        padding: 0.8rem 0.5rem;
    }
}

@media (max-width: 640px) {
    nav {
        padding: 1rem 4%;
    }

    .auth-container {
        padding: 2rem 1.5rem;
    }

    .header-section h1,
    .page-header h1 {
        font-size: 1.5rem;
    }

    .btn-primary,
    .btn-secondary,
    .myButton {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ===================================
   UTILITY CLASSES
   ================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex {
    display: flex;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}