.page-affiliates {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Default text color for light backgrounds */
  line-height: 1.6;
}

.page-affiliates__dark-bg {
  background-color: #017439; /* Primary brand color */
  color: #ffffff; /* White text for dark backgrounds */
}

.page-affiliates__light-bg {
  background-color: #ffffff; /* Auxiliary brand color / Default white */
  color: #333333; /* Dark text for light backgrounds */
}

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

.page-affiliates__section-title {
  font-size: 36px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: #017439;
}

.page-affiliates__section-title--light {
  color: #ffffff;
}

.page-affiliates__text-block {
  font-size: 17px;
  margin-bottom: 20px;
  text-align: justify;
}

.page-affiliates__text-block--light {
  color: #f0f0f0;
}

.page-affiliates__text-link {
  color: #017439;
  text-decoration: underline;
}

.page-affiliates__text-link:hover {
  color: #005a2d;
}

.page-affiliates__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  text-align: center;
  cursor: pointer;
}

.page-affiliates__cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-affiliates__btn-primary {
  background: #017439;
  color: #ffffff;
  border: 2px solid transparent;
}

.page-affiliates__btn-primary:hover {
  background: #005a2d;
}

/* Specific colors for Register/Login buttons */
.page-affiliates__btn-register {
  background: #C30808;
  color: #FFFF00;
  border: 2px solid transparent;
}

.page-affiliates__btn-register:hover {
  background: #a30606;
  color: #fff;
}

.page-affiliates__btn-secondary {
  background: #ffffff;
  color: #017439;
  border: 2px solid #017439;
}

.page-affiliates__btn-secondary:hover {
  background: #f0f0f0;
  color: #005a2d;
  border-color: #005a2d;
}

/* HERO Section */
.page-affiliates__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); /* Fixed header offset */
  overflow: hidden;
}

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

.page-affiliates__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.page-affiliates__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.7); /* Darken image for text readability */
}

.page-affiliates__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  padding: 20px;
}

.page-affiliates__hero-title {
  font-size: 52px;
  font-weight: bold;
  color: #FFFF00; /* Yellow for prominence */
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-affiliates__hero-description {
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

/* Benefits Grid */
.page-affiliates__benefits-grid, .page-affiliates__tools-grid, .page-affiliates__steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.page-affiliates__card {
  background: #ffffff;
  color: #333333;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e0e0e0;
}

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

.page-affiliates__benefit-title, .page-affiliates__tool-title, .page-affiliates__step-title {
  font-size: 22px;
  font-weight: bold;
  color: #017439;
  margin-bottom: 15px;
}

.page-affiliates__benefit-description, .page-affiliates__tool-description, .page-affiliates__step-description {
  font-size: 16px;
  color: #555555;
  text-align: justify;
}

/* Commission Section */
.page-affiliates__commission-details {
  margin-top: 30px;
  background: #f9f9f9;
  padding: 30px;
  border-radius: 12px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-affiliates__commission-subtitle {
  font-size: 24px;
  color: #017439;
  margin-top: 25px;
  margin-bottom: 15px;
  text-align: center;
}

.page-affiliates__commission-list {
  list-style-type: disc;
  padding-left: 40px;
  margin-bottom: 20px;
  font-size: 17px;
}

.page-affiliates__commission-list li {
  margin-bottom: 10px;
}

.page-affiliates__image-container {
  text-align: center;
  margin: 40px 0;
}

.page-affiliates__content-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  display: block;
  margin: 0 auto;
}

.page-affiliates__cta-group {
  text-align: center;
  margin-top: 50px;
}

/* How To Join Steps */
.page-affiliates__step-item {
  position: relative;
  padding-top: 60px; /* Space for step number */
}

.page-affiliates__step-number {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #017439;
  color: #ffffff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* FAQ Section */
.page-affiliates__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

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

/* FAQ默认状态 - 答案隐藏 */
.page-affiliates__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: #f9f9f9;
  color: #333333;
  border-top: 1px solid #e0e0e0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-affiliates__faq-item.active .page-affiliates__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important đảm bảo ưu tiên, giá trị đủ lớn để chứa mọi nội dung */
  padding: 20px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

/* 问题样式 */
.page-affiliates__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  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;
  color: #333333;
}

.page-affiliates__faq-item.active .page-affiliates__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: #017439;
}

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

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

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

/* 切换图标 */
.page-affiliates__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #017439;
  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-affiliates__faq-item.active .page-affiliates__faq-toggle {
  color: #C30808;
  transform: rotate(45deg); /* Change to minus sign visually */
}

/* Final CTA Section */
.page-affiliates__cta-final-section {
  padding-top: 60px;
  padding-bottom: 80px;
  text-align: center;
}

/* Global Image Styles */
.page-affiliates img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-affiliates__hero-title {
    font-size: 44px;
  }
  .page-affiliates__hero-description {
    font-size: 18px;
  }
  .page-affiliates__section-title {
    font-size: 30px;
  }
  .page-affiliates__benefit-title, .page-affiliates__tool-title, .page-affiliates__step-title {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .page-affiliates__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
  }
  .page-affiliates__hero-title {
    font-size: 36px;
  }
  .page-affiliates__hero-description {
    font-size: 16px;
  }
  .page-affiliates__section-title {
    font-size: 26px;
    margin-bottom: 30px;
  }
  .page-affiliates__text-block {
    font-size: 16px;
  }
  .page-affiliates__cta-button {
    padding: 12px 30px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  .page-affiliates__cta-group {
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-affiliates__benefits-grid, .page-affiliates__tools-grid, .page-affiliates__steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-affiliates__card {
    padding: 25px;
  }
  .page-affiliates__commission-details {
    padding: 20px;
  }
  .page-affiliates__commission-subtitle {
    font-size: 20px;
  }
  .page-affiliates__commission-list {
    padding-left: 30px;
    font-size: 16px;
  }
  .page-affiliates__image-container {
    padding: 0 15px;
  }
  .page-affiliates__content-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-affiliates__faq-question h3 {
    font-size: 16px;
  }
  .page-affiliates__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }
  .page-affiliates__faq-item.active .page-affiliates__faq-answer {
    padding: 15px !important;
  }
  .page-affiliates__container {
    padding: 30px 15px;
  }
  .page-affiliates__step-number {
    width: 45px;
    height: 45px;
    font-size: 24px;
  }
  .page-affiliates__hero-image {
    filter: brightness(0.6); /* Slightly darker for mobile */
  }
}

@media (max-width: 480px) {
  .page-affiliates__hero-title {
    font-size: 30px;
  }
  .page-affiliates__hero-description {
    font-size: 15px;
  }
  .page-affiliates__section-title {
    font-size: 22px;
  }
  .page-affiliates__cta-button {
    padding: 10px 25px;
    font-size: 15px;
  }
  .page-affiliates__faq-question h3 {
    font-size: 15px;
  }
  .page-affiliates__faq-toggle {
    font-size: 22px;
    width: 26px;
    height: 26px;
  }
}

/* Ensure content images meet minimum size requirements */
.page-affiliates__content-area img, .page-affiliates__card img, .page-affiliates__image-container img {
  min-width: 200px;
  min-height: 200px;
  object-fit: cover;
}

/* No filter on images */
.page-affiliates img {
  filter: none; /* Ensure no CSS filter is applied by default */
}

/* Hero image has a specific filter for text readability, not color change */
.page-affiliates__hero-image {
  filter: brightness(0.7); 
}

/* Content area images CSS size lower limit */
.page-affiliates__intro-section img,
.page-affiliates__why-partner-section img,
.page-affiliates__commission-section img,
.page-affiliates__tools-section img,
.page-affiliates__how-to-join-section img,
.page-affiliates__cta-final-section img {
  min-width: 200px;
  min-height: 200px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .page-affiliates__intro-section img,
  .page-affiliates__why-partner-section img,
  .page-affiliates__commission-section img,
  .page-affiliates__tools-section img,
  .page-affiliates__how-to-join-section img,
  .page-affiliates__cta-final-section img {
    min-width: 200px !important;
    min-height: 200px !important;
  }
}