/* Custom styles for FAQ section to ensure proper coloring and behavior */

/* FAQ Tab styling */
#faqCategoryPills .nav-link {
    color: #ef5744 !important;
    border: none;
    background: transparent;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 5px;
    margin: 0 5px 10px 0;
}

#faqCategoryPills .nav-link.active {
    background-color: #ef5744 !important;
    color: #ffffff !important;
}

/* FAQ Accordion styling */
.faq-accordion .accordion-button {
    background: transparent;
    box-shadow: none;
    color: #000000;
    font-weight: 500;
}

.faq-accordion .accordion-button:not(.collapsed) {
    background-color: transparent !important;
    color: #ef5744 !important;
    box-shadow: none !important;
}

/* Toggle icon styles */
.faq-accordion .toggle-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #111330;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px; /* preserve original spacing on desktop */
    font-weight: bold;
    font-size: 18px; /* Increased font size for better visibility */
    transition: all 0.3s ease;
    line-height: 24px; /* Match height for vertical centering */
    text-align: center; /* Ensure text is centered */
    padding: 0; /* Remove any padding */
}

.faq-accordion .accordion-button:not(.collapsed) .toggle-icon {
    background-color: #ef5744;
}

/* Accordion content styles */
.faq-accordion .accordion-body {
    padding: 15px 20px;
    color: #666666;
}

/* Accordion collapse animation */
.accordion-collapse {
    transition: all 0.3s ease-in-out;
}

.accordion-collapse.collapsing {
    height: 0;
    opacity: 0;
    transform: translateY(-10px);
}

.accordion-collapse.show {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInDown 0.3s ease-in-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab pane handling - hide inactive tabs completely */
.tab-content .tab-pane:not(.active) {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    top: -9999px !important;
}

.tab-content .tab-pane.active {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    top: 0 !important;
}

/* Make sure all accordion items are collapsed by default */
.accordion-collapse:not(.show) {
    display: none;
}

/* Responsive fixes: ensure toggle icon does not overlap content on small screens */
@media only screen and (max-width: 767px) {
    .faq-accordion .accordion-button {
        /* leave some room on the right for the toggle icon */
        padding-right: 72px !important;
    }

    .faq-accordion .toggle-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
        border-radius: 50% !important; /* keep circular look */
        position: absolute !important;
        right: 10px !important; /* keep a small gap from the edge */
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 5 !important; /* ensure icon sits above content */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Ensure icon remains clickable and text can wrap without overlap */
    .faq-accordion .accordion-button {
        padding-right: 72px !important; /* make room for the icon */
    }
}