/* style/affiliate-program.css */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --accent-color: #017439; /* Assuming body background is a dark variant of primary */
  --text-dark: #333333;
  --text-light: #ffffff;
  --button-register-bg: #C30808;
  --button-login-bg: #C30808;
  --button-text-yellow: #FFFF00;
}

.page-affiliate-program {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default text color for light backgrounds */
  background-color: var(--secondary-color); /* Default page background is white */
}

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

.page-affiliate-program__text-center {
  text-align: center;
}

.page-affiliate-program__dark-bg {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.page-affiliate-program__light-bg {
  background-color: var(--secondary-color);
  color: var(--text-dark);
}

.page-affiliate-program__section-title {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  color: inherit; /* Inherit from parent section for contrast */
}

.page-affiliate-program__section-intro {
  font-size: 18px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: inherit;
}

/* HERO Section */
.page-affiliate-program__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); /* Ensure space below fixed header */
  background-color: var(--primary-color);
  color: var(--text-light);
  overflow: hidden;
}

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

.page-affiliate-program__hero-image {
  width: 100%;
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.page-affiliate-program__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
}

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

.page-affiliate-program__hero-title {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--text-light);
}

.page-affiliate-program__hero-description {
  font-size: 20px;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-light);
}

.page-affiliate-program__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-register-bg);
  color: var(--button-text-yellow);
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

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

.page-affiliate-program__cta-button--centered {
  margin-left: auto;
  margin-right: auto;
  display: block;
  max-width: fit-content;
}

/* Why Partner Section */
.page-affiliate-program__why-partner-section {
  padding: 80px 0;
}

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

.page-affiliate-program__feature-item {
  background-color: var(--secondary-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-affiliate-program__feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.page-affiliate-program__feature-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 20px;
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

.page-affiliate-program__feature-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-affiliate-program__feature-description {
  font-size: 16px;
  color: var(--text-dark);
}

/* Commission Section */
.page-affiliate-program__commission-section {
  padding: 80px 0;
}

.page-affiliate-program__commission-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.page-affiliate-program__tier-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

.page-affiliate-program__tier-item:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.page-affiliate-program__tier-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--button-text-yellow);
}

.page-affiliate-program__tier-description {
  font-size: 16px;
  color: var(--text-light);
}

.page-affiliate-program__commission-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 50px auto 30px auto;
  border-radius: 8px;
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

.page-affiliate-program__disclaimer {
  font-size: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 20px;
}

/* Marketing Tools Section */
.page-affiliate-program__tools-section {
  padding: 80px 0;
}

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

.page-affiliate-program__tool-item {
  background-color: var(--secondary-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.page-affiliate-program__tool-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 20px;
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

.page-affiliate-program__tool-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-affiliate-program__tool-description {
  font-size: 16px;
  color: var(--text-dark);
}

/* Support Section */
.page-affiliate-program__support-section {
  padding: 80px 0;
}

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

.page-affiliate-program__support-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.page-affiliate-program__support-item img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 20px;
  object-fit: cover;
  min-width: 200px;
  min-height: 200px;
}

.page-affiliate-program__support-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--button-text-yellow);
}

.page-affiliate-program__support-description {
  font-size: 16px;
  color: var(--text-light);
}

/* How to Join Section */
.page-affiliate-program__how-to-join-section {
  padding: 80px 0;
}

.page-affiliate-program__steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.page-affiliate-program__step-item {
  background-color: var(--secondary-color);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.page-affiliate-program__step-number {
  font-size: 48px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 15px;
  line-height: 1;
}

.page-affiliate-program__step-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-affiliate-program__step-description {
  font-size: 16px;
  color: var(--text-dark);
}

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

.page-affiliate-program__faq-list {
  margin-top: 50px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* FAQ容器样式 */
.page-affiliate-program__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  background-color: var(--secondary-color);
  border: 1px solid #e0e0e0;
}

/* FAQ默认状态 - 答案隐藏 */
.page-affiliate-program__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 15px;
  opacity: 0;
  color: var(--text-dark);
}

/* FAQ展开状态 - 🚨 使用!important và đủ lớn max-height để đảm bảo có thể mở rộng */
.page-affiliate-program__faq-item.active .page-affiliate-program__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 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Vấn đề phong cách */
.page-affiliate-program__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  border: none; /* Remove border from FAQ question as item has one */
}

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

.page-affiliate-program__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

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

/* Vấn đề tiêu đề phong cách */
.page-affiliate-program__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn thẻ h3 chặn sự kiện nhấp */
  color: var(--text-dark);
}

/* Chuyển đổi biểu tượng */
.page-affiliate-program__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; /* Ngăn biểu tượng chặn sự kiện nhấp */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-affiliate-program__faq-item.active .page-affiliate-program__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg);
}

/* CTA Bottom Section */
.page-affiliate-program__cta-bottom-section {
  padding: 80px 0;
  text-align: center;
}

.page-affiliate-program__btn-secondary {
  display: inline-block;
  padding: 15px 40px;
  background: transparent;
  color: var(--primary-color);
  text-decoration: none;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-affiliate-program__btn-secondary:hover {
  background: var(--primary-color);
  color: var(--secondary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-affiliate-program__btn-secondary--margin-top {
  margin-top: 20px;
  margin-left: 20px;
}

/* Global Image Rules */
.page-affiliate-program img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-width: 200px; /* Enforce min size for all images */
  min-height: 200px;
  border-radius: 8px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .page-affiliate-program__container {
    padding: 20px 15px;
  }

  .page-affiliate-program__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile specific header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  .page-affiliate-program__hero-description {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .page-affiliate-program__cta-button,
  .page-affiliate-program__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 20px;
    font-size: 16px;
    margin-top: 15px;
  }

  .page-affiliate-program__btn-secondary--margin-top {
    margin-left: 0;
  }

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

  .page-affiliate-program__section-intro {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .page-affiliate-program__features-grid,
  .page-affiliate-program__commission-tiers,
  .page-affiliate-program__tools-grid,
  .page-affiliate-program__support-details,
  .page-affiliate-program__steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-affiliate-program__feature-item,
  .page-affiliate-program__tier-item,
  .page-affiliate-program__tool-item,
  .page-affiliate-program__support-item,
  .page-affiliate-program__step-item {
    padding: 20px;
  }

  .page-affiliate-program__feature-title,
  .page-affiliate-program__tier-title,
  .page-affiliate-program__tool-title,
  .page-affiliate-program__support-title,
  .page-affiliate-program__step-title {
    font-size: 20px;
  }

  .page-affiliate-program__feature-description,
  .page-affiliate-program__tier-description,
  .page-affiliate-program__tool-description,
  .page-affiliate-program__support-description,
  .page-affiliate-program__step-description {
    font-size: 15px;
  }

  .page-affiliate-program img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: unset;
    min-height: unset;
  }

  .page-affiliate-program__section,
  .page-affiliate-program__card,
  .page-affiliate-program__container,
  .page-affiliate-program__hero-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

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