/* Smart FAQ Generator - Frontend Styles */

/* CSS Custom Properties for Easy Customization */
:root {
    --smart-faq-primary: #3b82f6;
    --smart-faq-bg: #ffffff;
    --smart-faq-border: #e5e7eb;
    --smart-faq-divider: #f3f4f6;
    --smart-faq-hover: #f9fafb;
    --smart-faq-focus: rgba(59, 130, 246, 0.05);
    --smart-faq-question-color: #1f2937;
    --smart-faq-answer-color: #4b5563;
    --smart-faq-answer-bg: #fafbfc;
    --smart-faq-icon: #6b7280;
    --smart-faq-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Base Styles */
.smart-faq-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 100%;
    margin: 2rem 0;
    line-height: 1.6;
}

.smart-faq-container * {
    box-sizing: border-box;
}

/* Modern Accordion Style */
.smart-faq-modern-accordion {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: var(--smart-faq-bg, #ffffff);
    border: 1px solid var(--smart-faq-border, #e5e7eb);
    margin-bottom: 1.5rem;
}

.smart-faq-modern-accordion .smart-faq-item {
    border-bottom: 1px solid var(--smart-faq-divider, #f3f4f6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.smart-faq-modern-accordion .smart-faq-item:last-child {
    border-bottom: none;
}

.smart-faq-modern-accordion .smart-faq-item:hover {
    background-color: var(--smart-faq-hover, #f9fafb);
    transform: translateY(-1px);
}

.smart-faq-modern-accordion .smart-faq-question {
    width: 100%;
    padding: 1.5rem 2rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--smart-faq-question-color, #1f2937);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.4;
    position: relative;
}

.smart-faq-modern-accordion .smart-faq-question:hover {
    color: var(--smart-faq-primary, #3b82f6);
    padding-left: 2.25rem;
}

.smart-faq-modern-accordion .smart-faq-question:focus {
    outline: 2px solid var(--smart-faq-primary, #3b82f6);
    outline-offset: -2px;
    background-color: var(--smart-faq-focus, rgba(59, 130, 246, 0.05));
}

.smart-faq-modern-accordion .faq-question-text {
    flex: 1;
    margin-right: 1rem;
}

.smart-faq-modern-accordion .faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--smart-faq-icon, #6b7280);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 24px;
    text-align: center;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smart-faq-modern-accordion .smart-faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
    color: var(--smart-faq-primary, #3b82f6);
}

.smart-faq-modern-accordion .smart-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    background: var(--smart-faq-answer-bg, #fafbfc);
    border-top: 1px solid var(--smart-faq-divider, #f3f4f6);
}

.smart-faq-modern-accordion .smart-faq-answer.active {
    opacity: 1;
}

.smart-faq-modern-accordion .faq-answer-content {
    padding: 1.5rem 2rem;
    color: var(--smart-faq-answer-color, #4b5563);
    line-height: 1.7;
    font-size: 1rem;
    background: var(--smart-faq-answer-bg, #fafbfc);
}

/* Cards Style */
.smart-faq-cards {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.smart-faq-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.smart-faq-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.smart-faq-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.smart-faq-card:hover::before {
    opacity: 1;
}

.faq-card-question {
    margin: 0 0 1.25rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
}

.faq-card-answer p {
    margin: 0;
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
}

/* Minimal Style */
.smart-faq-minimal {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f3f4f6;
    transition: all 0.3s ease;
}

.smart-faq-minimal:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.smart-faq-minimal:hover {
    padding-left: 1rem;
    border-bottom-color: #3b82f6;
}

.faq-minimal-question {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
    line-height: 1.4;
    position: relative;
}

.faq-minimal-question::before {
    content: 'Q:';
    position: absolute;
    left: -2rem;
    top: 0;
    color: #3b82f6;
    font-weight: 800;
    font-size: 1.1rem;
}

.faq-minimal-answer {
    margin: 0;
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
    padding-left: 1.5rem;
    border-left: 4px solid #3b82f6;
    position: relative;
}

.faq-minimal-answer::before {
    content: 'A:';
    position: absolute;
    left: -2rem;
    top: 0;
    color: #10b981;
    font-weight: 800;
    font-size: 1rem;
}

/* Classic Accordion Style */
.smart-faq-accordion {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.smart-faq-accordion .smart-faq-item {
    border-bottom: 1px solid #e5e7eb;
}

.smart-faq-accordion .smart-faq-item:last-child {
    border-bottom: none;
}

.smart-faq-accordion .smart-faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.smart-faq-accordion .smart-faq-question:hover {
    background-color: #f1f5f9;
    color: #1f2937;
}

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

.smart-faq-accordion .smart-faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.smart-faq-accordion .smart-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
    opacity: 0;
}

.smart-faq-accordion .smart-faq-answer.active {
    opacity: 1;
}

.smart-faq-accordion .smart-faq-answer div {
    padding: 1.25rem 1.5rem;
    color: #4b5563;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .smart-faq-container {
        margin: 1rem 0;
    }
    
    .smart-faq-modern-accordion .smart-faq-question,
    .smart-faq-modern-accordion .faq-answer-content {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .smart-faq-card {
        padding: 1.5rem;
    }
    
    .smart-faq-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .faq-minimal-question::before,
    .faq-minimal-answer::before {
        display: none;
    }
    
    .faq-minimal-question,
    .faq-minimal-answer {
        padding-left: 0;
    }
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-faq-container.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.smart-faq-item {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .smart-faq-container {
        color: #f9fafb;
    }
    
    .smart-faq-modern-accordion,
    .smart-faq-card,
    .smart-faq-accordion {
        background: #1f2937;
        border-color: #374151;
    }
    
    .smart-faq-modern-accordion .smart-faq-question,
    .smart-faq-card .faq-card-question,
    .faq-minimal-question {
        color: #f9fafb;
    }
    
    .smart-faq-modern-accordion .faq-answer-content,
    .smart-faq-card .faq-card-answer p,
    .faq-minimal-answer {
        color: #d1d5db;
    }
}

/* Loading States */
.smart-faq-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.smart-faq-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}