/* 
   Styles.css - Version complète avec corrections responsive
   Simulateur de Taxe d'Aménagement
   Couleurs principales : Vert #004A22, Brun #B48500
   Polices : Bahnschrift Light, Bell MT
*/

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Bahnschrift Light', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f8f8;
}

header, footer {
    text-align: center;
    padding: 20px 0;
}

header {
    border-bottom: 3px solid #004A22;
    margin-bottom: 30px;
    padding-bottom: 15px;
}

footer {
    border-top: 2px solid #004A22;
    margin-top: 30px;
    padding-top: 15px;
    color: #004A22;
    font-size: 0.9em;
}

h1, h2 {
    color: #004A22;
    margin-bottom: 20px;
    font-family: 'Bell MT', Georgia, serif;
}

h1 {
    font-size: 2.2em;
}

h2 {
    font-size: 1.8em;
    border-left: 5px solid #B48500;
    padding-left: 15px;
}

h3 {
    color: #B48500;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-family: 'Bell MT', Georgia, serif;
}

section {
    margin-bottom: 30px;
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Logo et en-tête */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo {
    max-height: 80px;
    margin-right: 15px;
    background-color: white;
    padding: 6px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styles pour le formulaire */
form {
    display: grid;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #004A22;
    width: 40%;
    padding-right: 15px;
}

.form-group input[type="number"],
.form-group input[type="text"] {
    width: 55%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus {
    border-color: #B48500;
    box-shadow: 0 0 5px rgba(180, 133, 0, 0.3);
    outline: none;
}

.form-group small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 3px;
    font-style: italic;
    margin-left: 40%;
    width: 55%;
}

/* Cas spécial pour les checkboxes */
.form-group.checkbox-group {
    display: flex;
    align-items: center;
}

.form-group.checkbox-group label {
    width: auto;
    margin-right: 0;
    margin-left: 10px;
}

.form-group input[type="checkbox"] {
    margin-right: 5px;
    transform: scale(1.2);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.button-group button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Bahnschrift Light', Arial, sans-serif;
}

#calculate-btn {
    background-color: #004A22;
    color: white;
}

#calculate-btn:hover {
    background-color: #006633;
    transform: translateY(-2px);
}

#reset-btn {
    background-color: #B48500;
    color: white;
}

#reset-btn:hover {
    background-color: #D9A001;
    transform: translateY(-2px);
}

/* Styles pour les onglets */
.form-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #004A22;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 15px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background-color: #004A22;
    color: white;
    border-color: #004A22;
    font-weight: bold;
}

.tab-btn:hover:not(.active) {
    background-color: #e0e0e0;
}

/* Styles pour les résultats */
#results-section {
    margin-top: 30px;
    border-top: 3px solid #B48500;
    padding-top: 30px;
}

.result-summary, .result-details {
    margin-bottom: 25px;
}

.summary-grid, .detail-grid {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.summary-item, .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.summary-item.total {
    font-weight: bold;
    font-size: 1.2em;
    border-top: 2px solid #B48500;
    margin-top: 10px;
    padding-top: 15px;
}

.label {
    color: #004A22;
    font-weight: 500;
}

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

.detail-btn {
    background-color: #B48500;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.detail-btn:hover {
    background-color: #D9A001;
    transform: translateY(-2px);
}

.centered {
    display: flex;
    justify-content: center;
}

/* Sections de détails */
.detail-section {
    background-color: #f5f5f5;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #B48500;
}

.detail-section h4 {
    margin-bottom: 12px;
    color: #004A22;
    font-family: 'Bell MT', Georgia, serif;
}

/* Style pour les séparateurs de sections */
.section-divider {
    background-color: #eaf5ea;
    font-weight: bold;
    padding: 10px 12px;
    margin-top: 15px;
    color: #004A22;
    border-left: 4px solid #004A22;
    border-radius: 4px;
}

/* Style pour les totaux */
.detail-item.total {
    font-weight: bold;
    border-top: 2px solid #B48500;
    margin-top: 15px;
    padding-top: 15px;
    color: #004A22;
}

/* En-têtes de section */
.section-header {
    margin: 25px 0 15px;
    padding: 12px 15px;
    background-color: #eaf5ea;
    border-left: 5px solid #004A22;
    border-radius: 0 4px 4px 0;
}

.section-header h4 {
    color: #004A22;
    font-size: 1.1em;
    margin: 0;
    font-family: 'Bell MT', Georgia, serif;
}

/* Messages d'avertissement */
.total-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
}

.warning-text {
    font-weight: bold;
}

/* Boîtes d'information */
.info-box {
    background-color: #eaf5ea;
    border: 1px solid #c3e6cb;
    color: #004A22;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.reminder-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.reminder-box ul {
    padding-left: 20px;
}

.reminder-box li {
    margin-bottom: 8px;
}

/* Titres de catégories */
.category-title {
    background-color: #f2f7ff;
    padding: 10px 12px;
    margin: 20px 0 15px 0;
    border-radius: 6px;
    font-weight: bold;
    border-left: 4px solid #B48500;
    font-size: 1.1em;
    color: #B48500;
}

.category-title:first-of-type {
    margin-top: 0;
}

/* Tableaux */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.results-table th,
.results-table td {
    padding: 12px;
    border: 1px solid #ddd;
}

.results-table th {
    background-color: #004A22;
    color: white;
    text-align: center;
    font-weight: bold;
}

.results-table td {
    text-align: left;
}

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

.results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-table .total-row {
    background-color: #eaf5ea;
    font-weight: bold;
}

.results-table .grand-total-row {
    background-color: #dcecdc;
    font-weight: bold;
    font-size: 1.1em;
}

.results-table .grand-total-row td {
    border-top: 2px solid #004A22;
}

/* Tableau d'exonérations */
.exoneration-table {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

.exoneration-table th {
    background-color: #004A22;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.exoneration-table td {
    padding: 10px;
    border: 1px solid #ddd;
    vertical-align: top;
}

.exoneration-table input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.exoneration-table small {
    display: block;
    font-size: 12px;
    font-style: italic;
    color: #666;
    margin-top: 3px;
}

.category-row td {
    background-color: #eaf5ea;
    font-weight: bold;
    color: #004A22;
    padding: 8px 10px;
}

/* Styles pour le sélecteur de thème */
.theme-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.theme-title {
    font-weight: 500;
    color: #004A22;
    margin-right: 15px;
    font-size: 0.9em;
}

.theme-options {
    display: flex;
    gap: 15px;
}

.theme-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.theme-option input[type="radio"] {
    margin-right: 5px;
    accent-color: #B48500;
}

.theme-name {
    font-size: 0.9em;
    color: #444;
}

/* Styles pour les totaux et résumés (intégrés depuis main.js) */
.total-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
    border-left: 4px solid #004A22;
}

.total-summary label {
    font-weight: bold;
    color: #004A22;
}

.calculated-value {
    font-weight: bold;
    font-size: 1.1em;
    color: #B48500;
    margin-top: 5px;
}

/* Classe utilitaire pour éléments masqués */
.hidden {
    display: none;
}

/* Conteneurs responsifs pour tableaux */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* Styles responsive */
@media (min-width: 768px) {
    .total-summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .calculated-value {
        margin-top: 0;
        margin-left: 15px;
    }
}

/* Header : menu utilisateur et navigation */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-link {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #004A22;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.btn-link:hover {
    opacity: 0.6;
}

.main-nav {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.main-nav a {
    padding: 10px 20px;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    color: #004A22;
}

.main-nav a.active {
    color: #004A22;
    border-bottom-color: #004A22;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        margin: 0;
        width: auto;
    }
    
    header {
        padding: 15px 5px;
        margin-bottom: 20px;
        position: relative;
        text-align: center;
    }
    
    /* Correction du layout de l'en-tête */
    .logo-container {
        display: block;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .logo {
        max-height: 70px; /* Augmenter de 45px à 60px */
        margin-right: 0;
        display: inline-block;
        vertical-align: middle;
        margin-bottom: 10px; /* Ajouter un peu d'espace en bas */
    }
    
    .title-container {
        display: block;
        text-align: center;
        margin-top: 10px;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
        text-align: center;
    }
    
    /* Repositionnement du sélecteur de thème */
    .theme-selector {
        position: relative;
        width: 100%;
        max-width: 280px;
        margin: 10px auto 0;
        padding: 8px 10px;
        border-radius: 20px;
        background-color: #f8f8f8;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .theme-options {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .theme-option {
        flex: 1;
        text-align: center;
    }
    
    .theme-title {
        display: none; /* Masquer le titre du sélecteur sur mobile */
    }
    
    /* Style des onglets */
    .form-tabs {
        flex-direction: column;
        width: 100%;
        border-bottom: none;
    }
    
    .tab-btn {
        width: 100%;
        margin-bottom: 1px;
        margin-right: 0;
        border-radius: 0;
        text-align: center;
        padding: 12px 10px;
        border: 1px solid #ddd;
    }
    
    .tab-btn.active {
        border-bottom: 1px solid #ddd;
    }
    
    .tab-btn:first-child {
        border-radius: 8px 8px 0 0;
    }
    
    .tab-btn:last-child {
        border-radius: 0 0 8px 8px;
    }
    
    /* Optimisation des formulaires */
    .form-group {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 15px;
    }
    
    .form-group label {
        width: 100%;
        margin-bottom: 8px;
        padding-right: 0;
    }
    
    .form-group input[type="number"],
    .form-group input[type="text"] {
        width: 100%;
        padding: 12px;
    }
    
    .form-group small {
        margin-left: 0;
        width: 100%;
    }
    
    /* Checkbox alignement corrigé */
    .form-group.checkbox-group {
        flex-direction: row;
        align-items: center;
    }
    
    /* Boutons */
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-group button {
        width: 100%;
        padding: 14px;
    }
    
    /* Tableaux responsive */
    .results-table th,
    .results-table td {
        padding: 8px 6px;
        font-size: 14px;
    }
    
    .exoneration-table td, 
    .exoneration-table th {
        padding: 8px 6px;
        font-size: 14px;
    }
    
    /* Section résultats */
    .detail-btn {
        display: block;
        width: 100%;
        text-align: center;
    }
    
    /* Sections */
    section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .user-menu {
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }

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

    .table-responsive {
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding-bottom: 5px;
    }
}

/* Ajustements pour très petits écrans */
@media (max-width: 380px) {
    h1 {
        font-size: 1.6em;
    }
    
    .logo {
        max-height: 60px;
    }
    
    .tab-btn {
        font-size: 14px;
        padding: 10px 8px;
    }
    
    .form-group label {
        font-size: 15px;
    }
    
    .results-table th,
    .results-table td {
        font-size: 12px;
        padding: 6px 4px;
    }
}
/* Ajoutez ce code à la fin de vos fichiers CSS (styles.css et dynamic-bold.css) */

/* Permettre la césure des mots dans les en-têtes de colonne */
.results-table th {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    hyphens: auto;
}

/* Distribuer l'espace des colonnes de manière plus équilibrée */
.results-table {
    table-layout: fixed;
}

/* Définir des largeurs spécifiques pour chaque colonne */
.results-table th:nth-child(1), /* Colonne "Part" */
.results-table td:nth-child(1) {
    width: 25%;
}

.results-table th:nth-child(2), /* Colonne "TA sur SDPT" */
.results-table td:nth-child(2) {
    width: 25%;
}

.results-table th:nth-child(3), /* Colonne "TA sur aménagements" */
.results-table td:nth-child(3) {
    width: 25%;
    word-break: break-word;
}

.results-table th:nth-child(4), /* Colonne "Total TA" */
.results-table td:nth-child(4) {
    width: 25%;
}

/* Adaptation pour les écrans mobiles */
@media (max-width: 768px) {
    /* Permettre des cellules plus petites sur mobile */
    .results-table th,
    .results-table td {
        padding: 8px 5px;
        font-size: 13px;
    }
    
    /* Réduire davantage la largeur de la colonne problématique */
    .results-table th:nth-child(3),
    .results-table td:nth-child(3) {
        font-size: 12px;
        width: 22%;
    }
    
    /* Augmenter légèrement la largeur de la colonne des totaux */
    .results-table th:nth-child(4),
    .results-table td:nth-child(4) {
        width: 28%;
    }
}