/**
 * Smart FAQ Generator - Frontend Styles
 * Version: 1.0.0
 */

/* FAQ Container Styles */
.smart-faq-accordion,
.smart-faq-list,
.smart-faq-toggle,
.smart-faq-tabs {
    margin: 20px 0;
    font-family: inherit;
    clear: both;
}

/* FAQ Item Styles */
.smart-faq-item {
    margin-bottom: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

/* FAQ Question Styles */
.smart-faq-question {
    background: #f8f9fa;
    padding: 15px 20px;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
}

.smart-faq-question:hover {
    background: #e9ecef;
}

.smart-faq-question h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-right: 40px;
    line-height: 1.4;
}

/* FAQ Answer Styles */
.smart-faq-answer {
    background: #fff;
    transition: all 0.3s ease;
    overflow: hidden;
}

.smart-faq-answer.collapse {
    max-height: 0;
    padding: 0 20px;
    opacity: 0;
}

.smart-faq-answer.collapse.show {
    max-height: 500px;
    padding: 20px;
    opacity: 1;
}

.smart-faq-answer-content {
    padding: 0;
}

.smart-faq-answer-content p {
    margin: 0 0 15px 0;
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

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

/* Toggle Icon Styles */
.smart-faq-toggle-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.smart-faq-toggle-icon::before {
    content: '+';
    font-size: 20px;
    font-weight: bold;
    color: #666;
    transition: transform 0.3s ease;
}

.smart-faq-question[aria-expanded="true"] .smart-faq-toggle-icon::before,
.smart-faq-item.active .smart-faq-toggle-icon::before {
    transform: rotate(45deg);
}

/* List Style Specific */
.smart-faq-list .smart-faq-item {
    border: none;
    border-bottom: 1px solid #e1e1e1;
    border-radius: 0;
    margin-bottom: 0;
}

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

.smart-faq-list .smart-faq-question {
    background: transparent;
    cursor: default;
    padding: 15px 0;
}

.smart-faq-list .smart-faq-question:hover {
    background: transparent;
}

.smart-faq-list .smart-faq-toggle-icon {
    display: none;
}

.smart-faq-list .smart-faq-answer {
    padding: 0 0 15px 0;
    background: transparent;
}

/* Toggle Style Specific */
.smart-faq-toggle .smart-faq-answer {
    display: none;
    padding: 20px;
    border-top: 1px solid #e1e1e1;
}

.smart-faq-toggle .smart-faq-answer.show {
    display: block;
}

/* Tabs Style Specific */
.smart-faq-tabs {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

.smart-faq-tab-nav {
    display: flex;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e1e1;
}

.smart-faq-tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-right: 1px solid #e1e1e1;
}

.smart-faq-tab-button:last-child {
    border-right: none;
}

.smart-faq-tab-button:hover {
    background: #e9ecef;
    color: #333;
}

.smart-faq-tab-button.active {
    background: #007cba;
    color: #fff;
}

.smart-faq-tab-content {
    position: relative;
}

.smart-faq-tab-pane {
    display: none;
    padding: 20px;
}

.smart-faq-tab-pane.active {
    display: block;
}

.smart-faq-tab-pane .smart-faq-question {
    background: transparent;
    cursor: default;
    padding: 0;
    margin-bottom: 15px;
}

.smart-faq-tab-pane .smart-faq-answer {
    background: transparent;
    padding: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .smart-faq-question {
        padding: 12px 15px;
    }
    
    .smart-faq-question h3 {
        font-size: 16px;
        padding-right: 35px;
    }
    
    .smart-faq-toggle-icon {
        right: 15px;
        width: 18px;
        height: 18px;
    }
    
    .smart-faq-toggle-icon::before {
        font-size: 18px;
    }
    
    .smart-faq-answer.collapse.show {
        padding: 15px;
    }
    
    .smart-faq-tab-nav {
        flex-direction: column;
    }
    
    .smart-faq-tab-button {
        border-right: none;
        border-bottom: 1px solid #e1e1e1;
    }
    
    .smart-faq-tab-button:last-child {
        border-bottom: none;
    }
    
    .smart-faq-tab-pane {
        padding: 15px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .smart-faq-item {
        border-color: #444;
        background: #2a2a2a;
    }
    
    .smart-faq-question {
        background: #333;
        color: #fff;
    }
    
    .smart-faq-question:hover {
        background: #3a3a3a;
    }
    
    .smart-faq-question h3 {
        color: #fff;
    }
    
    .smart-faq-answer {
        background: #2a2a2a;
    }
    
    .smart-faq-answer-content p {
        color: #ccc;
    }
    
    .smart-faq-toggle-icon::before {
        color: #ccc;
    }
    
    .smart-faq-tab-nav {
        background: #333;
        border-color: #444;
    }
    
    .smart-faq-tab-button {
        color: #ccc;
        border-color: #444;
    }
    
    .smart-faq-tab-button:hover {
        background: #3a3a3a;
        color: #fff;
    }
    
    .smart-faq-tab-button.active {
        background: #007cba;
        color: #fff;
    }
}

/* Animation Classes */
.smart-faq-fade-in {
    animation: smartFaqFadeIn 0.5s ease-in-out;
}

.smart-faq-slide-down {
    animation: smartFaqSlideDown 0.3s ease-in-out;
}

@keyframes smartFaqFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes smartFaqSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

/* Accessibility Improvements */
.smart-faq-question:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.smart-faq-tab-button:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

/* Print Styles */
@media print {
    .smart-faq-accordion,
    .smart-faq-toggle,
    .smart-faq-tabs {
        page-break-inside: avoid;
    }
    
    .smart-faq-item {
        border: 1px solid #000;
        margin-bottom: 10px;
        page-break-inside: avoid;
    }
    
    .smart-faq-question {
        background: #f0f0f0 !important;
        padding: 10px !important;
    }
    
    .smart-faq-answer {
        display: block !important;
        padding: 10px !important;
        max-height: none !important;
        opacity: 1 !important;
    }
    
    .smart-faq-toggle-icon {
        display: none !important;
    }
    
    .smart-faq-tab-nav {
        display: none !important;
    }
    
    .smart-faq-tab-pane {
        display: block !important;
        page-break-before: always;
    }
    
    .smart-faq-tab-pane:first-child {
        page-break-before: avoid;
    }
}

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

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

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

/* Error State */
.smart-faq-error {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

.smart-faq-error p {
    margin: 0;
}

/* Success State */
.smart-faq-success {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 10px 0;
}

.smart-faq-success p {
    margin: 0;
}