/* style/faq.css */

:root {
  --primary-color: #FFD700; /* Vàng kim */
  --secondary-color: #1A1A2E; /* Xanh nửa đêm */
  --text-light: #ffffff;
  --text-dark: #333333;
  --bg-dark: #0a0a0a;
  --card-bg-dark: rgba(255, 255, 255, 0.08); /* Nền thẻ hơi trong suốt trên nền tối */
  --border-color-dark: rgba(255, 255, 255, 0.15);
}

.page-faq {
  font-family: 'Arial', sans-serif;
  color: var(--text-light); /* Toàn bộ trang dùng chữ sáng trên nền tối */
  background-color: var(--bg-dark); /* Kế thừa từ body */
  line-height: 1.6;
}

/* Đảm bảo nội dung không bị che bởi header cố định */
.page-faq__hero-section {
  padding-top: 120px; /* Desktop: Điều chỉnh dựa trên chiều cao header */
  padding-bottom: 60px;
  background: linear-gradient(135deg, var(--secondary-color) 0%, #000000 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

.page-faq__container--hero {
  padding-top: 20px;
}

.page-faq__main-title {
  font-size: 48px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.page-faq__hero-description {
  font-size: 18px;
  color: var(--text-light);
  max-width: 800px;
  margin: 0 auto 40px auto;
  opacity: 0.9;
}

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

.page-faq__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--primary-color);
  color: var(--secondary-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: none;
  cursor: pointer;
  white-space: normal; /* Cho phép văn bản xuống dòng */
  word-wrap: break-word;
}

.page-faq__cta-button:hover {
  background: #e6c200;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

.page-faq__cta-button--secondary:hover {
  background: #0d0d1a;
  border-color: #e6c200;
}

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

.page-faq__section-title {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.page-faq__section-title--light {
  color: var(--primary-color);
}

.page-faq__section-description {
  font-size: 16px;
  color: var(--text-light);
  text-align: center;
  max-width: 900px;
  margin: 0 auto 40px auto;
  opacity: 0.8;
}

.page-faq__section-description--light {
  color: var(--text-light);
}

/* FAQ Section */
.page-faq__faq-section {
  padding: 60px 0;
  background-color: var(--bg-dark);
}

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

.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color-dark);
}

.page-faq__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-color);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-faq__faq-question:hover {
  background: #2b2b4d;
}

.page-faq__faq-question:active {
  background: #3a3a5e;
}

.page-faq__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color);
  pointer-events: none; /* Ngăn h3 chặn sự kiện click */
}

.page-faq__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; /* Ngăn icon chặn sự kiện click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-faq__faq-item.active .page-faq__faq-toggle {
  transform: rotate(45deg); /* Xoay để tạo hiệu ứng dấu X */
  color: var(--text-light);
}

.page-faq__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;
  background: var(--card-bg-dark);
  color: var(--text-light);
  border-top: 1px solid var(--border-color-dark);
}

.page-faq__faq-item.active .page-faq__faq-answer {
  max-height: 2000px !important; /* Đủ lớn để chứa mọi nội dung */
  padding: 20px !important;
  opacity: 1;
  border-radius: 0 0 8px 8px;
}

.page-faq__faq-answer p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-light);
}

/* Brand Section */
.page-faq__brand-section {
  padding: 80px 0;
  background: var(--secondary-color);
  color: var(--text-light);
  text-align: center;
}

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

.page-faq__brand-item {
  background: var(--card-bg-dark);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color-dark);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-faq__brand-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-faq__brand-item-icon {
  width: 100px; /* Đảm bảo kích thước lớn, không phải icon nhỏ */
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 8px var(--primary-color));
}

.page-faq__brand-item-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.page-faq__brand-item-text {
  font-size: 15px;
  color: var(--text-light);
  opacity: 0.9;
  line-height: 1.7;
}

/* Blog Section */
.page-faq__blog-section {
  padding: 80px 0;
  background-color: var(--bg-dark);
}

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

.page-faq__blog-item {
  background: var(--card-bg-dark);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color-dark);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-faq__blog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-faq__blog-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-faq__blog-item-image {
  width: 100%;
  height: 200px; /* Kích thước hình ảnh lớn */
  object-fit: cover;
  border-bottom: 1px solid var(--border-color-dark);
}

.page-faq__blog-item-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
  margin: 20px 20px 10px 20px;
  flex-grow: 1;
}

.page-faq__blog-item-excerpt {
  font-size: 15px;
  color: var(--text-light);
  margin: 0 20px 15px 20px;
  opacity: 0.8;
}

.page-faq__blog-item-date {
  font-size: 14px;
  color: #aaa;
  margin: 0 20px 20px 20px;
  display: block;
  text-align: right;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-faq__main-title {
    font-size: 42px;
  }
  .page-faq__section-title {
    font-size: 32px;
  }
  .page-faq__brand-item-title {
    font-size: 22px;
  }
  .page-faq__blog-item-title {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .page-faq__hero-section {
    padding-top: 100px !important; /* Mobile: Điều chỉnh dựa trên chiều cao header */
    padding-bottom: 40px;
  }

  .page-faq__container {
    padding: 0 15px !important;
  }

  .page-faq__main-title {
    font-size: 36px;
  }

  .page-faq__hero-description {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-faq__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-faq__cta-button {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 25px !important;
    font-size: 16px !important;
  }

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

  .page-faq__section-description {
    font-size: 15px;
    margin-bottom: 30px;
  }

  .page-faq__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-faq__faq-question h3 {
    font-size: 16px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  
  .page-faq__faq-toggle {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
  
  .page-faq__faq-answer {
    padding: 0 15px;
  }
  
  .page-faq__faq-item.active .page-faq__faq-answer {
    padding: 15px !important;
  }

  .page-faq__brand-section, .page-faq__blog-section {
    padding: 40px 0;
  }

  .page-faq__brand-content, .page-faq__blog-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .page-faq__brand-item-icon {
    width: 80px;
  }
  
  .page-faq__blog-item-image {
    height: 180px;
  }

  .page-faq img, .page-faq video {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  .page-faq__section, .page-faq__card, .page-faq__container, .page-faq__blog-item, .page-faq__brand-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-faq__faq-list {
    max-width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box !important;
  }
  .page-faq__faq-item {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}