/* style/affiliate-program.css */

/* --- Base Styles --- */
.page-affiliate-program {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Dark text for light body background */
  line-height: 1.6;
  background-color: #f4f4f4; /* Consistent with body background */
}

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

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

.page-affiliate-program__section-title {
  font-size: 36px;
  color: #0A2239; /* Brand primary color */
  margin-bottom: 40px;
  font-weight: bold;
}

.page-affiliate-program__text-block {
  font-size: 18px;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* --- 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); /* Fixed header offset */
  background-color: #f4f4f4; /* Match body background */
  overflow: hidden; /* Ensure no overflow from absolute elements */
}

.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;
}

.page-affiliate-program__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.page-affiliate-program__main-title {
  font-size: 48px;
  color: #0A2239; /* Brand primary color */
  margin-bottom: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.page-affiliate-program__intro-description {
  font-size: 22px;
  color: #555555;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-affiliate-program__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #E0B020; /* Brand accent color */
  color: #0A2239; /* Dark text for gold background */
  text-decoration: none;
  border-radius: 50px;
  font-size: 20px;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(224, 176, 32, 0.4);
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-affiliate-program__cta-button:hover {
  background: #d4a31e; /* Slightly darker gold on hover */
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(224, 176, 32, 0.6);
}

.page-affiliate-program__cta-button--secondary {
  background: #0A2239; /* Brand primary color */
  color: #E0B020; /* Gold text for dark blue background */
  box-shadow: 0 5px 15px rgba(10, 34, 57, 0.4);
}

.page-affiliate-program__cta-button--secondary:hover {
  background: #1a3a5e; /* Slightly lighter dark blue on hover */
  box-shadow: 0 8px 20px rgba(10, 34, 57, 0.6);
}

.page-affiliate-program__cta-button--large {
  padding: 20px 60px;
  font-size: 24px;
}

.page-affiliate-program__cta-center {
  margin-top: 40px;
}

/* --- Why Join Section --- */
.page-affiliate-program__why-join {
  background-color: #ffffff;
}

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

.page-affiliate-program__card {
  background: #fdfdfd;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-affiliate-program__card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-affiliate-program__card img {
  width: 100%; /* Card image takes full width of card */
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 25px;
  display: block;
  max-width: 100%;
}

.page-affiliate-program__card-title {
  font-size: 24px;
  color: #0A2239;
  margin-bottom: 15px;
  font-weight: bold;
}

.page-affiliate-program__card-text {
  font-size: 16px;
  color: #666666;
  text-align: left;
}

/* --- How It Works Section --- */
.page-affiliate-program__dark-bg {
  background-color: #0A2239; /* Brand primary color */
  color: #ffffff; /* White text for dark background */
}

.page-affiliate-program__how-it-works .page-affiliate-program__section-title {
  color: #E0B020; /* Gold text for dark background */
}

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

.page-affiliate-program__step-item {
  background: rgba(255, 255, 255, 0.1); /* Slightly transparent white for dark background */
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

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

.page-affiliate-program__step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #E0B020; /* Gold accent */
  color: #0A2239; /* Dark text for gold */
  border-radius: 50%;
  font-size: 30px;
  font-weight: bold;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(224, 176, 32, 0.5);
}

.page-affiliate-program__step-title {
  font-size: 26px;
  color: #E0B020; /* Gold text */
  margin-bottom: 15px;
  font-weight: bold;
}

.page-affiliate-program__step-description {
  font-size: 17px;
  color: #f0f0f0;
}

/* --- Commission Structure Section --- */
.page-affiliate-program__commission-structure {
  background-color: #f4f4f4;
}

.page-affiliate-program__table-wrapper {
  overflow-x: auto;
  margin-top: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.page-affiliate-program__commission-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Ensure table is wide enough for content on smaller screens */
  text-align: left;
  background-color: #ffffff;
}

.page-affiliate-program__commission-table th,
.page-affiliate-program__commission-table td {
  padding: 15px 20px;
  border: 1px solid #e0e0e0;
  font-size: 17px;
}

.page-affiliate-program__commission-table th {
  background-color: #0A2239; /* Brand primary color */
  color: #E0B020; /* Gold text */
  font-weight: bold;
  text-transform: uppercase;
}

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

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

.page-affiliate-program__note {
  font-size: 15px;
  color: #777777;
  margin-top: 20px;
  text-align: left;
}

/* --- FAQ Section --- */
.page-affiliate-program__faq {
  background-color: #ffffff;
}

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

/* FAQ container style */
.page-affiliate-program__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* FAQ default state - answer hidden */
.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 20px;
  opacity: 0;
  background: #f9f9f9;
  color: #555555;
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height */
.page-affiliate-program__faq-item.active .page-affiliate-program__faq-answer {
  max-height: 2000px !important; /* 🚨 Use !important for priority, large value for content */
  padding: 20px !important;
  opacity: 1;
  border-radius: 0 0 8px 8px;
}

/* Question style */
.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: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-affiliate-program__faq-item.active .page-affiliate-program__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: #d0d0d0;
  background: #f5f5f5;
}

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

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

/* Question title style */
.page-affiliate-program__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: #0A2239;
  pointer-events: none; /* Prevent h3 from blocking click events */
}

/* Toggle icon */
.page-affiliate-program__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #E0B020; /* Gold accent */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click events */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-affiliate-program__faq-item.active .page-affiliate-program__faq-toggle {
  color: #0A2239; /* Dark blue when active */
  transform: rotate(45deg); /* Plus to X visual */
}

/* --- Final CTA Section --- */
.page-affiliate-program__final-cta {
  padding: 80px 0;
}

.page-affiliate-program__final-cta .page-affiliate-program__section-title {
  color: #E0B020;
}

.page-affiliate-program__final-cta .page-affiliate-program__text-block {
  color: #f0f0f0;
}

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

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

  .page-affiliate-program__intro-description {
    font-size: 18px;
  }

  .page-affiliate-program__cta-button {
    padding: 12px 30px;
    font-size: 18px;
    width: 100% !important; /* Buttons full width on mobile */
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  .page-affiliate-program__cta-button--large {
    padding: 15px 40px;
    font-size: 20px;
  }

  .page-affiliate-program__section {
    padding: 40px 0;
  }

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

  .page-affiliate-program__text-block {
    font-size: 16px;
    margin-bottom: 20px;
  }

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

  .page-affiliate-program__card {
    padding: 20px;
  }

  .page-affiliate-program__card img {
    height: auto; /* Allow height to adjust for mobile */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

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

  .page-affiliate-program__step-item {
    padding: 25px;
  }

  .page-affiliate-program__step-title {
    font-size: 22px;
  }

  .page-affiliate-program__commission-table th,
  .page-affiliate-program__commission-table td {
    padding: 12px 15px;
    font-size: 15px;
  }

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

  /* Ensure all images are responsive */
  .page-affiliate-program img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-affiliate-program__section,
  .page-affiliate-program__card,
  .page-affiliate-program__container,
  .page-affiliate-program__table-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}