/* Unified FAQ Accordion Styles */
.faq-accordion-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .faq-accordion-container {
        padding: 0;
    }
    
    .faq-accordion-item {
        margin-bottom: 12px;
        border-radius: 8px;
    }
    
    .faq-accordion-header {
        padding: 14px;
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    .faq-question-badge {
        width: 28px;
        height: 28px;
        font-size: 12px;
        font-weight: 600;
        flex-shrink: 0;
    }
    
    .faq-question-text {
        font-size: 14px;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .faq-toggle-icon {
        width: 28px;
        height: 28px;
        font-size: 18px;
        flex-shrink: 0;
        margin-left: 8px;
    }
    
    .faq-answer-wrapper {
        padding: 14px;
        padding-left: 48px;
    }
    
    .faq-answer-label {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .faq-answer-text {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .faq-helpful {
        padding-top: 12px;
        margin-top: 12px;
    }
    
    .faq-helpful-text {
        font-size: 13px;
    }
    
    .faq-helpful-buttons {
        gap: 6px;
    }
    
    .faq-helpful-buttons button {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 0;
    }
    
    .faq-question-meta {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .faq-meta-item {
        font-size: 12px;
        margin-right: 12px;
    }
}

@media (max-width: 480px) {
    .faq-accordion-header {
        padding: 12px;
        gap: 8px;
    }
    
    .faq-question-badge {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .faq-question-text {
        font-size: 13px;
    }
    
    .faq-toggle-icon {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    .faq-answer-wrapper {
        padding: 12px;
        padding-left: 40px;
    }
}

.faq-accordion-item {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-accordion-header {
    background: #ffffff;
    padding: 20px 24px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.faq-accordion-header:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.faq-accordion-item.active .faq-accordion-header {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Question Badge */
.faq-question-badge {
    width: 40px;
    height: 40px;
    background: transparent;
    color: #000000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

/* Question Text */
.faq-question-text {
    flex: 1;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
}

/* Toggle Icon */
.faq-toggle-icon {
    width: 24px;
    height: 24px;
    color: #999;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 300;
}

.faq-toggle-icon::before {
    content: '+';
    display: block;
    transition: transform 0.3s ease;
}

.faq-accordion-item.active .faq-toggle-icon::before {
    content: '-';
    transform: rotate(0deg);
}

/* Answer Section */
.faq-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    border-top: none;
}

.faq-accordion-item.active .faq-accordion-content {
    max-height: 500px;
    transition: max-height 0.5s ease;
}

.faq-answer-wrapper {
    padding: 24px 24px 24px 80px;
}

.faq-answer-label {
    color: #000000;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-answer-text {
    color: #4a5568;
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .faq-accordion-header {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .faq-question-badge {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .faq-question-text {
        font-size: 15px;
    }
    
    .faq-answer-wrapper {
        padding: 20px 20px 20px 60px;
    }
    
    .faq-answer-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .faq-accordion-header {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .faq-question-badge {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .faq-question-text {
        font-size: 14px;
    }
    
    .faq-answer-wrapper {
        padding: 16px 16px 16px 52px;
    }
}

/* RTL Support */
[dir="rtl"] .faq-accordion-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .faq-answer-wrapper {
    padding: 24px 80px 24px 24px;
}

[dir="rtl"] .faq-toggle-icon {
    margin-left: 0;
    margin-right: auto;
}

@media (max-width: 768px) {
    [dir="rtl"] .faq-answer-wrapper {
        padding: 14px 48px 14px 14px;
    }
    
    [dir="rtl"] .faq-toggle-icon {
        margin-right: 8px;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .faq-answer-wrapper {
        padding: 12px 40px 12px 12px;
    }
}

/* Animation for smooth appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-accordion-item.active .faq-answer-wrapper {
    animation: fadeIn 0.3s ease;
}

/* Focus styles for accessibility */
.faq-accordion-header:focus {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* Hover effect on question text */
.faq-accordion-header:hover .faq-question-text {
    color: #000000;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .faq-accordion-header {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        touch-action: manipulation;
    }
    
    .faq-accordion-content {
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* Prevent text selection on tap */
    .faq-accordion-header * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Ensure proper height calculation */
    .faq-accordion-item.active .faq-accordion-content {
        max-height: 1000px;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .faq-accordion-header {
        min-height: 44px; /* Apple's minimum touch target */
        padding: 16px 20px;
    }
    
    .faq-toggle-icon {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}