/* style/faq.css */

/* Base styles for the FAQ page */
.page-faq {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Dark text on light background */
    background-color: var(--secondary-color, #FFFFFF); /* Body background is light */
    padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
}

.page-faq__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Hero Section (or main banner for FAQ page) */
.page-faq__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #017439, #FFFFFF); /* Brand colors for background */
    color: #ffffff; /* White text on gradient background */
}

.page-faq__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.page-faq__hero-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 30px;
}

.page-faq__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

.page-faq__main-heading {
    font-size: 3.2em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-faq__intro-text {
    font-size: 1.2em;
    color: #f0f0f0;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Content Section */
.page-faq__content-section {
    padding: 60px 0;
    background-color: #f9f9f9; /* Light background for content */
}

.page-faq__section-title {
    font-size: 2.5em;
    color: #017439; /* Primary brand color for titles */
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

.page-faq__faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.page-faq__faq-category {
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

.page-faq__category-title {
    font-size: 1.8em;
    color: #017439;
    padding: 25px 30px;
    background-color: #e6f5ed; /* Lighter shade of primary color */
    margin: 0;
    border-bottom: 1px solid #d0d0d0;
}

/* FAQ Item styles */
.page-faq__faq-item {
    margin-bottom: 1px; /* Remove gaps between items within a category */
    border-radius: 0; /* No individual border-radius for items in category */
    overflow: hidden;
}

.page-faq__faq-item:last-child {
    border-bottom: none;
}

/* FAQ default state - answer hidden */
.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 30px; /* Adjusted padding for better visual */
    opacity: 0;
    color: #444444;
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height */
.page-faq__faq-item.active .page-faq__faq-answer {
    max-height: 2000px !important; /* 🚨 Use!important, value large enough for any content */
    padding: 20px 30px !important; /* Adjusted padding for better visual */
    opacity: 1;
    background: #fdfdfd;
    border-top: 1px solid #eeeeee;
}

.page-faq__faq-answer p {
    margin-bottom: 1em;
}

.page-faq__faq-answer ul,
.page-faq__faq-answer ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

.page-faq__faq-answer li {
    margin-bottom: 0.5em;
}

/* Question style */
.page-faq__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px; /* Adjusted padding for better visual */
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.page-faq__faq-item:last-child .page-faq__faq-question {
    border-bottom: none;
}

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

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

/* Question title style */
.page-faq__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none; /* Prevent h3 from blocking click event */
    color: #333333;
}

/* Toggle icon */
.page-faq__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #017439; /* Primary brand color for toggle icon */
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
    pointer-events: none; /* Prevent icon from blocking click event */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #017439;
    border-radius: 50%;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
    color: #ffffff;
    background-color: #017439;
    transform: rotate(180deg); /* Rotate for minus sign */
}

/* Call to Action Section */
.page-faq__cta-section {
    padding: 80px 20px;
    background-color: #017439; /* Dark background */
    color: #ffffff; /* White text */
    text-align: center;
}

.page-faq__cta-container {
    max-width: 900px;
}

.page-faq__cta-title {
    font-size: 2.8em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
}

.page-faq__cta-description {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 40px;
    color: #f0f0f0;
}

.page-faq__cta-buttons {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    justify-content: center;
    gap: 20px;
}

/* Buttons */
.page-faq__btn-primary,
.page-faq__btn-secondary {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Ensure padding is included in width */
    max-width: 100%; /* For responsiveness */
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text breaking */
}

.page-faq__btn-primary {
    background: #C30808; /* Custom color for Register/Login */
    color: #FFFF00; /* Custom font color */
    border: 2px solid transparent;
}

.page-faq__btn-primary:hover {
    background: #a30606;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.page-faq__btn-secondary {
    background: #ffffff;
    color: #017439;
    border: 2px solid #017439;
}

.page-faq__btn-secondary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Generic link style within content */
.page-faq__link-text {
    color: #017439; /* Primary brand color for links */
    text-decoration: underline;
    font-weight: 600;
}

.page-faq__link-text:hover {
    color: #005f2c;
    text-decoration: none;
}

/* Image styles */
.page-faq img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.page-faq__content-image {
    margin: 20px auto;
    display: block;
    max-width: 80%; /* Smaller for content images */
    border: 1px solid #e0e0e0;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .page-faq {
        font-size: 15px;
        line-height: 1.5;
        padding-top: var(--header-offset, 120px) !important; /* Mobile padding-top */
    }

    .page-faq__hero-section {
        padding: 40px 15px;
    }

    .page-faq__main-heading {
        font-size: 2.2em;
        margin-bottom: 15px;
    }

    .page-faq__intro-text {
        font-size: 1em;
        margin-bottom: 30px;
    }

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

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

    .page-faq__container {
        padding: 15px;
    }

    .page-faq__faq-category {
        margin-bottom: 20px;
    }

    .page-faq__category-title {
        font-size: 1.4em;
        padding: 18px 20px;
    }

    .page-faq__faq-question {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .page-faq__faq-question h3 {
        font-size: 1.05em;
        margin-bottom: 0;
        width: calc(100% - 40px); /* Adjust width for toggle icon */
    }
    
    .page-faq__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    
    .page-faq__faq-answer {
        padding: 0 20px; /* Adjusted padding for mobile */
    }
    
    .page-faq__faq-item.active .page-faq__faq-answer {
        padding: 15px 20px !important; /* Adjusted padding for mobile */
    }

    .page-faq__cta-section {
        padding: 50px 15px;
    }

    .page-faq__cta-title {
        font-size: 2em;
    }

    .page-faq__cta-description {
        font-size: 0.95em;
        margin-bottom: 30px;
    }

    .page-faq__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
    }

    .page-faq__btn-primary,
    .page-faq__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 25px;
        font-size: 16px;
    }

    /* Images responsiveness */
    .page-faq img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .page-faq__section,
    .page-faq__card,
    .page-faq__container,
    .page-faq__cta-container,
    .page-faq__hero-container { /* Ensure all containers are responsive */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-faq__content-image {
        max-width: 100% !important; /* Ensure content images also adapt */
    }
}