/* style/download.css */
:root {
    --primary-color: #FFD700;
    --secondary-color: #8B0000;
}

.page-download {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light body background */
    background-color: #f8f8f8; /* A light background for the page content */
    padding-top: var(--header-offset, 120px); /* Ensure content is below fixed header */
}

/* Hero Section */
.page-download__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    overflow: hidden; /* Ensure image doesn't overflow */
}

.page-download__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Ensure content is above any background effects */
}

.page-download__hero-image {
    width: 100%;
    max-width: 800px; /* Limit image width */
    margin-bottom: 30px;
    position: relative;
    z-index: 0;
}

.page-download__hero-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.page-download__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 800px;
}

.page-download__main-title {
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-download__description-text {
    font-size: 1.2em;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: #f0f0f0;
}

.page-download__cta-button {
    display: inline-block;
    padding: 18px 45px;
    background: #ffffff;
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.3em;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    border: none;
}

.page-download__cta-button:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
}

/* General Section Styling */
.page-download__section {
    padding: 80px 20px;
    text-align: center;
}

.page-download__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.page-download__section-title {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--secondary-color); /* Default for light backgrounds */
}

.page-download__section-intro {
    font-size: 1.1em;
    max-width: 800px;
    margin: 0 auto 50px;
    color: #555555; /* Default for light backgrounds */
}

/* Backgrounds for contrast */
.page-download__light-bg {
    background-color: #f8f8f8;
    color: #333333;
}
.page-download__light-bg .page-download__section-title {
    color: var(--secondary-color);
}
.page-download__light-bg .page-download__section-intro {
    color: #555555;
}

.page-download__dark-bg {
    background: var(--secondary-color);
    color: #ffffff;
}
.page-download__dark-bg .page-download__section-title {
    color: var(--primary-color);
}
.page-download__dark-bg .page-download__section-intro {
    color: #f0f0f0;
}
.page-download__dark-bg .page-download__btn-primary {
    background: var(--primary-color);
    color: var(--secondary-color);
}
.page-download__dark-bg .page-download__btn-primary:hover {
    background: #ffffff;
    color: var(--secondary-color);
}
.page-download__dark-bg .page-download__btn-secondary {
    background: #ffffff;
    color: var(--secondary-color);
    border-color: #ffffff;
}
.page-download__dark-bg .page-download__btn-secondary:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Why App Section */
.page-download__why-app-section {
    padding-bottom: 40px;
}

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

.page-download__feature-item {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-download__feature-title {
    font-size: 1.4em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.page-download__feature-item p {
    font-size: 1em;
    color: #666666;
}

/* How to Download Section */
.page-download__how-to-download-section {
    padding-bottom: 40px;
    counter-reset: step-counter;
}

.page-download__download-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 50px;
}

.page-download__download-platform {
    background: rgba(255, 255, 255, 0.1);
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    flex: 1;
    max-width: 500px;
    text-align: left;
}

.page-download__platform-title {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
}

.page-download__qr-code-wrapper {
    text-align: center;
    margin-bottom: 30px;
}

.page-download__qr-code {
    width: 250px;
    height: 250px;
    border: 5px solid #ffffff;
    border-radius: 8px;
    display: block;
    margin: 0 auto 15px;
    object-fit: contain;
}
.page-download__qr-code-wrapper p {
    color: #f0f0f0;
    font-size: 0.95em;
}

.page-download__step-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
    color: #e0e0e0;
}

.page-download__step-list li {
    margin-bottom: 15px;
    padding-left: 25px;
    position: relative;
    font-size: 1em;
}

.page-download__step-list li:last-child {
    margin-bottom: 0;
}

.page-download__step-list li strong {
    color: var(--primary-color);
}

.page-download__step-list li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary-color);
    color: var(--secondary-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

/* App Features Section */
.page-download__app-features-section {
    padding-bottom: 40px;
}

.page-download__features-content {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 50px;
}

.page-download__features-text {
    flex: 1;
    text-align: left;
}

.page-download__features-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.page-download__features-list li {
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
    font-size: 1.05em;
    color: #444444;
}

.page-download__features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em;
}

.page-download__features-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-download__features-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Security Section */
.page-download__security-section {
    padding-bottom: 40px;
}

.page-download__security-content {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 50px;
}

.page-download__security-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-download__security-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-download__security-text {
    flex: 1;
    text-align: left;
}

.page-download__security-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.page-download__security-list li {
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
    font-size: 1.05em;
    color: #f0f0f0;
}

.page-download__security-list li::before {
    content: '🔒';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.2em;
}

/* FAQ Section */
.page-download__faq-section {
    padding-bottom: 40px;
}

.page-download__faq-list {
    max-width: 900px;
    margin: 50px auto 0;
    text-align: left;
}

/* FAQ容器样式 */
.page-download__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* FAQ默认状态 - 答案隐藏 */
.page-download__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;
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo mở rộng */
.page-download__faq-item.active .page-download__faq-answer {
    max-height: 2000px !important; /* 🚨 Sử dụng !important để đảm bảo ưu tiên, giá trị đủ lớn để chứa bất kỳ nội dung nào */
    padding: 20px !important;
    opacity: 1;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
}

/* Question Style */
.page-download__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    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-download__faq-question:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

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

/* Question Title Style */
.page-download__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--secondary-color);
    pointer-events: none; /* Prevent h3 from blocking click events */
}

/* Toggle Icon */
.page-download__faq-toggle {
    font-size: 28px;
    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 events */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.page-download__faq-item.active .page-download__faq-toggle {
    color: var(--secondary-color);
    transform: rotate(45deg); /* Change to a cross or simply change to '-' */
}

/* Bottom CTA Section */
.page-download__cta-bottom {
    padding-top: 60px;
    padding-bottom: 80px;
}

.page-download__cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* General Buttons */
.page-download__btn-primary {
    display: inline-block;
    padding: 15px 35px;
    background: var(--primary-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-download__btn-primary:hover {
    background: #ffffff;
    color: var(--secondary-color);
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.page-download__btn-secondary {
    display: inline-block;
    padding: 15px 35px;
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.page-download__btn-secondary:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-download__main-title {
        font-size: 2.2em;
    }
    .page-download__section-title {
        font-size: 1.8em;
    }
    .page-download__download-steps,
    .page-download__features-content,
    .page-download__security-content {
        flex-direction: column;
        gap: 30px;
    }
    .page-download__download-platform,
    .page-download__features-text,
    .page-download__security-text,
    .page-download__features-image,
    .page-download__security-image {
        max-width: 100%;
        width: 100%;
    }
    .page-download__features-image img,
    .page-download__security-image img {
        max-width: 80%;
    }
}

@media (max-width: 768px) {
    .page-download {
        font-size: 16px;
        line-height: 1.6;
        padding-top: var(--header-offset, 120px) !important; /* Mobile specific header offset */
    }

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

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

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

    .page-download__cta-button {
        padding: 15px 30px;
        font-size: 1.1em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .page-download__section {
        padding: 50px 15px;
    }

    .page-download__section-title {
        font-size: 1.6em;
    }

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

    .page-download__feature-grid {
        gap: 20px;
    }

    .page-download__feature-item {
        padding: 25px;
    }

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

    .page-download__qr-code {
        width: 200px;
        height: 200px;
    }

    .page-download__features-image img,
    .page-download__security-image img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    .page-download__faq-question {
        padding: 15px;
    }

    .page-download__faq-question h3 {
        font-size: 1em;
    }

    .page-download__faq-toggle {
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
    
    .page-download__faq-item.active .page-download__faq-answer {
        padding: 15px !important;
    }

    /* All images and containers must be responsive */
    .page-download img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }
    .page-download__section,
    .page-download__container,
    .page-download__feature-item,
    .page-download__download-platform {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Buttons responsive */
    .page-download__btn-primary,
    .page-download__btn-secondary,
    .page-download a[class*="button"],
    .page-download 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-download__cta-content {
        flex-direction: column;
        gap: 15px;
    }
}

/* Fixed color contrast for specific elements on dark backgrounds if needed */
.page-download__dark-bg .page-download__step-list li {
    color: #f0f0f0;
}
.page-download__dark-bg .page-download__qr-code-wrapper p {
    color: #f0f0f0;
}