/* Variables CSS pour les couleurs officielles françaises */
:root {
    --bleu-france: #000091;
    --blanc-france: #F5F5FE;
    --rouge-france: #E1000F;
    --gris-france: #9A9A9A;
    --gris-fonce: #666666;
    --navy: #1B2951;
}

/* Police Marianne pour tout le site */
body {
    font-family: 'Marianne', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gris-fonce);
    background-color: #fff;
    padding-top: 76px; /* Compensation pour navbar fixe */
}

/* Navbar personnalisée avec couleurs françaises */
.navbar {
    background: linear-gradient(135deg, var(--bleu-france) 0%, var(--navy) 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 145, 0.1);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: white !important;
}

.navbar-brand:hover {
    color: var(--blanc-france) !important;
}

.logo-img {
    filter: brightness(1.2);
}

/* Navigation links */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: white !important;
    background: linear-gradient(135deg, var(--rouge-france), #ff4757);
    box-shadow: 0 2px 8px rgba(225, 0, 15, 0.3);
}

.navbar-nav .nav-link i {
    font-size: 0.9rem;
}

/* Burger menu personnalisé */
.navbar-toggler {
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

/* Main content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Sections */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in;
    margin-bottom: 3rem;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section h2 {
    color: var(--bleu-france);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--rouge-france);
    position: relative;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--bleu-france);
}

/* Section content styling */
.section-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--bleu-france);
}

.section-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.section-content h3 {
    color: var(--bleu-france);
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.section-content ul {
    margin-bottom: 1.5rem;
}

.section-content li {
    margin-bottom: 0.5rem;
}

/* Styles pour les images dans les sections */
.image-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-frame {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%;
    width: fit-content;
}

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

.image-frame img {
    width: 100%;
    height: auto;
    max-width: 500px; /* Taille maximum sur desktop */
    min-width: 200px; /* Taille minimum pour éviter des images trop petites */
    display: block;
    object-fit: cover; /* Assurer un bon ratio d'aspect */
}

.image-caption {
    padding: 1rem;
    background: var(--blanc-france);
    color: var(--gris-fonce);
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
    border-top: 2px solid var(--bleu-france);
    line-height: 1.4;
}

/* Styles pour les articles dans les sections */
.article {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(245, 245, 254, 0.3);
    border-radius: 8px;
    border-left: 4px solid var(--rouge-france);
}

.article-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--bleu-france);
    margin-bottom: 1rem;
}

/* Styles pour les quote-box */
.quote-box {
    background: linear-gradient(135deg, rgba(0, 0, 145, 0.05), rgba(225, 0, 15, 0.05));
    border-left: 4px solid var(--rouge-france);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quote-box h5 {
    color: var(--bleu-france);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.quote-box p {
    margin-bottom: 0;
    font-style: italic;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--gris-fonce) 0%, var(--navy) 100%);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

/* Bouton de retour en haut */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bleu-france);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 145, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--rouge-france);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 0, 15, 0.4);
}

/* Modal de zoom d'image en plein écran */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: zoom-out;
    padding: 20px;
    box-sizing: border-box;
}

.image-zoom-modal.active {
    display: flex;
    animation: zoomModalFadeIn 0.3s ease-out;
}

.image-zoom-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-zoom-content {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    cursor: grab;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.image-zoom-content:active {
    cursor: grabbing;
}

.image-zoom-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--gris-fonce);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-zoom-close:hover {
    background: white;
    transform: scale(1.1);
    color: var(--rouge-france);
}

.image-zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.zoom-control-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zoom-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.zoom-control-btn:active {
    transform: scale(0.95);
}

.image-zoom-info {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 80%;
    text-align: center;
}

/* Animation d'entrée */
@keyframes zoomModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Indicateur de zoom pour les images */
.image-frame {
    position: relative;
    cursor: zoom-in;
}

.image-frame::after {
    content: '\F702'; /* Bootstrap icon zoom-in */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 145, 0.8);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-frame:hover::after {
    opacity: 1;
}

/* FAQ Section Styles - Optimisé pour mobile */
.faq-section {
    margin: 2rem 0;
}

.faq-item {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 145, 0.1);
    border: 1px solid rgba(0, 0, 145, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 145, 0.15);
    transform: translateY(-2px);
}

.faq-question {
    background: linear-gradient(135deg, var(--bleu-france), var(--navy));
    color: white;
    padding: 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.faq-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.faq-question:hover::before {
    left: 100%;
}

.faq-question:hover {
    background: linear-gradient(135deg, var(--navy), var(--bleu-france));
}

.faq-question span {
    flex: 1;
    margin-right: 1rem;
    line-height: 1.4;
}

.faq-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    background: var(--blanc-france);
    border-top: 2px solid var(--rouge-france);
    transition: all 0.3s ease;
    overflow: hidden;
}

.faq-answer.show {
    animation: slideDown 0.3s ease-out;
}

.faq-answer.collapsing {
    animation: slideUp 0.3s ease-in;
}

.faq-answer p {
    padding: 1.5rem;
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gris-fonce);
}

.faq-answer strong {
    color: var(--blanc-france);
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 200px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    to {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Boutons d'action pour FAQ */
.faq-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-faq {
    background: linear-gradient(135deg, var(--bleu-france), var(--navy));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-faq:hover {
    background: linear-gradient(135deg, var(--navy), var(--bleu-france));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 145, 0.3);
}

.btn-faq i {
    margin-right: 0.5rem;
}

/* Responsive Design - Optimisé pour mobile */

/* Navigation multi-lignes pour desktop */
@media (min-width: 992px) {
    .navbar-nav {
        flex-wrap: wrap;
        max-width: 100%;
        justify-content: center;
    }

    .navbar-nav .nav-item {
        flex: 0 0 auto;
        margin: 0.25rem 0.125rem;
    }

    .navbar-nav .nav-link {
        padding: 0.4rem 0.8rem !important;
        margin: 0;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* Ajuster la hauteur de la navbar pour accommoder 2 lignes */
    .navbar {
        min-height: auto;
        padding: 0.5rem 0;
    }

    .navbar-collapse {
        justify-content: center;
    }

    /* Ajuster le padding du body pour la navbar plus haute */
    body {
        padding-top: 90px;
    }
}

/* Pour les très grands écrans, permettre plus d'espace */
@media (min-width: 1400px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem !important;
        font-size: 1rem;
    }

    body {
        padding-top: 85px;
    }
}

@media (max-width: 768px) {
    .faq-question {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .faq-question span {
        margin-right: 0.75rem;
    }

    .faq-answer p {
        padding: 1.25rem;
        font-size: 0.95rem;
    }

    .faq-controls {
        flex-direction: column;
    }

    .btn-faq {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        text-align: center;
    }

    .faq-item:hover {
        transform: none; /* Désactiver le hover transform sur mobile */
    }
}

@media (max-width: 480px) {
    .faq-question {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    .faq-icon {
        font-size: 0.9rem;
    }

    .faq-answer p {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .btn-faq {
        padding: 1rem;
        font-size: 0.85rem;
    }
}

/* États actifs et focus pour l'accessibilité */
.faq-question:focus {
    outline: 3px solid var(--rouge-france);
    outline-offset: 2px;
}

.faq-question:active {
    transform: scale(0.98);
}

/* Animation de chargement */
.faq-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Indicateur de section */
.faq-section::before {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--bleu-france), var(--rouge-france));
    margin-bottom: 1.5rem;
    border-radius: 2px;
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .faq-item {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .faq-answer {
        background: #2a2a2a;
    }

    .faq-answer p {
        color: #e0e0e0;
    }
}
