/* style/faq.css */

/* Base styles for the FAQ page content */
.page-faq {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light backgrounds */
    background-color: var(--secondary-color); /* Matches body background from shared.css */
}

/* Intro Section */
.page-faq__intro-section {
    padding: 60px 20px;
    background-color: #ffffff; /* Explicitly white for intro section */
    text-align: center;
    padding-top: var(--header-offset, 120px); /* Ensure content is below header */
}

.page-faq__container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px; /* Add padding for smaller screens */
    box-sizing: border-box;
}

.page-faq__main-title {
    font-size: 38px;
    color: #26A9E0; /* Brand primary color for main title */
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-faq__description {
    font-size: 18px;
    margin-bottom: 40px;
    color: #555555;
}

.page-faq__description a {
    color: #26A9E0;
    text-decoration: none;
    font-weight: bold;
}

.page-faq__description a:hover {
    text-decoration: underline;
}

.page-faq__image-wrapper {
    margin-top: 30px;
    text-align: center;
}

.page-faq__banner-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Content Section */
.page-faq__content-section {
    padding: 60px 0;
    background-color: var(--secondary-color); /* Light background for FAQ items */
}

.page-faq__section-title {
    font-size: 32px;
    color: #26A9E0;
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

/* FAQ Accordion Styles - As per strict requirements */
.page-faq__faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.page-faq__faq-item {
    margin-bottom: 15px;
    border-radius: 8px; /* Slightly larger border-radius */
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* Subtle shadow */
}

.page-faq__faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
    padding: 0 20px; /* Slightly more padding for answers */
    opacity: 0;
}

.page-faq__faq-item.active .page-faq__faq-answer {
    max-height: 2000px !important; /* 🚨 Use!important ensure priority, value large enough */
    padding: 20px !important; /* Slightly more padding for answers */
    opacity: 1;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px; /* Match item border-radius */
}

.page-faq__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px; /* Slightly more padding for questions */
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px; /* Match item border-radius */
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.page-faq__faq-question:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.page-faq__faq-question:active {
    background: #eeeeee;
}

.page-faq__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 18px; /* Slightly larger font size */
    font-weight: 600;
    line-height: 1.5;
    color: #333333;
    pointer-events: none; /* Prevent h3 from blocking click events */
}

.page-faq__faq-toggle {
    font-size: 28px; /* Slightly larger toggle */
    font-weight: bold;
    line-height: 1;
    color: #26A9E0; /* Brand primary color for toggle */
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 20px; /* Slightly more margin */
    pointer-events: none; /* Prevent icon from blocking click events */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; /* Larger toggle area */
    height: 32px;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
    color: #000000; /* Darker color when active */
    transform: rotate(180deg); /* Rotate for minus sign effect */
}

.page-faq__faq-answer p {
    margin-bottom: 10px;
    color: #555555;
}

.page-faq__faq-answer p:last-child {
    margin-bottom: 0;
}

.page-faq__faq-answer a {
    color: #26A9E0;
    text-decoration: none;
    font-weight: bold;
}

.page-faq__faq-answer a:hover {
    text-decoration: underline;
}

.page-faq__faq-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-faq__intro-section {
        padding: 40px 15px;
        padding-top: var(--header-offset, 120px) !important; /* Ensure mobile header offset */
    }

    .page-faq__main-title {
        font-size: 28px;
    }

    .page-faq__description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .page-faq__section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .page-faq__content-section {
        padding: 40px 0;
    }

    .page-faq__faq-question {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    .page-faq__faq-question h3 {
        font-size: 16px;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }

    .page-faq__faq-toggle {
        margin-left: 10px;
        width: 28px;
        height: 28px;
        font-size: 24px;
    }

    .page-faq__faq-answer {
        padding: 0 15px;
    }

    .page-faq__faq-item.active .page-faq__faq-answer {
        padding: 15px !important;
    }

    /* Mobile image and button responsive rules */
    .page-faq img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    .page-faq__container,
    .page-faq__faq-list {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Buttons responsive */
    .page-faq__cta-button,
    .page-faq__btn-primary,
    .page-faq__btn-secondary,
    .page-faq a[class*="button"],
    .page-faq a[class*="btn"] {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      white-space: normal !important;
      word-wrap: break-word !important;
      padding-left: 15px;
      padding-right: 15px;
    }
    
    .page-faq__cta-buttons,
    .page-faq__button-group,
    .page-faq__btn-container {
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
      flex-wrap: wrap !important;
      gap: 10px;
    }
    .page-faq__cta-buttons {
      display: flex;
      flex-direction: column;
    }
}