/* ===========================
   FAQ PAGE STYLES - CORRIGÉ
   =========================== */

/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #667EEA;
    --dark-blue: #3A4784;
    --yellow: #FFD700;
    --yellow-hover: #FFB300;
    --white: #FFFFFF;
    --text-light: rgba(255, 255, 255, 0.95);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===========================
   HEADER STYLES - FORCE LAYOUT
   Logo -> Langue -> Retour
   =========================== */
.header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(58, 71, 132, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 0 !important;
}

.logo {
    order: 1 !important;
    flex-shrink: 0;
    margin-right: 0 !important;
}

.logo a {
    text-decoration: none;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--yellow);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Styles du Sélecteur de Langue (Manquants auparavant) */
.faq-lang-selector {
    order: 2 !important;
    margin-left: 20px !important;
    margin-right: auto !important; /* Pousse le bouton retour à droite */
    position: relative;
    display: block !important;
}

.lang-dropdown-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
}

.lang-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.flag-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border-radius: 10px;
    padding: 8px;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lang-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.lang-option img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.lang-option span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Bouton Retour (Style corrigé "Pilule") */
.btn-back {
    order: 3 !important;
    margin-left: 0 !important;
    
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--white) !important;
    text-decoration: none;
    border-radius: 50px !important;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    font-size: 14px;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px);
}

/* ===========================
   FAQ SECTION
   =========================== */
.faq-section {
    padding: 140px 0 80px;
}

.faq-header {
    text-align: center;
    margin-bottom: 60px;
}

.faq-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
}

.faq-subtitle {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Bar */
.faq-search {
    max-width: 600px;
    margin: 0 auto 60px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 18px 50px 18px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--white);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    outline: none;
    border-color: var(--yellow);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
}

/* Category Tabs */
.faq-categories {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    justify-content: center; /* Centré par défaut */
}

.faq-categories::-webkit-scrollbar {
    height: 6px;
}

.faq-categories::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.faq-categories::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.category-btn {
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.category-btn.active {
    background: var(--yellow);
    color: #333;
    border-color: var(--yellow);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* FAQ Items */
.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-category-section {
    margin-bottom: 50px;
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--yellow);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    width: 36px;
    height: 36px;
    background: var(--yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: 700;
    flex-shrink: 0;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.faq-question {
    width: 100%;
    padding: 20px 60px 20px 25px;
    background: transparent;
    border: none;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--primary-blue);
}

.question-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.toggle-icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.toggle-icon::before,
.toggle-icon::after {
    content: '';
    position: absolute;
    background: var(--primary-blue);
    border-radius: 2px;
}

.toggle-icon::before {
    width: 20px;
    height: 3px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.toggle-icon::after {
    width: 3px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.faq-item.active .toggle-icon {
    transform: translateY(-50%) rotate(180deg);
}

.faq-item.active .toggle-icon::after {
    opacity: 0;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 25px 25px 68px;
}

.faq-answer p {
    color: #666;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer strong {
    color: #333;
    font-weight: 600;
}

.faq-answer ul {
    list-style: none;
    margin: 15px 0;
    padding-left: 0;
}

.faq-answer ul li {
    padding: 8px 0;
    color: #666;
    position: relative;
    padding-left: 25px;
}

.faq-answer ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: 700;
}

/* Contact CTA */
.faq-contact {
    margin-top: 80px;
    text-align: center;
    padding: 50px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.faq-contact h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
}

.faq-contact p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.contact-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: var(--yellow);
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.btn-contact:hover {
    background: var(--yellow-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-contact.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-contact.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}

.footer-copyright {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-copyright a {
    color: var(--yellow);
    text-decoration: none;
    font-weight: 600;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

/* ===========================
   RESPONSIVE
   =========================== */

/* Mobile Screens - up to 767px */
@media (max-width: 767px) {
    .faq-title {
        font-size: 32px;
    }

    .faq-subtitle {
        font-size: 16px;
    }

    .category-title {
        font-size: 22px;
    }

    .faq-question {
        font-size: 16px;
        padding: 18px 50px 18px 20px;
    }

    .question-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .faq-item.active .faq-answer {
        padding: 0 20px 20px 44px;
    }

    .faq-answer p {
        font-size: 15px;
    }

    .faq-contact {
        padding: 40px 20px;
    }

    .faq-contact h3 {
        font-size: 24px;
    }

    .contact-buttons {
        flex-direction: column;
    }

    .btn-contact {
        width: 100%;
        justify-content: center;
    }
    
    .faq-categories {
        justify-content: flex-start; /* Scroll sur mobile */
    }
}

/* Tablet Portrait - 768px exact */
@media (min-width: 768px) and (max-width: 768px) {
    .faq-categories {
        display: flex !important;
        overflow-x: scroll !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        width: 100%;
    }
    
    .category-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }
}

/* Mobile Screens - 480px and below */
@media (max-width: 480px) {
    .header {
        padding: 15px 0;
    }

    .logo h1 {
        font-size: 22px;
    }

    .faq-lang-selector {
        margin-left: 10px !important; /* Espace réduit */
    }

    .btn-back {
        padding: 8px 16px !important;
        font-size: 14px;
    }
    
    .btn-back span {
        display: none; /* Cache le texte "Retour" sur petit mobile */
    }

    .faq-section {
        padding: 120px 0 60px;
    }

    .faq-title {
        font-size: 28px;
    }

    .faq-categories {
        gap: 10px;
    }

    .category-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}