/* Variables pour les thèmes */
:root {
    /* Thème clair (par défaut) */
    --bg-color: #f8f9fa;
    --card-bg: #fff;
    --text-color: #333;
    --border-color: #eee;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --feature-bg: #f8f9fa;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --header-bg: #f8f9fa;
    --table-text: #333;
    --modal-text: #333;
    --input-text: #333;
    --table-bg: #fff;
    --table-bg-alt: #f8f9fa;
}

/* Thème sombre */
[data-theme="dark"] {
    --bg-color: #222;
    --card-bg: #333;
    --text-color: #f8f9fa;
    --border-color: #444;
    --primary-color: #0d6efd;
    --secondary-color: #adb5bd;
    --success-color: #198754;
    --feature-bg: #2c2c2c;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --header-bg: #2c2c2c;
    --table-text: #f8f9fa;
    --modal-text: #f8f9fa;
    --input-text: #f8f9fa;
    --table-bg: #222;
    --table-bg-alt: #2c2c2c;
}

/* Styles généraux */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.container {
    padding-top: 2rem;
    padding-bottom: 2rem;
    max-width: 100%; /* Utiliser toute la largeur disponible */
    width: 100%;
}

/* Styles de la page d'accueil */
.landing-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.landing-content {
    margin: 2rem 0;
}

.feature-box {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    background-color: var(--feature-bg);
    border-radius: 0 5px 5px 0;
    transition: all 0.3s ease;
}

.feature-box h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Styles des formulaires d'authentification */
.auth-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

/* Styles du tableau de bord */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color) !important;
    transition: all 0.3s ease;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    background-color: var(--card-bg);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.card-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.total-net {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--success-color);
}

/* Bouton de thème */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-left: 10px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.theme-icon {
    margin-right: 5px;
    font-size: 1.2rem;
    vertical-align: middle;
}

/* Styles pour les tableaux en mode sombre */
.table {
    color: var(--table-text) !important;
}

[data-theme="dark"] .table {
    color: #fff !important;
    background-color: #222 !important;
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: #2c2c2c !important;
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(even) {
    background-color: #222 !important;
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--modal-text);
}

.form-control {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--input-text) !important;
}

.form-label {
    color: var(--text-color);
}

/* Bouton de sauvegarde plus visible */
.save-button {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-buttons {
        flex-direction: column;
    }

    .card-header {
        flex-direction: column;
    }

    .card-header h5 {
        margin-bottom: 1rem;
    }
}

/* Élargir la table pour une meilleure lisibilité */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
}

/* Correction pour les inputs en mode sombre */
[data-theme="dark"] .form-control {
    background-color: #444;
    border-color: #555;
    color: #fff !important;
}

[data-theme="dark"] .form-control:focus {
    background-color: #444;
    color: #fff;
}

[data-theme="dark"] .form-select {
    background-color: #444;
    border-color: #555;
    color: #fff;
}

[data-theme="dark"] .modal-content {
    background-color: #333;
    color: #fff;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #444;
}

[data-theme="dark"] .table {
    color: #fff !important;
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    color: #222 !important;
    border-color: #444;
}

/* Ajustement de la largeur des colonnes */
.col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
}

@media (min-width: 992px) {
    .col-md-8 {
        flex: 0 0 75%;
        max-width: 75%;
    }

    .col-md-4 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}
