/* style/resources.css */

/* Biến CSS tùy chỉnh cho trang */
:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --bg-light: #ffffff;
    --bg-dark: #017439;
    --button-register-bg: #C30808;
    --button-login-bg: #C30808;
    --button-register-text: #FFFF00;
    --button-login-text: #FFFF00;
}

.page-resources {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Mặc định chữ tối cho nền sáng */
    background-color: var(--bg-light);
}

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

.page-resources__heading {
    font-size: 2.5em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
}

.page-resources__paragraph {
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.8;
    text-align: justify;
}

.page-resources__light-bg {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.page-resources__dark-bg {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.page-resources__dark-bg .page-resources__heading {
    color: var(--text-light);
}

/* HERO Section */
.page-resources__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: var(--header-offset, 120px);
    overflow: hidden;
}

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

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

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

.page-resources__hero-title {
    font-size: 3.2em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.page-resources__hero-description {
    font-size: 1.3em;
    color: var(--text-dark);
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-resources__cta-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 180px;
    text-align: center;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-resources__cta-button--register {
    background: var(--button-register-bg);
    color: var(--button-register-text);
    border: 2px solid var(--button-register-bg);
}

.page-resources__cta-button--register:hover {
    background: darken(var(--button-register-bg), 10%); /* Placeholder for darker color */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.page-resources__cta-button--login {
    background: var(--button-login-bg);
    color: var(--button-login-text);
    border: 2px solid var(--button-login-bg);
}

.page-resources__cta-button--login:hover {
    background: darken(var(--button-login-bg), 10%); /* Placeholder for darker color */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

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

.page-resources__cta-button--secondary:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* General Section Styling */
.page-resources__section-intro, 
.page-resources__section-guide, 
.page-resources__section-strategy, 
.page-resources__section-news, 
.page-resources__section-tips, 
.page-resources__section-faq, 
.page-resources__section-conclusion {
    padding: 80px 0;
}

.page-resources__section-guide, .page-resources__section-news, .page-resources__section-faq {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.page-resources__section-guide .page-resources__heading,
.page-resources__section-news .page-resources__heading,
.page-resources__section-faq .page-resources__heading {
    color: var(--text-light);
}

.page-resources__section-guide .page-resources__paragraph,
.page-resources__section-news .page-resources__paragraph,
.page-resources__section-faq .page-resources__paragraph {
    color: var(--text-light);
}

.page-resources__content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-resources__content-grid--reverse .page-resources__card:nth-child(odd) {
    order: 1;
}

.page-resources__card {
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-resources__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-resources__card-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
    object-fit: cover;
    min-height: 200px; /* Minimum size for content images */
}

.page-resources__card-title {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight: bold;
}

.page-resources__card-title a {
    color: inherit;
    text-decoration: none;
}

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

.page-resources__card-text {
    font-size: 1em;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-resources__btn-primary,
.page-resources__btn-secondary {
    display: inline-block;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    margin-top: auto; /* Push buttons to bottom of card */
}

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

.page-resources__btn-primary:hover {
    background: darken(var(--primary-color), 10%); /* Placeholder for darker color */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.page-resources__btn-secondary:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.page-resources__card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-top: 15px;
}

.page-resources__card-buttons .page-resources__btn-primary,
.page-resources__card-buttons .page-resources__btn-secondary {
    flex: 1 1 auto;
    max-width: 100%;
}

/* FAQ Section */
.page-resources__faq-list {
    margin-top: 40px;
}

.page-resources__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.page-resources__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--bg-light);
    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-resources__faq-question:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

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

.page-resources__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.5;
    pointer-events: none; /* Prevent h3 from blocking click event */
    color: var(--text-dark);
}

.page-resources__faq-toggle {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: var(--primary-color);
    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-resources__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.3s ease;
    padding: 0 20px;
    opacity: 0;
    background-color: #f9f9f9;
    color: var(--text-dark);
}

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

.page-resources__faq-item.active .page-resources__faq-question {
    border-radius: 8px 8px 0 0;
    background-color: #f0f0f0;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
    color: var(--primary-color);
    transform: rotate(0deg);
}

.page-resources__faq-answer p {
    margin: 0;
    padding: 0;
}

/* Conclusion Section */
.page-resources__conclusion-cta {
    margin-top: 50px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-resources__heading {
        font-size: 2em;
    }
    .page-resources__hero-title {
        font-size: 2.5em;
    }
    .page-resources__hero-description {
        font-size: 1.1em;
    }
    .page-resources__section-intro, 
    .page-resources__section-guide, 
    .page-resources__section-strategy, 
    .page-resources__section-news, 
    .page-resources__section-tips, 
    .page-resources__section-faq, 
    .page-resources__section-conclusion {
        padding: 60px 0;
    }
    .page-resources__container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .page-resources__hero-section {
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-resources__hero-title {
        font-size: 2em;
        margin-bottom: 15px;
    }
    .page-resources__hero-description {
        font-size: 1em;
        margin-bottom: 30px;
    }
    .page-resources__hero-image {
        border-radius: 4px;
        margin-bottom: 20px;
    }
    .page-resources__cta-button {
        padding: 12px 30px;
        font-size: 16px;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 10px; /* Add margin between stacked buttons */
    }
    .page-resources__hero-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .page-resources__heading {
        font-size: 1.8em;
        margin-bottom: 30px;
    }
    .page-resources__paragraph {
        font-size: 1em;
    }
    .page-resources__content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-resources__card {
        padding: 20px;
        border-radius: 8px;
    }
    .page-resources__card-title {
        font-size: 1.4em;
    }
    .page-resources__card-image {
        border-radius: 4px;
        min-height: 180px;
    }
    
    /* Ensure all images are responsive */
    .page-resources img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    .page-resources__section, 
    .page-resources__card, 
    .page-resources__container, 
    .page-resources__hero-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-resources__btn-primary,
    .page-resources__btn-secondary {
        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-resources__card-buttons {
        flex-direction: column;
        gap: 10px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 0;
        padding-right: 0;
    }

    /* FAQ Mobile */
    .page-resources__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-resources__faq-question h3 {
        font-size: 1em;
        width: calc(100% - 40px);
    }
    .page-resources__faq-toggle {
        margin-left: 10px;
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
    .page-resources__faq-answer {
        padding: 0 15px;
    }
    .page-resources__faq-item.active .page-resources__faq-answer {
        padding: 15px !important;
    }
}

/* Placeholder for darken function (Sass-like) */
/* In a real scenario, this would be handled by a preprocessor or direct color values */
.page-resources__cta-button--register:hover {
    background: #a40707; /* Slightly darker red */
}
.page-resources__cta-button--login:hover {
    background: #a40707; /* Slightly darker red */
}
.page-resources__btn-primary:hover {
    background: #005a2e; /* Slightly darker green */
}