/*
 * Style for Dynamic FAQ Plugin
 */

.dynamic-faq-section {
    margin-top: 30px;
}

/* Style for the main FAQ title */
.dynamic-faq-section h2.dfaq-main-title,
.dynamic-faq-section h3.dfaq-main-title,
.dynamic-faq-section h4.dfaq-main-title,
.dynamic-faq-section h5.dfaq-main-title,
.dynamic-faq-section h6.dfaq-main-title {
    font-size: var(--dfaq-title-font-size, 18px); /* Using the same font size variable for consistency */
    margin-bottom: 20px;
    color: var(--dfaq-main-faq-title-text-color, #333333);
    text-align: var(--dfaq-text-alignment, right);
}

.dynamic-faq-accordion {
    border-radius: var(--dfaq-border-radius, 8px);
    overflow: hidden;
    background-color: var(--dfaq-background-color, #f7f7f7); /* Overall accordion background */
    padding: 10px;
}

.faq-item {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: var(--dfaq-border-radius, 8px);
    overflow: hidden;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-question {
    width: 100%;
    padding: 15px;
    /* Default (closed) background and text color of the button */
    background-color: var(--dfaq-question-bg-closed, #ffffff);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease; /* Only background transition for the button itself */
}

/* Style for the heading text INSIDE the button */
.faq-question-heading {
    font-size: var(--dfaq-title-font-size, 18px); /* Font size for question text */
    color: var(--dfaq-question-text-color-closed, #333333); /* Text color for question title when closed */
    text-align: var(--dfaq-text-alignment, right);
    flex-grow: 1; /* Allows the text to take available space */
    transition: color 0.3s ease; /* Text color transition */
    font-weight: var(--dfaq-question-font-weight, bold); /* */
}


.faq-question:after {
    content: '+';
    font-size: 20px;
    font-weight: bold;
    color: var(--dfaq-question-text-color-closed, #333333); /* Icon color matches text color */
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Hover styles for closed questions */
.faq-question:not(.active):hover {
    background-color: var(--dfaq-question-bg-closed_hover, #f0f0f0);
}

.faq-question:not(.active):hover .faq-question-heading {
    color: var(--dfaq-question-text-color_closed_hover, #000000); /* Text color on hover (closed) */
}

.faq-question:not(.active):hover:after {
    color: var(--dfaq-question-text-color_closed_hover, #000000); /* Icon color on hover (closed) */
}


/* Styles when question is active (open) */
.faq-question.active {
    background-color: var(--dfaq-question-bg-open, #e0e0e0);
}

.faq-question.active .faq-question-heading {
    color: var(--dfaq-question-text-color-open, #333333); /* Text color when open */
}

/* Hover styles for open questions */
.faq-question.active:hover {
    background-color: var(--dfaq-question-bg_open_hover, #d0d0d0);
}

.faq-question.active:hover .faq-question-heading {
    color: var(--dfaq-question-text-color_open_hover, #000000); /* Text color on hover (open) */
}

.faq-question.active:after {
    content: '-';
    transform: rotate(180deg);
    color: var(--dfaq-question-text-color-open, #333333); /* Icon color when open */
}

.faq-question.active:hover:after {
    color: var(--dfaq-question-text-color_open_hover, #000000); /* Icon color on hover (open) */
}


.faq-answer-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.faq-answer-container.show {
    /* این مقدار را حذف کنید، چون max-height توسط جاوا اسکریپت مدیریت می‌شود */
}

.faq-answer {
    padding: 15px;
    background-color: #fcfcfc; /* You can make this configurable if needed */
    margin: 0;
    font-size: var(--dfaq-answer-font-size, 16px);
    line-height: 1.6;
    color: var(--dfaq-answer-text-color, #444444); /* Normal text color for answer */
    text-align: var(--dfaq-text-alignment, right);
    transition: color 0.3s ease;
    font-weight: var(--dfaq-answer-font-weight, normal); /* */
}

/* Hover styles for answer text (less common for static text, but added for completeness) */
.faq-answer:hover {
    color: var(--dfaq-answer-text-color-hover, #000000); /* Hover text color for answer */
}