/* Smart FAQ Manager — Frontend Styles */

.sfm-faq-section {
    margin: 48px 0 32px;
    font-family: inherit;
}

.sfm-faq-title {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    color: #1a202c;
}

.sfm-faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

/* FAQ Item */
.sfm-faq-item {
    border-bottom: 1px solid #e2e8f0;
}

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

/* Question Button */
.sfm-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 18px 22px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.5;
    gap: 16px;
    transition: background 0.15s;
}

.sfm-faq-question:hover {
    background: #f7fafc;
}

.sfm-faq-item.open .sfm-faq-question {
    background: #f0f7ff;
    color: #1a56db;
}

/* Plus/Minus Icon */
.sfm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e0;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s, background 0.2s, transform 0.25s;
}

.sfm-icon::before,
.sfm-icon::after {
    content: '';
    position: absolute;
    background: #718096;
    border-radius: 2px;
    transition: background 0.2s, transform 0.25s, opacity 0.25s;
}

/* Horizontal bar */
.sfm-icon::before {
    width: 10px;
    height: 2px;
}

/* Vertical bar */
.sfm-icon::after {
    width: 2px;
    height: 10px;
}

/* Open state */
.sfm-faq-item.open .sfm-icon {
    background: #1a56db;
    border-color: #1a56db;
    transform: rotate(45deg);
}

.sfm-faq-item.open .sfm-icon::before,
.sfm-faq-item.open .sfm-icon::after {
    background: #fff;
}

/* Answer */
.sfm-faq-answer {
    overflow: hidden;
}

.sfm-faq-answer[hidden] {
    display: none;
}

.sfm-faq-answer-inner {
    padding: 4px 22px 22px;
    color: #4a5568;
    font-size: 0.95em;
    line-height: 1.75;
    border-top: 1px solid #e2e8f0;
}

.sfm-faq-answer-inner p:first-child {
    margin-top: 14px;
}

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

/* Animation */
@keyframes sfm-slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sfm-faq-answer:not([hidden]) .sfm-faq-answer-inner {
    animation: sfm-slide-down 0.2s ease-out;
}

/* Responsive */
@media (max-width: 600px) {
    .sfm-faq-question {
        padding: 14px 16px;
        font-size: 0.95em;
    }

    .sfm-faq-answer-inner {
        padding: 4px 16px 18px;
        font-size: 0.9em;
    }

    .sfm-faq-title {
        font-size: 1.3em;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sfm-faq-accordion {
        border-color: #2d3748;
    }

    .sfm-faq-item {
        border-bottom-color: #2d3748;
    }

    .sfm-faq-question {
        background: #1a202c;
        color: #e2e8f0;
    }

    .sfm-faq-question:hover {
        background: #2d3748;
    }

    .sfm-faq-item.open .sfm-faq-question {
        background: #1e3a5f;
        color: #63b3ed;
    }

    .sfm-faq-answer-inner {
        color: #a0aec0;
        border-top-color: #2d3748;
    }

    .sfm-icon {
        border-color: #4a5568;
    }

    .sfm-icon::before,
    .sfm-icon::after {
        background: #a0aec0;
    }

    .sfm-faq-title {
        color: #e2e8f0;
        border-bottom-color: #2d3748;
    }
}
