/**
 * Interactive French FAQ - Frontend Styles
 * Version: 1.0.0
 */

/* =============================================================================
   FAQ Container
   ============================================================================= */

.if-faq-container {
    max-width: 900px;
    margin: 40px auto;
}

.if-faq-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* =============================================================================
   FAQ Item
   ============================================================================= */

.if-faq-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.if-faq-item:hover {
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.1);
}

.if-faq-item.active {
    border-color: #1d4ed8;
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.15);
}

/* =============================================================================
   FAQ Question
   ============================================================================= */

.if-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.if-faq-question:hover {
    background-color: #f9fafb;
}

.if-faq-item.active .if-faq-question {
    background-color: #eff6ff;
    border-bottom: 1px solid #e5e7eb;
}

.if-faq-question-text {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    line-height: 1.5;
    padding-right: 20px;
}

/* Category Badge */
.if-faq-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 12px;
    font-weight: 500;
}

/* Toggle Icon */
.if-faq-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1d4ed8;
    border-radius: 50%;
    color: white;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.if-faq-question:hover .if-faq-toggle {
    background: #1e40af;
    transform: scale(1.1);
}

.if-faq-item.active .if-faq-toggle {
    transform: rotate(180deg);
}

.if-faq-icon-open,
.if-faq-icon-close {
    transition: opacity 0.2s ease;
}

/* =============================================================================
   FAQ Answer
   ============================================================================= */

.if-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.if-faq-item.active .if-faq-answer {
    max-height: 2000px; /* Adjust based on content */
}

.if-faq-answer-content {
    padding: 24px;
    color: #374151;
    font-size: 16px;
    line-height: 1.8;
}

.if-faq-answer-content p {
    margin-bottom: 16px;
}

.if-faq-answer-content p:last-child {
    margin-bottom: 0;
}

.if-faq-answer-content ul,
.if-faq-answer-content ol {
    margin: 16px 0;
    padding-left: 24px;
    list-style-position: outside;
}

.if-faq-answer-content ul {
    list-style-type: disc;
}

.if-faq-answer-content ol {
    list-style-type: decimal;
}

.if-faq-answer-content li {
    margin-bottom: 8px;
    display: list-item;
}

.if-faq-answer-content a {
    color: #1d4ed8;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.if-faq-answer-content a:hover {
    color: #1e40af;
}

.if-faq-answer-content strong {
    color: #111827;
    font-weight: 600;
}

/* =============================================================================
   List Style (Alternative to Accordion)
   ============================================================================= */

.if-faq-container[data-style="list"] .if-faq-item {
    margin-bottom: 24px;
}

.if-faq-container[data-style="list"] .if-faq-question {
    cursor: default;
    padding-bottom: 16px;
}

.if-faq-container[data-style="list"] .if-faq-toggle {
    display: none;
}

.if-faq-container[data-style="list"] .if-faq-answer {
    max-height: none;
}

.if-faq-container[data-style="list"] .if-faq-question {
    border-bottom: 2px solid #1d4ed8;
}

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media (max-width: 768px) {
    .if-faq-container {
        margin: 20px 16px;
    }
    
    .if-faq-question {
        padding: 16px 18px;
    }
    
    .if-faq-question-text {
        font-size: 16px;
        padding-right: 12px;
    }
    
    .if-faq-category-badge {
        display: block;
        margin: 8px 0 0 0;
        width: fit-content;
    }
    
    .if-faq-toggle {
        width: 28px;
        height: 28px;
    }
    
    .if-faq-answer-content {
        padding: 18px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .if-faq-question {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .if-faq-toggle {
        position: absolute;
        top: 16px;
        right: 18px;
    }
    
    .if-faq-question-text {
        padding-right: 40px;
    }
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .if-faq-item {
        page-break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 20px;
    }
    
    .if-faq-toggle {
        display: none;
    }
    
    .if-faq-answer {
        max-height: none !important;
    }
    
    .if-faq-category-badge {
        border: 1px solid #000;
        color: #000;
        background: transparent;
    }
}

/* =============================================================================
   Accessibility Enhancements
   ============================================================================= */

.if-faq-question:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

.if-faq-item.active .if-faq-question {
    /* Visual indicator for screen readers */
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .if-faq-item,
    .if-faq-question,
    .if-faq-toggle,
    .if-faq-answer {
        transition: none;
    }
}
