/* ================================================
    Excel FAQ Updater — Accordion Styles
    All colors driven by CSS custom properties so
    every value is overridable from plugin settings.
    ================================================ */

/* --- Page / Section wrapper --- */
.faq-container {
    background-color: var(--efu-page-bg, #eef2f7);
    padding: 0;
    font-family: var(--efu-text-font, 'Poppins'), 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: var(--efu-text-weight, 400);
}

/* --- Section title --- */
.faq-title {
    text-align: center;
    color: var(--efu-heading-color, #1e3a5f);
    margin-bottom: 28px;
    font-size: 2rem;
    font-weight: var(--efu-heading-weight, 600);
    line-height: 1.2;
    font-family: var(--efu-heading-font, 'Segoe UI'), sans-serif;
}

/* --- Outer white card that wraps all items --- */
.efu-faq-wrapper {
    background-color: var(--efu-wrapper-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 0;
    max-width: 860px;
    margin: 0 auto;
}

/* --- Individual FAQ card --- */
details.efu-faq-item {
    background-color: var(--efu-bg-color, #ffffff) !important;
    border: 1px solid var(--efu-border-color, #d4e0ef) !important;
    border-radius: var(--efu-radius, 10px);
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}

details.efu-faq-item:last-child {
    margin-bottom: 0;
}

details.efu-faq-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

/* Open state — card gets accent border */
details.efu-faq-item[open] {
    border-color: var(--efu-accent-color, #2271b1);
}

/* --- Question / Summary row --- */
summary.efu-faq-question {
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--efu-question-color, #1e3a5f) !important;
    background-color: var(--efu-question-bg-color, #ffffff) !important;
    border-radius: var(--efu-radius, 10px);
    outline: none;
    transition: background-color 0.25s ease, color 0.25s ease;
    user-select: none;
}

/* Open question header — highlighted */
details.efu-faq-item[open]>summary.efu-faq-question {
    background-color: var(--efu-question-open-bg, #dbeafe) !important;
    color: var(--efu-question-open-color, #1e4d8c) !important;
    border-radius: var(--efu-radius, 10px) var(--efu-radius, 10px) 0 0;
}

/* Hide default marker */
summary.efu-faq-question::-webkit-details-marker {
    display: none;
}

summary::-webkit-details-marker {
    display: none;
}

/* --- Chevron icon (CSS border triangle) --- */
summary.efu-faq-question::after {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-right: 2.5px solid var(--efu-accent-color, #2271b1);
    border-bottom: 2.5px solid var(--efu-accent-color, #2271b1);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

details.efu-faq-item[open]>summary.efu-faq-question::after {
    transform: rotate(-135deg);
    border-color: var(--efu-accent-color, #2271b1);
}

/* --- Answer content --- */
.faq-content {
    padding: 16px 20px 20px;
    color: var(--efu-text-color, #ffffff) !important;
    background-color: var(--efu-answer-bg-color, #ffffff) !important;
    font-size: 0.95rem;
    line-height: 1.7;
    border-top: 1px solid var(--efu-border-color, #d4e0ef) !important;
    animation: efuFadeIn 0.3s ease-out;
}

@keyframes efuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================
   Theme: Dark
   ================================================ */
.efu-theme-dark .faq-container,
.efu-theme-dark.faq-container {
    background-color: var(--efu-page-bg, #111827);
}

.efu-theme-dark .faq-title {
    color: var(--efu-heading-color, #f3f4f6);
}

.efu-theme-dark .efu-faq-wrapper {
    background-color: var(--efu-wrapper-bg, #1f2937);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.efu-theme-dark details.efu-faq-item {
    background-color: var(--efu-bg-color, #1f2937);
    border-color: var(--efu-border-color, #374151);
}

.efu-theme-dark summary.efu-faq-question {
    color: var(--efu-question-color, #e5e7eb);
    background-color: var(--efu-question-bg-color, transparent);
}

.efu-theme-dark details.efu-faq-item[open]>summary.efu-faq-question {
    background-color: var(--efu-question-open-bg, #1e3a5a);
    color: var(--efu-question-open-color, #93c5fd);
}

.efu-theme-dark .faq-content {
    color: var(--efu-text-color, #9ca3af);
    border-top-color: var(--efu-border-color, #374151);
}

/* ================================================
   Theme: Website (inherits site styles)
   ================================================ */
.efu-theme-website .faq-title {
    color: inherit;
}

.efu-theme-website .efu-faq-wrapper {
    background-color: var(--efu-wrapper-bg, #f9f9f9);
    box-shadow: none;
    padding: 0;
}

.efu-theme-website details.efu-faq-item {
    background-color: var(--efu-bg-color, #ffffff);
    border-color: var(--efu-border-color, #e0e0e0);
}

.efu-theme-website summary.efu-faq-question {
    color: var(--efu-question-color, #333333);
    background-color: var(--efu-question-bg-color, #ffffff);
}

.efu-theme-website details.efu-faq-item[open]>summary.efu-faq-question {
    background-color: var(--efu-question-open-bg, rgba(34, 113, 177, 0.08));
}

.efu-theme-website .faq-content {
    color: var(--efu-text-color, #333333);
}