/* style/resources.css */

/* Biến CSS */
:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --button-register-bg: #C30808;
    --button-login-bg: #C30808;
    --button-text-color: #FFFFFF; /* Đảm bảo độ tương phản WCAG AA */
    --text-dark: #333333;
    --text-light: #FFFFFF;
    --background-light: #FFFFFF;
    --border-light: #e0e0e0;
}

/* Base styles for the resources page */
.page-resources {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Body background is light, so use dark text */
    background-color: var(--background-light);
    padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
}

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

/* Hero Section */
.page-resources__hero-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    background-color: var(--primary-color); /* Dark background */
    color: var(--text-light);
    text-align: center;
    overflow: hidden;
}

.page-resources__hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page-resources__hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2; /* Subtle overlay for text readability */
}

.page-resources__hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.page-resources__hero-title {
    font-size: 3.2em;
    margin-bottom: 20px;
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-resources__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--text-light);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.page-resources__hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* General Section Styling */
.page-resources__content-section {
    padding: 60px 0;
    background-color: var(--background-light);
    color: var(--text-dark);
}

.page-resources__dark-section {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.page-resources__dark-section .page-resources__section-title {
    color: var(--text-light);
}

.page-resources__dark-section .page-resources__text-block {
    color: var(--text-light);
}

.page-resources__dark-section .page-resources__text-link {
    color: var(--secondary-color);
}

.page-resources__section-title {
    font-size: 2.2em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.page-resources__text-block {
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: justify;
}

.page-resources__text-link {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.page-resources__text-link:hover {
    color: #004d26; /* Darker green on hover */
}

/* Buttons */
.page-resources__btn-primary, .page-resources__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box; /* Crucial for responsive buttons */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Ensure long words break */
}

.page-resources__btn-primary {
    background-color: var(--button-register-bg); /* #C30808 */
    color: var(--button-text-color); /* #FFFFFF for WCAG AA contrast */
    border: 2px solid var(--button-register-bg);
}

.page-resources__btn-primary:hover {
    background-color: #a00606; /* Slightly darker red */
    border-color: #a00606;
}

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

.page-resources__btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.page-resources__cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* Image Grid/Content Images */
.page-resources__image-grid {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

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

/* Video Section */
.page-resources__video-section {
    padding: 60px 0;
    text-align: center;
}

.page-resources__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 40px auto 0 auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.page-resources__video-link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.page-resources__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* FAQ Section */
.page-resources__faq-section {
    margin-top: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-resources__faq-item {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    background-color: var(--secondary-color);
}

.page-resources__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.15em;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    background-color: #f9f9f9;
    transition: background-color 0.3s ease;
}

.page-resources__faq-question:hover {
    background-color: #f0f0f0;
}

.page-resources__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.page-resources__faq-item.active .page-resources__faq-toggle {
    transform: rotate(45deg); /* Change '+' to 'x' or similar */
}

.page-resources__faq-answer {
    max-height: 0; /* Initial state: collapsed */
    overflow: hidden;
    padding: 0 25px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: var(--text-dark);
}

.page-resources__faq-item.active .page-resources__faq-answer {
    max-height: 1000px !important; /* Ensure it expands sufficiently */
    padding: 15px 25px;
}

.page-resources__faq-answer p {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-resources__hero-title {
        font-size: 2.8em;
    }

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

@media (max-width: 768px) {
    .page-resources__hero-section {
        flex-direction: column;
        padding: 60px 0;
        text-align: left;
    }

    .page-resources__hero-content {
        padding: 15px;
        text-align: center;
    }

    .page-resources__hero-title {
        font-size: 2.2em;
        margin-bottom: 15px;
    }

    .page-resources__hero-description {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .page-resources__hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .page-resources__btn-primary, .page-resources__btn-secondary {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 20px;
        font-size: 1em;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-resources__container {
        padding: 0 15px;
    }

    .page-resources__section-title {
        font-size: 1.8em;
        margin-bottom: 30px;
    }

    .page-resources__text-block {
        font-size: 1em;
    }

    /* Mobile image responsiveness */
    .page-resources img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-resources__image-grid,
    .page-resources__video-section,
    .page-resources__video-wrapper,
    .page-resources__cta-buttons,
    .page-resources__faq-section {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }

    .page-resources__video-section {
        padding-top: var(--header-offset, 120px) !important; /* Adjust for mobile header */
    }

    .page-resources__video-wrapper {
        margin: 20px auto 0 auto;
    }

    .page-resources__faq-question {
        padding: 15px 20px;
        font-size: 1em;
    }

    .page-resources__faq-answer {
        padding: 0 20px;
    }

    .page-resources__faq-item.active .page-resources__faq-answer {
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .page-resources__hero-title {
        font-size: 1.8em;
    }

    .page-resources__section-title {
        font-size: 1.5em;
    }

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

    .page-resources__hero-content {
        padding: 10px;
    }

    .page-resources__btn-primary, .page-resources__btn-secondary {
        font-size: 0.9em;
        padding: 10px 15px;
    }
}