/* style/download.css */
/* 
  CSS cho trang Tải Xuống (Download Page)
  Tất cả các lớp (class) phải tuân thủ quy tắc BEM: .page-download__element-name
  Màu sắc chủ đạo: #FFD700 (Vàng), #1A1A1A (Đen)
*/

/* --- Base Styles for page-download content --- */
.page-download {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #f0f0f0; /* Light text for dark body background (#333) */
  background-color: transparent; /* Body background from shared.css */
}

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

.page-download__section {
  padding: 60px 0;
  text-align: center;
}

.page-download__section-title {
  font-size: 36px;
  margin-bottom: 20px;
  color: #FFD700; /* Primary color for titles */
  font-weight: bold;
}

.page-download__description {
  font-size: 18px;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #e0e0e0;
}

/* --- Hero Section --- */
.page-download__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--header-offset, 120px); /* Fixed header offset */
  padding-bottom: 60px;
  background: linear-gradient(135deg, #1A1A1A, #333); /* Dark gradient for hero */
  overflow: hidden; /* Ensure no overflow from images */
}

.page-download__hero-section .page-download__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  max-width: 1000px; /* Adjust max-width for better visual */
}

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

.page-download__main-title {
  font-size: 48px;
  font-weight: bold;
  color: #FFD700; /* Primary color */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-download__hero-content .page-download__description {
  font-size: 20px;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-download__download-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* For mobile responsiveness */
}

.page-download__btn-primary,
.page-download__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-width: 100%; /* For mobile responsiveness */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-download__btn-primary {
  background: #FFD700;
  color: #1A1A1A; /* Dark text for primary button */
  border: 2px solid #FFD700;
}

.page-download__btn-primary:hover {
  background: #e6c200;
  border-color: #e6c200;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.page-download__btn-secondary {
  background: transparent;
  color: #FFD700;
  border: 2px solid #FFD700;
}

.page-download__btn-secondary:hover {
  background: #FFD700;
  color: #1A1A1A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.page-download__hero-image {
  width: 100%;
  max-width: 700px; /* Adjust max-width for the image */
  margin-top: 30px;
}

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

/* --- Why App Section --- */
.page-download__why-app {
  background-color: #1A1A1A; /* Dark background for this section */
  color: #f0f0f0; /* Light text */
}

.page-download__why-app .page-download__section-title {
  color: #FFD700;
}

.page-download__flex-container {
  display: flex;
  align-items: center;
  gap: 40px;
  text-align: left;
}

.page-download__content-block {
  flex: 1;
}

.page-download__image-block {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.page-download__feature-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.page-download__feature-list li {
  margin-bottom: 15px;
  padding-left: 30px;
  position: relative;
  font-size: 17px;
  color: #e0e0e0;
}

.page-download__feature-list li strong {
  color: #FFD700;
}

.page-download__feature-list li::before {
  content: '✓';
  color: #FFD700;
  position: absolute;
  left: 0;
  top: 0;
  font-weight: bold;
  font-size: 20px;
}

/* --- How to Download Section --- */
.page-download__how-to {
  background-color: #333;
  color: #f0f0f0;
}

.page-download__how-to .page-download__section-title {
  color: #FFD700;
}

.page-download__installation-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 40px;
  text-align: left;
}

.page-download__step-item {
  background: rgba(255, 255, 255, 0.08); /* Semi-transparent background for cards */
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.page-download__step-title {
  font-size: 22px;
  color: #FFD700;
  margin-bottom: 15px;
  font-weight: bold;
}

.page-download__step-item p {
  color: #e0e0e0;
  font-size: 16px;
}

.page-download__center-image {
  text-align: center;
  margin-top: 40px;
}

.page-download__center-image img {
  max-width: 600px; /* Adjust max-width for guide image */
  margin: 0 auto;
}

.page-download__note {
  margin-top: 30px;
  font-style: italic;
  color: #ccc;
  font-size: 15px;
}

/* --- App Features Section --- */
.page-download__app-features {
  background-color: #1A1A1A;
  color: #f0f0f0;
}

.page-download__app-features .page-download__section-title {
  color: #FFD700;
}

.page-download__flex-reverse {
  flex-direction: row-reverse; /* Image on left, text on right */
}

/* --- FAQ Section --- */
.page-download__faq-section {
  background-color: #333;
  color: #f0f0f0;
}

.page-download__faq-section .page-download__section-title {
  color: #FFD700;
}

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

/* FAQ容器样式 */
.page-download__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08); /* Dark background for FAQ item */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* 问题样式 */
.page-download__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #1A1A1A; /* Darker background for question */
  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: #2a2a2a;
}

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

/* 问题标题样式 */
.page-download__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
  color: #f0f0f0;
}

/* 切换图标 */
.page-download__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #FFD700;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* 防止图标阻止点击事件 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-download__faq-item.active .page-download__faq-toggle {
  color: #FFD700;
  transform: rotate(45deg); /* Change to minus sign visually */
}

/* 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 25px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的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: #2a2a2a; /* Slightly lighter background for answer */
  border-radius: 0 0 8px 8px;
  color: #e0e0e0;
}

.page-download__faq-item.active .page-download__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* --- Final CTA Section --- */
.page-download__cta-final {
  background-color: #1A1A1A;
  padding-bottom: 80px;
}

.page-download__cta-final .page-download__section-title {
  color: #FFD700;
}

.page-download__center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --- Responsive Design (Mobile) --- */
@media (max-width: 768px) {
  .page-download__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile header offset */
    padding-bottom: 40px;
  }

  .page-download__hero-section .page-download__container {
    padding: 0 15px;
    gap: 20px;
  }

  .page-download__main-title {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .page-download__hero-content .page-download__description {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .page-download__download-buttons {
    flex-direction: column;
    gap: 15px;
    width: 100%; /* Ensure buttons take full width */
    padding: 0 15px;
    box-sizing: border-box;
  }

  .page-download__btn-primary,
  .page-download__btn-secondary {
    width: 100% !important; /* Force full width for buttons */
    max-width: 100% !important;
    font-size: 16px;
    padding: 12px 20px;
  }

  .page-download__section {
    padding: 40px 0;
  }

  .page-download__section .page-download__container {
    padding: 0 15px;
  }

  .page-download__section-title {
    font-size: 28px;
  }

  .page-download__description {
    font-size: 16px;
    margin-bottom: 25px;
  }

  .page-download__flex-container {
    flex-direction: column;
    gap: 30px;
  }

  .page-download__flex-reverse {
    flex-direction: column; /* Revert for mobile */
  }

  .page-download__content-block {
    text-align: center;
  }

  .page-download__feature-list {
    text-align: left;
    padding: 0 15px;
  }

  .page-download__feature-list li {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .page-download__installation-steps {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }

  .page-download__step-item {
    padding: 20px;
  }

  .page-download__step-title {
    font-size: 20px;
  }

  .page-download__step-item p {
    font-size: 15px;
  }

  /* FAQ Mobile */
  .page-download__faq-list {
    margin-top: 25px;
    padding: 0 15px;
  }

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

  .page-download__faq-question h3 {
    font-size: 16px;
  }

  .page-download__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

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

  /* Global image responsive rules */
  .page-download img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
  }
  
  /* All containers holding images or buttons */
  .page-download__section,
  .page-download__card,
  .page-download__container,
  .page-download__content-block,
  .page-download__image-block,
  .page-download__download-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Ensure padding is applied on mobile for content */
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Ensure no filter on images */
.page-download img {
  filter: none;
}