/* Variables pour une maintenance facile et un look "Aéro" */

:root {
    --primary-blue: #1a3c5e;
    --accent-gold: #d4af37; /* Le doré pour le liseré */
    --sky-blue: #f8fbff;
    --text-dark: #2d3436;
    --white: #d5d5d8;
    --gray-steel: #999ea1;
    --header-bg: #2c3e50;
}

html, body { height: 100%; margin: 0; }
body { display: flex; flex-direction: column; font-family: 'Segoe UI', sans-serif; background-color: #f4f7f6; }

/* --- Header : Logo à gauche et Titre aligné --- */
header {
    background-color: var(--header-bg);
    color: var(--white);
    /* Augmentation du padding vertical pour l'espace haut/bas */
    padding: 20px 20px; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
    /* Ajout du liseré doré en bas du header */
    border-bottom: 3px solid var(--accent-gold); 
}

.logo {
    /* Gestion de la taille et de l'espacement interne du logo */
    height: 40px; 
    width: auto;
    position: absolute;
    left: 25px;
    /* Le padding ici crée l'espace interne si le SVG est collé aux bords */
    padding: 5px 0; 
}

header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
}

h2 {
    text-align: center; /* Centre tous les <h2> de l'application */
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
}

/* --- Container & Grille --- */
.container { flex: 1; padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.card { 
    background: var(--white); 
    border-radius: 12px; 
    padding: 1.5rem; 
    margin-bottom: 1.5rem; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}

/* --- Boutons : Correction des liens vers aspect bouton --- */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn.secondary { /* Correspond au HTML <a class="btn secondary"> */
    background-color: var(--gray-steel);
    color: var(--text-dark);
}

.btn:hover { filter: brightness(0.9); transform: translateY(-1px); }

/* --- Grille Pilotes --- */
.pilot-grid {
    display: flex; /* Passage en flex pour faciliter le centrage des éléments */
    flex-wrap: wrap;
    justify-content: center; /* Centre les cartes pilotes horizontalement */
    gap: 15px;
    margin-top: 20px;
}

/* --- Grille Administration centrée --- */
.admin-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pilot-card {
    background: var(--sky-blue);
    border: 2px solid var(--primary-blue);
    padding: 20px 15px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: bold;
    min-width: 130px;
    transition: transform 0.2s;
}
.pilot-card:hover {
    transform: scale(1.05);
}

/* --- Mise en forme des Formulaires --- */
.form-container, .container-mobile {
    max-width: 600px;
    margin: 20px auto;
    width: 95%;
}

.aero-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Stylisation des labels */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-blue);
}

/* Stylisation des champs (input, select, textarea) */
.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-steel);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}
/* On cible spécifiquement les checkboxes pour qu'elles ne prennent pas 100% de largeur */
.form-group input[type="checkbox"] {
    width: auto;         /* Annule le width 100% */
    margin-right: 10px;  /* Espace entre la case et le texte */
    cursor: pointer;
    transform: scale(1.2); /* Rend la case un peu plus grosse pour le tactile */
    vertical-align: middle;
}

/* Alignement du label quand il accompagne une checkbox */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-blue);
}

/* Optionnel : si vous voulez que le label et la case soient sur la même ligne */
.form-group:has(input[type="checkbox"]) {
    display: flex;
    flex-direction: row-reverse; /* Met la case à gauche du texte */
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.form-group:has(input[type="checkbox"]) label {
    margin-bottom: 0; /* Aligne verticalement avec la case */
}


.form-group input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.2);
}

/* Boutons spéciaux pour le profil */
.btn-edit-profile {
    background-color: var(--accent-gold);
    color: var(--primary-blue);
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.1);
}

.btn-edit-profile:hover {
    background-color: #c5a028;
}

/* Gestion des erreurs Django */
.error-tag {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Alignement des boutons d'action */
.form-actions, .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* --- Styles pour choix_avion.html --- */

.section-title {
    margin: 0;
}

.pilot-info {
    color: var(--text-dark);
}

/* Style pour la carte "Autre / Extérieur" */
.card-external {
    border-style: dashed !important;
    background-color: #f0f8ff !important;
}

/* Espacement pour le bouton de retour en bas de carte */
.card .form-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.btn-secondary {
    background-color: var(--gray-steel);
    color: var(--text-dark);
    font-size: 0.9rem;
}

.vols-liste {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vol-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--gray-steel);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.2s;
}

.vol-item:hover {
    border-color: var(--accent-gold);
    transform: translateX(5px);
}

.vol-duree {
    font-weight: bold;
    color: var(--primary-blue);
}

.vol-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}
.detail-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-steel);
    text-transform: uppercase;
    font-weight: bold;
}
.detail-group p {
    margin: 5px 0 0 0;
    font-size: 1.1rem;
    color: var(--primary-blue);
}
.highlight-text {
    font-size: 1.4rem !important;
    font-weight: bold;
    color: var(--accent-gold) !important;
}
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}
.badge-success { 
    background: #e6fffa; 
    color: #2ecc71; 
    border: 1px solid #2ecc71; 
}
.badge-warning { 
    background: #fffaf0; 
    color: #f39c12; 
    border: 1px solid #f39c12; }
.observations-box {
    background: var(--sky-blue);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.alert-warning-aero {
    background-color: #ffeaa7; 
    color: #d63031; 
    padding: 10px; 
    border-radius: 5px; 
    margin-bottom: 10px; 
    border-left: 5px solid #d63031;
}
.alert-danger-aero {
    background-color: #ffeaa7; 
    color: #e17055; 
    padding: 10px; 
    border-radius: 5px; 
    margin-bottom: 10px; 
    border-left: 5px solid #e17055;
}

/* --- Historique des Corrections Réglementaires --- */
.history-card {
    margin-top: 20px;
    border-left: 4px solid #e74c3c;
    background-color: #fff5f5;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.history-title {
    font-size: 1rem;
    color: #c0392b;
    margin-top: 0;
    margin-bottom: 15px;
}

.history-list {
    font-size: 0.9rem;
    padding-left: 0;
    margin-bottom: 0;
    list-style-type: none;
}

.history-item {
    margin-bottom: 15px;
    border-bottom: 1px dashed #fab1a0;
    padding-bottom: 10px;
}

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

.history-content {
    color: #2c3e50;
    font-family: sans-serif;
    line-height: 1.5;
    display: block;
    margin-top: 8px;
}

/* --- Styles pour l'annulation de vol (Soft Delete) --- */
.card-danger {
    border-top: 4px solid #d63031;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 25px;
    background: white;
    border-radius: 8px;
}
.cancel-title {
    color: #c0392b;
    margin-top: 0;
    font-size: 1.4rem;
}
.cancel-text {
    color: #2c3e50;
}
.impact-box {
    background-color: #fff5f5;
    border-left: 4px solid #e74c3c;
    padding: 10px 15px;
    margin: 15px 0;
    font-size: 0.9rem;
    color: #c0392b;
}
.separator-light {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}
.form-label-bold {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}
.textarea-custom {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    font-family: inherit;
    box-sizing: border-box;
}
.flex-actions-end {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.btn-cancel-back {
    background: #95a5a6;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    line-height: 1.5;
}
.btn-danger-aero {
    background-color: #d63031;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-danger-aero:hover {
    background-color: #c0392b;
}

/* --- Footer --- */
footer { background-color: #2c3e50; color: var(--gray-steel); text-align: center; padding: 15px; font-size: 0.8rem; }
