/* FAQ Section Enhanced Styles */

/* Main section styling */
#faq {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    overflow: hidden;
    padding-bottom: 3rem !important;
}

/* Floating background elements */
.faq-float-element {
    position: absolute;
    opacity: 0.6;
    animation: faqFloat 15s ease-in-out infinite;
    z-index: 0;
}

.faq-float-element:nth-child(1) {
    top: 10%;
    left: 5%;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    border-radius: 50%;
    animation-delay: 0s;
}

.faq-float-element:nth-child(2) {
    top: 20%;
    right: 10%;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: 50%;
    animation-delay: -5s;
}

.faq-float-element:nth-child(3) {
    bottom: 30%;
    left: 8%;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #ec4899, #f59e0b);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation-delay: -10s;
}

.faq-float-element:nth-child(4) {
    bottom: 15%;
    right: 5%;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
    animation-delay: -7s;
}

@keyframes faqFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
    75% { transform: translateY(-30px) rotate(270deg); }
}

/* Enhanced container */
.faq-container {
    position: relative;
    z-index: 10;
}

/* Section title enhancement */
.faq-section-title {
    position: relative;
    z-index: 10;
}

.faq-highlight-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.faq-highlight-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    animation: faqTitleUnderline 2s ease-in-out infinite alternate;
}

@keyframes faqTitleUnderline {
    0% { transform: scaleX(0.8); opacity: 0.7; }
    100% { transform: scaleX(1); opacity: 1; }
}

/* Enhanced FAQ container with glass morphism */
.faq-main-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.faq-main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

/* Enhanced category tabs */
.faq-categories-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.faq-categories-container::-webkit-scrollbar {
    display: none;
}

.faq-category-btn {
    position: relative;
    color: #64748b;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1;
}

.faq-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    margin: 4px;
}

.faq-category-btn:hover::before {
    opacity: 1;
}

.faq-category-btn:hover {
    color: #4f46e5;
    transform: translateY(-1px);
}

.faq-category-btn.active {
    color: #4f46e5;
    font-weight: 600;
}

.faq-category-btn.active::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
}

.faq-category-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 2px 2px 0 0;
    animation: faqTabIndicator 0.3s ease-out;
}

@keyframes faqTabIndicator {
    0% { width: 0%; opacity: 0; }
    100% { width: 80%; opacity: 1; }
}

/* Enhanced FAQ content area */
.faq-content-area {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
}

/* FAQ item enhanced styling */
.faq-item {
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: faqItemSlideIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes faqItemSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced question button */
.faq-question-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.05),
        0 0 20px rgba(99, 102, 241, 0.02);
    position: relative;
    overflow: hidden;
}

.faq-question-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.faq-question-btn:hover::before {
    left: 100%;
}

.faq-question-btn:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.faq-question-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 0 40px rgba(99, 102, 241, 0.15);
}

/* Question icon enhancement */
.faq-question-icon {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4f46e5;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.faq-question-btn:hover .faq-question-icon {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

/* Toggle icon enhancement */
.faq-toggle-icon {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #64748b;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.faq-question-btn:hover .faq-toggle-icon {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4f46e5;
    transform: scale(1.1);
}

.faq-question-btn.active .faq-toggle-icon {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    transform: rotate(45deg) scale(1.1);
}

/* Enhanced answer styling */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    padding: 0 1rem;
}

.faq-answer.show {
    max-height: 800px;
    opacity: 1;
    padding: 1.5rem 1rem 1rem;
}

.faq-answer-content {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
    padding: 1.5rem;
    border-radius: 16px;
    border-left: 4px solid transparent;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Category-specific answer styling */
.faq-content-group[data-group="getting-started"] .faq-answer-content {
    border-left-color: #4f46e5;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.faq-content-group[data-group="features"] .faq-answer-content {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.02) 100%);
}

.faq-content-group[data-group="security"] .faq-answer-content {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.faq-content-group[data-group="billing"] .faq-answer-content {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(168, 85, 247, 0.02) 100%);
}

/* Enhanced answer text */
.faq-answer-text {
    color: #374151;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.faq-answer-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.faq-answer-list li {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    position: relative;
}

.faq-answer-list li::marker {
    color: #4f46e5;
    font-weight: bold;
}

/* Search functionality */
.faq-search-container {
    margin-bottom: 2rem;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.faq-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.faq-search-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(79, 70, 229, 0.2);
}

.faq-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.25rem;
}

/* Contact CTA enhancement */
.faq-contact-cta {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 16px;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 24px rgba(79, 70, 229, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.faq-contact-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.faq-contact-cta:hover::before {
    left: 100%;
}

.faq-contact-cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(79, 70, 229, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.15);
}

.faq-contact-cta:active {
    transform: translateY(-1px) scale(1.01);
}

/* Content group transitions */
.faq-content-group {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-content-group.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.faq-content-group.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Ensure the first group shows by default */
.faq-content-group.active.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Quick stats in answers */
.faq-stat-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    margin: 0 0.25rem;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(146, 64, 14, 0.1);
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .faq-content-area {
        padding: 1.5rem 1rem;
    }
    
    .faq-question-btn {
        padding: 1rem;
    }
    
    .faq-question-icon {
        width: 2rem;
        height: 2rem;
        margin-right: 0.75rem;
    }
    
    .faq-toggle-icon {
        width: 1.5rem;
        height: 1.5rem;
        margin-left: 0.5rem;
    }
    
    .faq-answer-content {
        padding: 1rem;
    }
    
    .faq-categories-container {
        padding: 0.5rem 0;
    }
    
    .faq-category-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .faq-question-btn {
        padding: 0.875rem;
        border-radius: 12px;
    }
    
    .faq-answer-content {
        border-radius: 12px;
    }
    
    .faq-main-container {
        border-radius: 16px;
    }
}

/* Loading animation for FAQ items */
.faq-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.faq-item.loading .faq-question-btn {
    position: relative;
    overflow: hidden;
}

.faq-item.loading .faq-question-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    animation: faqLoading 1.5s infinite;
}

@keyframes faqLoading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced accessibility */
.faq-question-btn:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.faq-category-btn:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    .faq-float-element,
    .faq-categories-container {
        display: none;
    }
    
    .faq-answer {
        max-height: none !important;
        opacity: 1 !important;
        padding: 1rem !important;
    }
    
    .faq-question-btn {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
