/*Crée un black theme*/
:root {
    --bg-dark: #121212;
    --bg-surface: #1e1e1e;
    --bg-input: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #2196F3;
    --border-color: #333333;
}

/* === COMMON STYLES === */
body {
    background-color: #121212;
    color: #ffffff;
    font-family: Arial, sans-serif;
    margin: 0;
}

/* === LOGIN PAGE === */
.login-container {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 30px 25px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.login-container h1 {
    margin: 0 0 20px 0;
    text-align: center;
    color: #e0e0e0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #bdbdbd;
}

.form-group select, .form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #2c2c2c;
    color: #fff;
    outline: none;
}

.form-group button[type="submit"] {
    width: 100%;
    padding: 10px 14px;
    background: #2196F3;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    margin-top: 8px;
}

.form-group button[type="submit"]:hover {
    background: #1976D2;
}

.error {
    background: #f44336;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    display: none;
}

.error.show {
    display: block;
}

/* === DRIVER REGISTRATION PAGE === */
.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
}

.card h1 {
    margin-top: 0;
    text-align: center;
}

.card label {
    display: block;
    margin: 8px 0 4px;
    color: #bdbdbd;
}

.card input, .card select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #2c2c2c;
    color: #fff;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: #2196F3;
    color: #fff;
    border-color: #1976D2;
}

.success {
    background: #1b5e20;
    padding: 10px;
    border-radius: 6px;
    margin-top: 12px;
    display: none;
}

.error {
    background: #b71c1c;
    padding: 10px;
    border-radius: 6px;
    margin-top: 12px;
    display: none;
}

.lang-selector {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.flag-btn {
    background: #2c2c2c;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flag-btn.active {
    outline: 2px solid #2196F3;
}

.hidden {
    display: none;
}

/* === MAIN DASHBOARD === */
.dashboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    display: flex;
    align-items: center;
}

.card-icon {
    font-size: 2.5em;
    margin-right: 20px;
    color: #2196F3;
}

.card-content {
    flex-grow: 1;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

.truck-list-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #333;
    max-height: 70vh;
    overflow-y: auto;
}

h1 {
    text-align: center;
    color: #333;
    padding: 20px;
    border-bottom: 2px solid #2196F3;
    margin-bottom: 30px;
}

h2, h3 {
    color: #444;
    margin: 0 0 10px 0;
}

.button-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.import-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: inline-flex;
    width: auto !important;
    max-width: none;
    white-space: nowrap;
}

.logout-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    padding: 10px 14px;
    background: #e53935;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #b71c1c;
}

.logout-button:hover {
    background: #c62828;
}

.create-truck-button {
    position: fixed;
    top: 70px;
    left: 20px;
    z-index: 1000;
    padding: 10px 12px;
    background: #43A047;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #2E7D32;
}

.create-truck-button:hover {
    background: #2E7D32;
}

.trucks-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.trucks-table th, .trucks-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    color: #333;
}

.trucks-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
    user-select: none;
}

.trucks-table tr:hover {
    background-color: #f9f9f9;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    color: #ffffff;
}

.pagination button {
    padding: 5px 10px;
    border: 1px solid #333;
    background: #1e1e1e;
    color: #ffffff;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #2c2c2c;
    color: #666;
}

.action-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #2196F3;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.action-button:hover {
    background-color: #1976D2;
}

.action-button.active {
    background-color: #1976D2;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.5);
    border: 2px solid #90CAF9;
}

.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    padding: 8px 15px;
    border: 1px solid #333;
    border-radius: 5px;
    flex-grow: 1;
    max-width: 300px;
    background-color: #2c2c2c;
    color: #ffffff;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    display: none;
    z-index: 3000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

.toast-success {
    background-color: #4CAF50;
    color: white;
}

.toast-error {
    background-color: #f44336;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%)
    }
    to {
        transform: translateX(0)
    }
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.status-waiting { background-color: #9E9E9E; }
.status-call { background-color: #ff9800; }
.status-not-arrived { background-color: #616161; }
.status-arrived { background-color: #42A5F5; }
.status-docked { background-color: #7E57C2; }
.status-done { background-color: #66BB6A; }
.status-canceled { background-color: #e53935; }

/* Action button variants */
.btn-arrive { background-color: #1e88e5; }
.btn-enter  { background-color: #00897b; }
.btn-exit   { background-color: #ef6c00; }
.btn-view   { background-color: #546e7a; }
.btn-beeper { background-color: #f9a825; }
.btn-dock   { background-color: #7e57c2; }
.btn-assign { background-color: #43a047; }
.btn-cancel { background-color: #e53935; }

.btn-arrive:hover { background-color: #1565c0; }
.btn-enter:hover  { background-color: #00695c; }
.btn-exit:hover   { background-color: #e65100; }
.btn-view:hover   { background-color: #455a64; }
.btn-beeper:hover { background-color: #f57f17; }
.btn-dock:hover   { background-color: #673ab7; }
.btn-assign:hover { background-color: #2e7d32; }
.btn-cancel:hover { background-color: #c62828; }

/* === MODALS === */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    width: 90%;
    max-width: 520px;
    overflow: hidden;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #333;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.modal-actions {
    padding: 12px 16px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal .close-btn {
    background: transparent;
    border: none;
    color: #bdbdbd;
    font-size: 18px;
    cursor: pointer;
}

.modal input, .modal select, .modal textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #2c2c2c;
    color: #fff;
}

.btn-secondary {
    background: #424242;
    color: #fff;
    border-color: #333;
}

/* === TRUCK DETAIL PAGE === */
.truck-detail-container {
    padding: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.truck-detail-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.truck-detail-card h1 {
    margin-top: 0;
    border-bottom: 2px solid #2196F3;
    padding-bottom: 10px;
    color: #333;
}

.truck-detail-card h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.field {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
}

.label {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.value {
    color: #333;
    font-weight: bold;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1976D2;
    margin-bottom: 15px;
}

.back:hover {
    text-decoration: underline;
}

.actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.action-button {
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: #2196F3;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cancel-alert {
    background: #ffebee;
    border: 2px solid #f44336;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    color: #c62828;
}

.cancel-alert h3 {
    margin: 0 0 8px 0;
    color: #d32f2f;
    font-size: 1.1em;
}

body {
    padding: 50px;
    font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    margin: 0;
}

a {
    color: var(--accent-color);
}

h1 {
    margin-bottom: 20px;
    color: var(--text-primary);
    text-align: center;
}

.login-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    max-width: 320px;
    margin: 40px auto;
}

input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background-color: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    color: var(--text-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
