/**
 * FAQ Accordion Styles
 * RevBridge AI Theme
 * 
 * Styles for accordion functionality in FAQ sections
 * Uses high specificity to avoid conflicts with other pages
 */

/* FAQ Section Base Styles - High Specificity */
.faq-accordion-wrapper .faq-section {
    position: relative;
}

.faq-section {
    padding: 5rem 0 !important;
    position: relative;
}

@media (min-width: 768px) {
    .faq-section {
        padding: 6rem 0 !important;
    }
}

.faq-accordion-wrapper .faq-section .faq-grid,
.faq-section .faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .faq-accordion-wrapper .faq-section .faq-grid,
    .faq-section .faq-grid {
        gap: 2.5rem;
    }
}

.faq-section .section-header {
    margin-bottom: 4rem !important;
}

@media (min-width: 768px) {
    .faq-section .section-header {
        margin-bottom: 5rem !important;
    }
}

/* Remove border-bottom from FAQ section and all child elements */
.faq-section,
.faq-section *,
.faq-section .container,
.faq-section .container *,
.faq-section .faq-grid,
.faq-section .faq-item,
.faq-section .faq-item * {
    border-bottom: none !important;
}

/* Remove any border-top that might appear as a line */
.faq-section::after,
.faq-section::before,
.faq-section .container::after,
.faq-section .container::before {
    display: none !important;
    content: none !important;
}

/* FAQ Item Styles */
.faq-section .faq-item {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

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

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

/* FAQ Header (Question) */
.faq-section .faq-header {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.faq-section .faq-question {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    flex: 1;
    padding-right: 1rem;
    line-height: 1.4;
}

/* FAQ Icon (Plus/Minus) */
.faq-section .faq-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border-radius: 50%;
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.faq-section .faq-item.active .faq-icon {
    background: var(--primary-color-dark);
    transform: rotate(45deg);
}

/* FAQ Content (Answer) */
.faq-section .faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-section .faq-answer {
    padding: 0 2rem 2rem 2rem;
    font-size: 1rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.faq-section .faq-item.active .faq-answer {
    opacity: 1;
    transform: translateY(0);
}

/* Focus Styles for Accessibility */
.faq-section .faq-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.faq-section .faq-item:focus .faq-question {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .faq-section .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .faq-section .faq-header {
        padding: 1.5rem;
    }
    
    .faq-section .faq-question {
        font-size: 1.125rem;
        padding-right: 0.75rem;
    }
    
    .faq-section .faq-answer {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }
    
    .faq-section .faq-icon {
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .faq-section .faq-header {
        padding: 1.25rem;
    }
    
    .faq-section .faq-question {
        font-size: 1rem;
    }
    
    .faq-section .faq-answer {
        padding: 0 1.25rem 1.25rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Animation for smooth accordion effect */
@keyframes accordionOpen {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 200px;
        opacity: 1;
    }
}

@keyframes accordionClose {
    from {
        max-height: 200px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

/* Hover effects for better UX */
.faq-section .faq-item:hover .faq-question {
    color: var(--primary-color);
}

.faq-section .faq-item:hover .faq-icon {
    background: var(--primary-color-dark);
    transform: scale(1.1);
}

.faq-section .faq-item.active:hover .faq-icon {
    transform: rotate(45deg) scale(1.1);
}

/* Loading state (if needed) */
.faq-section .faq-item.loading {
    pointer-events: none;
    opacity: 0.7;
}

.faq-section .faq-item.loading .faq-icon {
    animation: spin 1s linear infinite;
}

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