/* style/affiliate-program.css */

/* Variables for consistent styling */
:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --button-register-bg: #C30808;
  --button-register-text: #FFFF00;
  --background-light: #f9f9f9;
  --border-color: #e0e0e0;
}

/* Base styles for the page content */
.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 light background */
}

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

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

.page-affiliate-program__section-title {
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

.page-affiliate-program__text-block {
  font-size: 18px;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-dark);
}

.page-affiliate-program__cta-button,
.page-affiliate-program__btn-secondary {
  display: inline-block;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin: 10px;
  cursor: pointer;
  box-sizing: border-box; /* Ensure padding doesn't expand width */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-affiliate-program__cta-button {
  background-color: var(--button-register-bg); /* Custom register button background */
  color: var(--button-register-text); /* Custom register button text color */
  border: 2px solid var(--button-register-bg);
}

.page-affiliate-program__cta-button:hover {
  background-color: #a40707; /* Darken #C30808 */
  border-color: #a40707;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

.page-affiliate-program__link {
  color: var(--primary-color);
  text-decoration: underline;
}

.page-affiliate-program__link:hover {
  color: #005a2e; /* Darken #017439 */
}

/* 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 for fixed header */
  background: linear-gradient(135deg, var(--primary-color) 0%, #a7d9b9 100%); /* Green gradient */
  color: var(--text-light);
}

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

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

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

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

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

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

/* Why Partner Section */
.page-affiliate-program__why-partner {
  background-color: var(--background-light);
  color: var(--text-dark);
}

.page-affiliate-program__why-partner .page-affiliate-program__section-title {
  color: var(--primary-color);
}

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

.page-affiliate-program__feature-item {
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  background-color: var(--secondary-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease;
}

.page-affiliate-program__feature-item:hover {
  transform: translateY(-5px);
}

.page-affiliate-program__feature-icon {
  width: 100%; /* Ensure image fills card width */
  max-width: 250px; /* Max width for smaller images in card */
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  object-fit: cover;
  min-width: 200px; /* Min size for card images */
  min-height: 150px;
}

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

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

/* Commission Structure Section */
.page-affiliate-program__dark-section {
  background-color: var(--primary-color);
  color: var(--text-light);
}

.page-affiliate-program__dark-section .page-affiliate-program__section-title {
  color: var(--secondary-color);
}

.page-affiliate-program__dark-section .page-affiliate-program__text-block {
  color: var(--text-light);
}

.page-affiliate-program__commission-table {
  width: 100%;
  overflow-x: auto; /* For responsive tables */
  margin-top: 40px;
  margin-bottom: 30px;
}

.page-affiliate-program__commission-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Ensure table is readable on smaller screens */
  background-color: var(--secondary-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-affiliate-program__commission-table th,
.page-affiliate-program__commission-table td {
  padding: 15px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
}

.page-affiliate-program__commission-table th {
  background-color: var(--primary-color);
  color: var(--text-light);
  font-weight: bold;
  font-size: 18px;
}

.page-affiliate-program__commission-table tr:nth-child(even) {
  background-color: #f5f5f5;
}

.page-affiliate-program__commission-table tr:hover {
  background-color: #e0f2f7;
}

.page-affiliate-program__note {
  font-size: 15px;
  color: var(--text-light);
  margin-top: 20px;
}

/* How to Start Section */
.page-affiliate-program__how-to-start {
  background-color: var(--secondary-color);
  color: var(--text-dark);
}

.page-affiliate-program__how-to-start .page-affiliate-program__section-title {
  color: var(--primary-color);
}

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

.page-affiliate-program__step-item {
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  background-color: var(--background-light);
  text-align: left;
  position: relative;
  transition: transform 0.3s ease;
}

.page-affiliate-program__step-item:hover {
  transform: translateY(-5px);
}

.page-affiliate-program__step-number {
  font-size: 48px;
  font-weight: bold;
  color: var(--primary-color);
  position: absolute;
  top: 15px;
  right: 20px;
  opacity: 0.1;
  line-height: 1;
}

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

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

.page-affiliate-program__button-group {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  justify-content: center;
  gap: 20px;
}

/* FAQ Section */
.page-affiliate-program__faq {
  background-color: var(--background-light);
  color: var(--text-dark);
}

.page-affiliate-program__faq .page-affiliate-program__section-title {
  color: var(--primary-color);
}

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

/* FAQ容器样式 */
.page-affiliate-program__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* 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, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.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 đề kiểu dáng */
.page-affiliate-program__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

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

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

/* Kiểu dáng tiêu đề câu hỏi */
.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);
}

/* Biểu tượng chuyển đổi */
.page-affiliate-program__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  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); /* Thay đổi thành X hoặc xoay */
}

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

.page-affiliate-program__cta-bottom .page-affiliate-program__section-title {
  font-size: 40px;
}

.page-affiliate-program__center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Image specific styles - ensuring no filters */
.page-affiliate-program img {
  border: none; /* No default borders */
  filter: none; /* Ensure no CSS filters are applied */
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-affiliate-program__main-title {
    font-size: 40px;
  }
  .page-affiliate-program__section-title {
    font-size: 32px;
  }
  .page-affiliate-program__text-block,
  .page-affiliate-program__description {
    font-size: 17px;
  }
  .page-affiliate-program__cta-button,
  .page-affiliate-program__btn-secondary {
    padding: 12px 30px;
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  /* Mobile specific adjustments */
  .page-affiliate-program {
    font-size: 16px;
    line-height: 1.6;
  }
  
  .page-affiliate-program__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile header offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-affiliate-program__main-title {
    font-size: 32px;
  }

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

  .page-affiliate-program__hero-image img,
  .page-affiliate-program img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 4px;
  }

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

  .page-affiliate-program__features-grid,
  .page-affiliate-program__steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .page-affiliate-program__feature-icon {
    min-width: 200px; /* Ensure minimum image size even on mobile */
    min-height: 150px;
  }

  /* Button responsiveness */
  .page-affiliate-program__cta-button,
  .page-affiliate-program__btn-secondary,
  .page-affiliate-program a[class*="button"],
  .page-affiliate-program a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-affiliate-program__button-group {
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 10px;
  }

  /* FAQ mobile styles */
  .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;
  }

  .page-affiliate-program__commission-table table {
    min-width: 100%; /* Make table scrollable if needed, but try to fit */
  }
}

/* Color contrast fixes if needed */
.page-affiliate-program__contrast-fix {
  background: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
}

.page-affiliate-program__text-contrast-fix {
  color: #333333 !important;
  text-shadow: none !important;
}