/* style/faq.css */

/* Variables */
:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --btn-register: #C30808;
    --btn-login: #C30808;
    --font-register-login: #FFFF00;
}

/* Base styles for the FAQ page content */
.page-faq {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Default dark text for light body background */
    background-color: var(--secondary-color); /* Matches body background from shared.css */
    padding-top: var(--header-offset, 120px); /* Fixed header offset */
    box-sizing: border-box;
}

.page-faq__dark-bg {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.page-faq__light-bg {
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

/* Hero Section */
.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, var(--primary-color) 0%, #018d4d 100%); /* Adjusted gradient for visual appeal */
    color: var(--text-light);
}

.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%;
    margin-bottom: 30px;
}

.page-faq__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 8px;
    object-fit: cover;
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

.page-faq__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.page-faq__main-title {
    font-size: 3em;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text-light);
}

.page-faq__intro-text {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--text-light);
}

/* CTA Button - Primary */
.page-faq__cta-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text wrap */
    word-wrap: break-word; /* Allow text break */
}

.page-faq__btn-primary {
    background: var(--btn-register); /* Specific color for register/login */
    color: var(--font-register-login); /* Specific font color */
    border: 2px solid var(--btn-register);
}

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

/* Content Area */
.page-faq__content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

.page-faq__section-title {
    font-size: 2.5em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
}

.page-faq__description {
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 50px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-faq__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-faq__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--secondary-color);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    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: 1.1em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-dark);
    pointer-events: none; /* Prevent h3 from blocking click event */
}

.page-faq__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: var(--primary-color); /* Use primary color for toggle */
    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;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
    color: var(--primary-color);
    transform: rotate(45deg); /* Visual cue for expanded */
}

.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;
    opacity: 0;
    background: #f9f9f9;
    color: var(--text-dark);
    font-size: 1em;
}

.page-faq__faq-item.active .page-faq__faq-answer {
    max-height: 2000px !important; /* Ensure enough height for content */
    padding: 20px !important;
    opacity: 1;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #e0e0e0;
}

.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;
}

.page-faq__image-wrapper {
    margin: 20px 0;
    text-align: center;
}

.page-faq__image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    display: block; /* Ensure it doesn't cause extra space */
    margin: 0 auto; /* Center image */
    min-width: 200px; /* Enforce min size */
    min-height: 200px; /* Enforce min size */
}

/* Secondary Button style for FAQ answers */
.page-faq__btn-primary {
    display: inline-block;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    background: var(--btn-register);
    color: var(--font-register-login);
    border: 2px solid var(--btn-register);
}

.page-faq__btn-primary:hover {
    background: #a30606;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* CTA Section at bottom */
.page-faq__cta-section {
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(135deg, #017439, #018d4d);
    color: var(--text-light);
}

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

.page-faq__cta-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: var(--text-light);
}

.page-faq__cta-description {
    font-size: 1.1em;
    margin-bottom: 40px;
    color: var(--text-light);
}

.page-faq__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    width: 100%; /* Ensure container takes full width */
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Add padding to prevent overflow */
}

.page-faq__cta-buttons .page-faq__cta-button {
    margin-top: 0; /* Override default margin-top */
    flex-grow: 1; /* Allow buttons to grow */
    max-width: 300px; /* Limit individual button max width */
    font-size: 1.1em;
    padding: 15px 30px;
}

.page-faq__btn-secondary {
    background: var(--secondary-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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


/* Responsive Design */
@media (max-width: 1024px) {
    .page-faq__main-title {
        font-size: 2.5em;
    }
    .page-faq__section-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .page-faq {
        font-size: 16px;
        line-height: 1.6;
    }

    .page-faq__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Mobile header offset */
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

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

    .page-faq__intro-text {
        font-size: 1em;
    }

    .page-faq__cta-button {
        padding: 12px 30px;
        font-size: 1em;
    }

    .page-faq__content-area {
        padding: 30px 15px;
    }

    .page-faq__section-title {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

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

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

    .page-faq__faq-question h3 {
        font-size: 1em;
        margin-bottom: 0;
        width: calc(100% - 40px); /* Adjust width to make space for toggle */
    }

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

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

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

    /* Mobile image adaptation */
    .page-faq img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-width: 200px; /* Ensure min size is kept */
        min-height: 200px; /* Ensure min size is kept */
    }
    
    .page-faq__section,
    .page-faq__card,
    .page-faq__container,
    .page-faq__faq-list,
    .page-faq__cta-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Mobile button adaptation */
    .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 {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
        padding-left: 0;
        padding-right: 0;
    }
    .page-faq__cta-buttons .page-faq__cta-button {
        max-width: 100%; /* Ensure stacked buttons take full width */
    }

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

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

    .page-faq__cta-description {
        font-size: 1em;
    }
}

/* Contrast Fixes (if needed, though chosen colors should be fine) */
.page-faq__contrast-fix {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}

.page-faq__text-contrast-fix {
  color: #333333 !important;
  text-shadow: none !important;
}

/* Ensure content area images maintain min size */
.page-faq__content-area img {
    min-width: 200px;
    min-height: 200px;
}