/* style/download.css */

/* Biến màu sắc */
:root {
    --primary-color: #26A9E0;
    --secondary-color: #FFFFFF;
    --text-dark: #333333;
    --text-light: #ffffff;
    --background-light: #f8f9fa;
    --background-dark: #26A9E0;
    --login-button-color: #EA7C07;
}

/* Thiết lập cơ bản cho trang */
.page-download {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-dark); /* Mặc định chữ tối trên nền sáng */
    background-color: var(--background-light);
}

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

/* 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;
    padding-top: var(--header-offset, 120px); /* Đảm bảo không bị header cố định che khuất */
    background: linear-gradient(135deg, var(--primary-color) 0%, #34BEEF 100%); /* Nền gradient cho hero */
    color: var(--text-light);
    overflow: hidden;
}

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

.page-download__hero-image {
    width: 100%;
    margin-bottom: 30px;
}

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

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

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

.page-download__hero-description {
    font-size: 1.2em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-light);
}

.page-download__cta-button {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    text-align: center;
    white-space: normal; /* Cho phép xuống dòng */
    word-wrap: break-word; /* Ngắt từ */
}

.page-download__btn-primary {
    background: var(--login-button-color); /* Màu cam cho nút chính */
    color: var(--text-light);
    border: 2px solid var(--login-button-color);
}

.page-download__btn-primary:hover {
    background: darken(var(--login-button-color), 10%); /* Hiệu ứng hover */
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.page-download__btn-secondary:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* General Section Styling */
.page-download__section-title {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.page-download__section-description {
    font-size: 1.1em;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px auto;
    line-height: 1.7;
}

.page-download__dark-section .page-download__section-title,
.page-download__dark-section .page-download__section-description {
    color: var(--text-light);
}

.page-download__dark-section {
    background-color: var(--background-dark);
    color: var(--text-light);
    padding: 80px 0;
}

.page-download__light-bg {
    background-color: var(--background-light);
    color: var(--text-dark);
    padding: 80px 0;
}

/* Card Styling */
.page-download__card {
    background: var(--secondary-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Đảm bảo chiều cao đồng đều trong grid */
}

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

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

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

.page-download__feature-title {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.page-download__feature-text {
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-dark);
}

/* Download Guide Section */
.page-download__download-platform {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 50px;
}

.page-download__download-item {
    text-align: center;
}

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

.page-download__dark-section .page-download__platform-title {
    color: var(--primary-color);
}

.page-download__platform-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-download__download-steps {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-bottom: 30px;
}

.page-download__download-steps li {
    margin-bottom: 15px;
    font-size: 1.05em;
    line-height: 1.6;
    color: var(--text-dark);
    position: relative;
    padding-left: 30px;
}

.page-download__download-steps li::before {
    content: attr(data-step-number);
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--primary-color);
    color: var(--text-light);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
}

.page-download__download-steps li:nth-child(1)::before { content: '1'; }
.page-download__download-steps li:nth-child(2)::before { content: '2'; }
.page-download__download-steps li:nth-child(3)::before { content: '3'; }
.page-download__download-steps li:nth-child(4)::before { content: '4'; }
.page-download__download-steps li:nth-child(5)::before { content: '5'; }

.page-download__notice-text {
    text-align: center;
    font-style: italic;
    margin-top: 40px;
    font-size: 0.95em;
    color: var(--text-light);
}

/* App Features Section */
.page-download__feature-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
}

.page-download__feature-card {
    display: flex;
    align-items: center;
    text-align: left;
}

.page-download__feature-card:nth-child(even) {
    flex-direction: row-reverse; /* Đảo ngược thứ tự cho các card chẵn */
}

.page-download__feature-card-image {
    flex: 0 0 45%;
    max-width: 45%;
    height: auto;
    border-radius: 12px;
    margin-right: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-download__feature-card:nth-child(even) .page-download__feature-card-image {
    margin-right: 0;
    margin-left: 30px;
}

.page-download__feature-card-content {
    flex: 1;
}

.page-download__feature-card-title {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.page-download__feature-card-text {
    font-size: 1.05em;
    line-height: 1.7;
    color: var(--text-dark);
}

/* Exclusive Promotions Section */
.page-download__promo-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-download__promo-item {
    text-align: center;
}

.page-download__promo-title {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.page-download__promo-text {
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-dark);
}

.page-download__button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
    flex-wrap: wrap;
}

/* FAQ Section */
.page-download__faq-section {
    padding: 80px 0;
}

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

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

/* 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;
    padding: 0 25px;
    opacity: 0;
    color: var(--text-dark);
}

/* FAQ展开状态 - 🚨 Sử dụng!important và đủ lớn max-height */
.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 mọi nội dung */
    padding: 20px 25px !important;
    opacity: 1;
    background: #f9f9f9;
    border-radius: 0 0 12px 12px;
}

/* Vấn đề FAQ */
.page-download__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: var(--secondary-color);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    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;
}

/* Tiêu đề vấn đề */
.page-download__faq-question h3 {
    margin: 0;
    padding: 0;
    flex: 1;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-dark);
    pointer-events: none; /* Ngăn chặn h3 chặn sự kiện click */
}

/* Biểu tượng chuyển đổi */
.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: 20px;
    pointer-events: none; /* Ngăn chặn biểu tượng chặn sự kiện click */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.page-download__faq-item.active .page-download__faq-toggle {
    color: var(--primary-color);
    transform: rotate(45deg); /* Xoay khi mở */
}

/* Final CTA Section */
.page-download__final-cta-section {
    padding: 80px 0;
    text-align: center;
}

.page-download__final-cta-section .page-download__section-title,
.page-download__final-cta-section .page-download__section-description {
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-download__main-title {
        font-size: 2.8em;
    }
    .page-download__section-title {
        font-size: 2em;
    }
    .page-download__feature-card-image {
        flex: 0 0 40%;
        max-width: 40%;
    }
    .page-download__feature-card:nth-child(even) .page-download__feature-card-image {
        margin-left: 20px;
    }
    .page-download__feature-card-image {
        margin-right: 20px;
    }
}

@media (max-width: 768px) {
    .page-download__hero-section {
        padding-top: var(--header-offset, 120px) !important; /* Ghi đè padding-top cho mobile */
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }
    .page-download__hero-image img {
        border-radius: 8px;
    }
    .page-download__main-title {
        font-size: 2.2em;
    }
    .page-download__hero-description {
        font-size: 1em;
    }
    .page-download__cta-button {
        padding: 12px 30px;
        font-size: 1em;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .page-download__section-title {
        font-size: 1.8em;
    }
    .page-download__section-description {
        font-size: 0.95em;
        margin-bottom: 30px;
    }
    .page-download__features-grid,
    .page-download__download-platform,
    .page-download__promo-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .page-download__download-item {
        padding: 25px;
    }
    .page-download__platform-image {
        max-width: 100%;
    }
    .page-download__feature-list {
        gap: 30px;
    }
    .page-download__feature-card {
        flex-direction: column;
        text-align: center;
    }
    .page-download__feature-card:nth-child(even) {
        flex-direction: column;
    }
    .page-download__feature-card-image {
        flex: none;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    .page-download__feature-card:nth-child(even) .page-download__feature-card-image {
        margin-left: 0;
    }
    .page-download__feature-card-title {
        font-size: 1.5em;
    }
    .page-download__feature-card-content {
        padding: 0;
    }
    .page-download__faq-question {
        padding: 15px;
        flex-wrap: wrap;
    }
    .page-download__faq-question h3 {
        font-size: 1em;
        margin-bottom: 0;
        width: calc(100% - 40px);
    }
    .page-download__faq-toggle {
        margin-left: 10px;
        width: 28px;
        height: 28px;
        font-size: 24px;
    }
    .page-download__faq-answer {
        padding: 0 15px;
    }
    .page-download__faq-item.active .page-download__faq-answer {
        padding: 15px !important;
    }
    .page-download__button-group {
        flex-direction: column;
        gap: 15px;
    }
    .page-download__container {
        padding: 0 15px;
    }
    .page-download img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    .page-download__section,
    .page-download__card,
    .page-download__container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .page-download__main-title {
        font-size: 1.8em;
    }
    .page-download__section-title {
        font-size: 1.5em;
    }
    .page-download__cta-button {
        font-size: 0.95em;
        padding: 10px 20px;
    }
    .page-download__faq-question h3 {
        font-size: 0.95em;
    }
    .page-download__faq-toggle {
        font-size: 20px;
        width: 24px;
        height: 24px;
    }
}