/**
 * FAQ Accordion Widget Styles
 * Modern, responsive design with smooth animations and accessibility support
 */

.faq-accordion-widget {
    position: relative;
    font-family: inherit;
}

/* FAQ Controls */
.faq-controls {
    margin-bottom: 20px;
    text-align: right;
}

.faq-expand-collapse {
    background: none;
    border: none;
    color: #007cba;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.faq-expand-collapse:hover {
    color: #005a87;
    background-color: rgba(0, 124, 186, 0.1);
    text-decoration: none;
}

.faq-expand-collapse:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* FAQ Container */
.faq-container {
    position: relative;
}

/* FAQ Items */
.faq-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
}

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

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-item.active {
    border-color: #007cba;
    box-shadow: 0 2px 12px rgba(0, 124, 186, 0.15);
}

/* FAQ Item Header */
.faq-item-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    background: #f8f9fa;
    border: none;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
}

.faq-item-header:hover {
    background: #e9ecef;
}

.faq-item-header:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.faq-item.active .faq-item-header {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
}

/* Icon positioning */
.faq-item-header.icon-left {
    flex-direction: row !important;
    gap: 15px;
}

.faq-item-header.icon-right {
    flex-direction: row-reverse !important;
    gap: 15px;
}

.faq-item-header.icon-right .faq-question {
    text-align: left;
    flex: 1;
}

.faq-item-header.icon-left .faq-question {
    flex: 1;
}

/* FAQ Question */
.faq-question {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    line-height: 1.4;
    flex: 1;
    transition: color 0.3s ease;
}

.faq-item-header:hover .faq-question {
    color: #007cba;
}

.faq-item.active .faq-question {
    color: #007cba;
}

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

.faq-icon i {
    transition: transform 0.3s ease;
}

.faq-item-header:hover .faq-icon {
    color: #007cba;
    transform: scale(1.1);
}

.faq-item.active .faq-icon {
    color: #007cba;
}

.faq-item.active .faq-icon i {
    transform: rotate(180deg);
}

/* FAQ Content */
.faq-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer {
    padding: 20px;
    color: #666666;
    line-height: 1.6;
    background: #ffffff;
    font-size: 16px;
}

.faq-answer p {
    margin: 0 0 15px 0;
}

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

.faq-answer ul,
.faq-answer ol {
    margin: 15px 0;
    padding-left: 20px;
}

.faq-answer li {
    margin-bottom: 8px;
}

.faq-answer a {
    color: #007cba;
    text-decoration: underline;
}

.faq-answer a:hover {
    color: #005a87;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Loading State */
.faq-accordion-widget.loading .faq-item-header {
    pointer-events: none;
    opacity: 0.7;
}

.faq-accordion-widget.loading .faq-icon i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .faq-item-header {
        padding: 16px;
        gap: 12px;
    }
    
    .faq-question {
        font-size: 16px;
    }
    
    .faq-answer {
        padding: 16px;
        font-size: 15px;
    }
    
    .faq-icon {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
    
    .faq-controls {
        text-align: center;
        margin-bottom: 16px;
    }
    
    .faq-expand-collapse {
        font-size: 13px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .faq-item {
        margin-bottom: 8px;
        border-radius: 6px;
    }
    
    .faq-item-header {
        padding: 14px;
        gap: 10px;
    }
    
    .faq-question {
        font-size: 15px;
    }
    
    .faq-answer {
        padding: 14px;
        font-size: 14px;
    }
    
    .faq-icon {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .faq-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .faq-item-header {
        background: #4a5568;
    }
    
    .faq-item-header:hover {
        background: #5a6578;
    }
    
    .faq-item.active .faq-item-header {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }
    
    .faq-question {
        color: #e2e8f0;
    }
    
    .faq-answer {
        background: #2d3748;
        color: #cbd5e0;
    }
    
    .faq-icon {
        color: #a0aec0;
    }
    
    .faq-expand-collapse {
        color: #63b3ed;
    }
    
    .faq-expand-collapse:hover {
        color: #90cdf4;
        background-color: rgba(99, 179, 237, 0.1);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .faq-item {
        border: 2px solid #000000;
    }
    
    .faq-item-header {
        border: 1px solid #000000;
    }
    
    .faq-question {
        color: #000000;
        font-weight: 700;
    }
    
    .faq-answer {
        color: #000000;
    }
    
    .faq-icon {
        color: #000000;
    }
    
    .faq-expand-collapse {
        color: #000000;
        border: 1px solid #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-item-header,
    .faq-question,
    .faq-icon,
    .faq-content,
    .faq-expand-collapse {
        transition: none;
    }
    
    .faq-icon i {
        transition: none;
    }
    
    .faq-item.active .faq-icon i {
        transform: none;
    }
    
    .faq-item {
        animation: none;
    }
    
    .faq-accordion-widget.loading .faq-icon i {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .faq-controls {
        display: none;
    }
    
    .faq-item {
        break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #000000;
    }
    
    .faq-content {
        display: block !important;
        max-height: none !important;
    }
    
    .faq-question {
        color: #000000;
        font-weight: bold;
    }
    
    .faq-answer {
        color: #000000;
    }
    
    .faq-icon {
        display: none;
    }
}

/* Focus Visible Support */
.faq-item-header:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.faq-expand-collapse:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Custom Scrollbar for Long Content */
.faq-answer::-webkit-scrollbar {
    width: 6px;
}

.faq-answer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.faq-answer::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.faq-answer::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Smooth Scrolling for Long FAQs */
.faq-accordion-widget {
    scroll-behavior: smooth;
}

/* Enhanced Visual States */
.faq-item-header:active {
    transform: translateY(1px);
}

.faq-expand-collapse:active {
    transform: translateY(1px);
}

/* Improved Typography */
.faq-question {
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

.faq-answer {
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

/* Enhanced Hover Effects */
.faq-item:hover .faq-item-header {
    transform: translateY(-1px);
}

.faq-item.active:hover .faq-item-header {
    transform: none;
}

/* Border Radius Adjustments for Active State */
.faq-item.active .faq-item-header {
    border-radius: 8px 8px 0 0;
}

.faq-item:not(.active) .faq-item-header {
    border-radius: 8px;
}

/* Subtle Gradient for Better Visual Hierarchy */
.faq-item-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
}

.faq-item-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.faq-item.active .faq-item-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}
