/* FAQ Accordion Frontend Styles - Matching Image Design */
.faq-accordion-container {
    max-width: 100%;
    width: 100%;
    background: transparent;
    padding: 0;
    border-radius: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

.faq-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #DBEFF3;
    border-top: 1.22px solid #CBDADD;
    overflow: hidden;
    padding: 0;
    max-width: 100%;
    position: relative;
}

/* Gradient overlay using pseudo-element for smooth transition */
.faq-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(249.48deg, rgba(67, 190, 202, 0.2) 14.07%, rgba(49, 60, 112, 0.1) 85.23%);
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 0;
}

.faq-item.active::before {
    opacity: 0;
}

/* Ensure content is above gradient overlay */
.faq-item > * {
    position: relative;
    z-index: 1;
}

.faq-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    padding: 2% 5%;
    cursor: pointer;
    background: transparent;
    transition: background-color 0.3s ease;
    user-select: none;
    position: relative;
    width: 100%;
    max-width: 100%;
    gap: 10% !important;
    overflow: hidden;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

/* When open, increase gap */
.faq-item.active .faq-header {
    gap: 10% !important;
}

.faq-item.active .faq-header {
    background: transparent;
    padding-bottom: 20px;
    flex-direction: row;
    flex-wrap: nowrap;
}

/* When open, show title and content side by side */
.faq-item.active .faq-header-left {
    flex: 0 0 auto;
    max-width: 45%;
    margin-bottom: 0;
}

.faq-item.active .faq-content {
    flex: 1;
    order: 2;
    margin-left: 0;
    padding-left: 2%;
}

.faq-header-left {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 0;
    max-width: 60vw !important;
    min-width: 25vw !important;
    flex-shrink: 1;
    overflow: hidden;
}

/* When closed, allow header-left to take more space */
.faq-item:not(.active) .faq-header-left {
    max-width: 100%;
}

.faq-number {
    font-size: 16px;
    font-weight: 400;
    color: #212121;
    margin: 0;
    display: block;
    line-height: 1.2;
}

.faq-title {
    margin: 0;
    font-size: 2.5rem !important;
    font-weight: 400;
    margin-left: 5% !important;
    color: #212121;
    line-height: 1.4;
    padding-left: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}


.faq-toggle-icon {
    display: none;
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
}

/* Show toggle icon in click mode */
.faq-click-mode .faq-toggle-icon {
    display: flex !important;
    visibility: visible !important;
}

/* Hide toggle icon in hover mode */
.faq-hover-mode .faq-toggle-icon {
    display: none !important;
    visibility: hidden !important;
}

.faq-icon-plus,
.faq-icon-minus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.faq-icon-plus {
    display: block;
}

.faq-icon-minus {
    display: none;
}

.faq-item.active .faq-icon-plus {
    display: none !important;
}

.faq-item.active .faq-icon-minus {
    display: block !important;
}

/* Ensure icons are visible in click mode */
.faq-click-mode .faq-toggle-icon .faq-icon-plus {
    display: block !important;
}

.faq-click-mode .faq-item.active .faq-toggle-icon .faq-icon-plus {
    display: none !important;
}

.faq-click-mode .faq-toggle-icon .faq-icon-minus {
    display: none !important;
}

.faq-click-mode .faq-item.active .faq-toggle-icon .faq-icon-minus {
    display: block !important;
}

.faq-icon-triangle {
    display: none;
}

.faq-content {
    flex: 1;
    display: block;
    overflow: hidden;
    opacity: 1;
    min-width: 0;
    max-width: 100%;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-content {
    display: block;
    opacity: 1;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.faq-content-wrapper {
    display: flex;
    gap: 15px;
    align-items: start;
    width: 100%;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When closed, ensure small gap between title and content */
.faq-item:not(.active) .faq-content-wrapper {
    gap: 0.5%;
}

/* When open, rearrange: image first (after title), then content */
.faq-item.active .faq-content-wrapper {
    flex-direction: row;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Image should be first (after title, before content) */
.faq-item.active .faq-image {
    order: 1;
    flex: 0 0 auto;
    flex-shrink: 0;
    margin-left: 5%;
}

/* When no content, image should be on the right (where content would be) */
.faq-item.active.no-content .faq-image {
    order: 2;
    margin-left: auto;
}

.faq-item.active .faq-content-wrapper:has(.faq-content-right:empty) .faq-image,
.faq-item.active .faq-content-wrapper:has(.faq-content-right:not(:has(.faq-text))) .faq-image {
    order: 2;
    margin-left: auto;
}

/* Hide content-right when empty and active */
.faq-item.active .faq-content-right:empty {
    display: none !important;
    width: 0;
    max-width: 0;
    flex: 0 0 0;
    margin: 0;
    padding: 0;
}

/* Content should be after image - move further to left when open */
.faq-item.active .faq-content-wrapper {
    gap: 2%;
    margin-left: 0;
    padding-left: 0;
}


/* When closed, content only (no image shown) */
.faq-item:not(.active) .faq-content-wrapper {
    flex-direction: row;
}

/* Hide image when closed - take no space */
.faq-image {
    opacity: 0;
    visibility: hidden;
    width: 0;
    max-width: 0;
    min-width: 0;
    flex: 0 0 0;
    border-radius: 6px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transform: translateX(50px) scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                width 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                max-width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show image when open - smooth animation from right */
.faq-item.active .faq-image {
    opacity: 1;
    visibility: visible;
    width: auto;
    max-width: 200px;
    min-width: 20vw;
    flex: 0 0 auto;
    order: 1;
    margin-left: 5%;
    transform: translateX(0) scale(1);
}

.faq-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.faq-content-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-top: 2%;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* When item is not active, content is in normal position - DON'T CHANGE */
.faq-item:not(.active) .faq-content-right {
    transform: translateX(0);
    opacity: 1;
    display: flex;
}

/* When active, hide the closed-state text container */
.faq-item.active .faq-content-right {
    display: none !important;
}

/* When active, show text next to image - both come from right */
.faq-item.active .faq-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: start;
    gap: 2%;
    position: relative;
}

/* Text that appears next to image when active - comes from right */
.faq-item.active .faq-content-wrapper > .faq-text {
    display: block !important;
    order: 2;
    flex: 0 1 auto;
    max-width: 50%;
    min-width: 0;
    margin-left: 0;
    transform: translateX(50px);
    opacity: 0;
    animation: slideInFromRightSmooth 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFromRightSmooth {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Prevent text wrapping when open */
.faq-item.active .faq-text {
    white-space: normal;
}

.faq-description {
    font-size: 18px;
    color: #90a4ae;
    line-height: 1.6;
    margin: 0 0 15px 0;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.faq-text {
    color: #888888;
    line-height: 1.8;
    font-size: 1.5rem;
    font-weight: 300;
    margin: 0;
    transition: font-size 0.4s ease-out, color 0.4s ease-out;
}

/* When closed, ensure text color is #888888 */
.faq-item:not(.active) .faq-text {
    font-size: 2rem !important;
    color: #888888;
    line-height: 2.5rem;
}

/* Make text smaller when open and change color to #212121 */
.faq-item.active .faq-content-wrapper > .faq-text {
    font-size: 20px !important;
    color: #212121 !important;
    line-height: 1.8;
    margin: 0;
}

.faq-text p {
    margin-bottom: 15px;
    margin-top: 0 !important;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .faq-accordion-container {
        padding: 0;
    }
    
    .faq-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .faq-item.active .faq-header {
        flex-direction: column;
        padding-bottom: 15px;
    }
    
    .faq-header-left {
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100%;
    }
    
    .faq-number {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .faq-title {
        font-size: 20px;
        margin-left: 0 !important;
        line-height: 1.3;
    }
    
    .faq-content {
        width: 100%;
        margin-top: 10px;
    }
    
    .faq-item.active .faq-content {
        margin-left: 0;
        width: 100%;
    }
    
    .faq-content-wrapper {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    /* On mobile, when open, show content first then image */
    .faq-item.active .faq-content-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .faq-item.active .faq-content-right {
        order: 1;
        max-width: 100%;
        margin-left: 0;
        margin-top: 0;
    }
    
    .faq-item.active .faq-image {
        order: 2;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    /* When no content on mobile, image should be full width */
    .faq-item.active.no-content .faq-image {
        order: 2;
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .faq-image {
        width: 100%;
        max-width: 100%;
    }
    
    .faq-image img {
        width: 100%;
        height: auto;
    }
    
    /* Make content smaller on mobile when open */
    .faq-text {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .faq-item.active .faq-text {
        font-size: 16px;
    }
    
    .faq-description {
        font-size: 16px;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .faq-header {
        padding: 2% 3%;
        gap: 2%;
    }
    
    .faq-title {
        font-size: 24px;
    }
    
    .faq-text {
        font-size: 22px;
    }
    
    .faq-item.active .faq-text {
        font-size: 18px;
    }
    
    .faq-item.active .faq-image {
        max-width: 180px;
        min-width: 15vw;
    }
}

/* Animation removed to prevent issues */

@media (min-width: 320px) and (max-width: 768px) {
    .faq-accordion-container .faq-item.active .faq-header .faq-content-wrapper .faq-content-right .faq-text {
        font-size: 20px !important;
    }
    
    .faq-accordion-container .faq-item.active .faq-header .faq-header-left .faq-title {
        font-size: 2rem !important;
    }
    
    .faq-accordion-container .faq-item.active .faq-image {
        margin-left: 0px !important;
    }
}
    