/**
 * Gorillah FAQ - Frontend Accordion Styles
 */

/* Accordion Container */
.gorillah-faq-accordion {
    width: 100%;
}

/* FAQ Item */
.gorillah-faq-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
}

.gorillah-faq-item:last-child {
    margin-bottom: 0;
}

/* Question/Title */
.gorillah-faq-question {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 15px 20px;
    margin: 0;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
}

.gorillah-faq-question:hover {
    background: #e9ecef;
}

.gorillah-faq-question:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

.gorillah-faq-question.active {
    background: #e9ecef;
}

/* Question Text */
.gorillah-faq-question-text {
    flex: 1;
    text-align: left;
    font-weight: 500;
    line-height: 1.4;
}

/* Icon positioning */
.gorillah-faq-icon-left .gorillah-faq-icon {
    order: -1;
    margin-right: 10px;
}

.gorillah-faq-icon-right .gorillah-faq-icon {
    order: 1;
    margin-left: 10px;
}

/* Icon display states */
.gorillah-faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.gorillah-faq-icon-closed,
.gorillah-faq-icon-opened {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gorillah-faq-icon-opened {
    display: none;
}

.gorillah-faq-question.active .gorillah-faq-icon-closed {
    display: none;
}

.gorillah-faq-question.active .gorillah-faq-icon-opened {
    display: flex;
}

/* Answer/Content */
.gorillah-faq-answer {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: none;
    animation: gorillah-fade-in 0.3s ease;
}

.gorillah-faq-answer.active {
    display: block;
}

.gorillah-faq-answer[hidden] {
    display: none;
}

.gorillah-faq-answer>*:first-child {
    margin-top: 0;
}

.gorillah-faq-answer>*:last-child {
    margin-bottom: 0;
}

/* Animation */
@keyframes gorillah-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gorillah-faq-question {
        padding: 12px 15px;
    }

    .gorillah-faq-answer {
        padding: 12px 15px;
    }

    .gorillah-faq-question-text {
        font-size: 14px;
    }
}

/* Elementor Editor Styling */
.elementor-editor-active .gorillah-faq-accordion {
    pointer-events: auto;
}

.elementor-editor-active .gorillah-faq-answer {
    display: block;
    max-height: none;
}

.elementor-editor-active .gorillah-faq-item:not(:first-child) .gorillah-faq-answer {
    display: none;
}

/* Print styles */
@media print {
    .gorillah-faq-accordion .gorillah-faq-answer {
        display: block !important;
    }

    .gorillah-faq-icon {
        display: none !important;
    }
}