.page-affiliate-program {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
  background-color: var(--dark-bg); /* Inherit from shared.css, assuming a dark background */
}

/* Ensure text is readable on dark body background */
.page-affiliate-program, .page-affiliate-program p, .page-affiliate-program li, .page-affiliate-program h1, .page-affiliate-program h2, .page-affiliate-program h3, .page-affiliate-program h4, .page-affiliate-program h5, .page-affiliate-program h6 {
  color: #ffffff;
}

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

.page-affiliate-program__section-title {
  font-size: 2.5em;
  color: #26A9E0;
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

.page-affiliate-program__section-description {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #f0f0f0; /* Lighter text for dark sections */
}

.page-affiliate-program__cta-wrapper {
  text-align: center;
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.page-affiliate-program__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-affiliate-program__btn-primary {
  background-color: #26A9E0;
  color: #ffffff;
  border: 2px solid #26A9E0;
}

.page-affiliate-program__btn-primary:hover {
  background-color: #1a8cc2;
  border-color: #1a8cc2;
}

.page-affiliate-program__btn-secondary {
  background-color: transparent;
  color: #26A9E0;
  border: 2px solid #26A9E0;
}

.page-affiliate-program__btn-secondary:hover {
  background-color: #26A9E0;
  color: #ffffff;
}

/* Hero Section */
.page-affiliate-program__hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 80px 0;
  padding-top: var(--header-offset, 120px);
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background-color: var(--dark-bg); /* Ensure dark background for hero */
}

.page-affiliate-program__hero-content {
  flex: 1;
  padding: 0 40px;
  max-width: 600px;
  z-index: 1;
}

.page-affiliate-program__hero-title {
  font-size: 3.5em;
  margin-bottom: 20px;
  color: #FFFFFF; 
  line-height: 1.2;
}

.page-affiliate-program__hero-description {
  font-size: 1.3em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-affiliate-program__hero-image-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 40px;
}

.page-affiliate-program__hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Advantages Section */
.page-affiliate-program__advantages-section {
  padding: 80px 0;
  background-color: #ffffff; /* Light background */
  color: #333333; /* Dark text for light background */
}

.page-affiliate-program__advantages-section .page-affiliate-program__section-title {
  color: #26A9E0;
}

.page-affiliate-program__advantages-section .page-affiliate-program__section-description {
  color: #555555;
}

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

.page-affiliate-program__advantage-card {
  background-color: #f8f8f8;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  color: #333333;
}

.page-affiliate-program__advantage-card:hover {
  transform: translateY(-10px);
}

.page-affiliate-program__card-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  object-fit: cover;
}

.page-affiliate-program__card-title {
  font-size: 1.5em;
  margin-bottom: 15px;
  color: #26A9E0;
  font-weight: bold;
}

.page-affiliate-program__card-text {
  font-size: 1em;
  color: #555555;
}

/* How It Works Section */
.page-affiliate-program__how-it-works-section {
  padding: 80px 0;
  color: #ffffff;
  background-color: #1a1a1a; /* Darker background */
}

.page-affiliate-program__how-it-works-section .page-affiliate-program__section-title {
  color: #FFFFFF;
}

.page-affiliate-program__how-it-works-section .page-affiliate-program__section-description {
  color: #f0f0f0;
}

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

.page-affiliate-program__step-card {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.page-affiliate-program__step-icon {
  font-size: 2.5em;
  color: #26A9E0;
  margin-bottom: 20px;
  font-weight: bold;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

/* Commission Structure Section */
.page-affiliate-program__commission-structure-section {
  padding: 80px 0;
  background-color: #ffffff;
  color: #333333;
}

.page-affiliate-program__commission-structure-section .page-affiliate-program__section-title {
  color: #26A9E0;
}

.page-affiliate-program__commission-structure-section .page-affiliate-program__section-description {
  color: #555555;
}

.page-affiliate-program__table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.page-affiliate-program__commission-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  background-color: #f8f8f8;
  border-radius: 10px;
  overflow: hidden;
}

.page-affiliate-program__commission-table th,
.page-affiliate-program__commission-table td {
  padding: 15px;
  border: 1px solid #e0e0e0;
  text-align: left;
  color: #333333;
}

.page-affiliate-program__commission-table th {
  background-color: #26A9E0;
  color: #ffffff;
  font-weight: bold;
  white-space: nowrap;
}

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

.page-affiliate-program__note {
  text-align: center;
  font-style: italic;
  color: #666666;
  margin-top: 20px;
}

/* FAQ Section */
.page-affiliate-program__faq-section {
  padding: 80px 0;
  background-color: #1a1a1a;
  color: #ffffff;
}

.page-affiliate-program__faq-section .page-affiliate-program__section-title {
  color: #FFFFFF;
}

.page-affiliate-program__faq-section .page-affiliate-program__section-description {
  color: #f0f0f0;
}

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

.page-affiliate-program__faq-item {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-affiliate-program__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease;
}

.page-affiliate-program__faq-question:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.page-affiliate-program__faq-title {
  margin: 0;
  color: #ffffff;
}

.page-affiliate-program__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.3s ease;
}

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

.page-affiliate-program__faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: #f0f0f0;
}

.page-affiliate-program__faq-item.active .page-affiliate-program__faq-answer {
  max-height: 1000px !important; /* Sufficiently large to show all content */
  padding: 15px 20px;
}

.page-affiliate-program__faq-answer p {
  margin: 0;
  color: #f0f0f0;
}

/* Contact Section */
.page-affiliate-program__contact-section {
  padding: 80px 0;
  background-color: #ffffff;
  color: #333333;
}

.page-affiliate-program__contact-section .page-affiliate-program__section-title {
  color: #26A9E0;
}

.page-affiliate-program__contact-section .page-affiliate-program__section-description {
  color: #555555;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-affiliate-program__hero-section {
    flex-direction: column;
    text-align: center;
  }

  .page-affiliate-program__hero-content {
    max-width: 100%;
    padding: 0 20px;
    margin-bottom: 40px;
  }

  .page-affiliate-program__hero-title {
    font-size: 3em;
  }

  .page-affiliate-program__hero-image-wrapper {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .page-affiliate-program {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-affiliate-program__hero-section {
    padding: 60px 0;
    padding-top: var(--header-offset, 120px) !important; /* Apply header offset */
  }

  .page-affiliate-program__hero-title {
    font-size: 2.2em;
  }

  .page-affiliate-program__hero-description {
    font-size: 1.1em;
  }

  .page-affiliate-program__section-title {
    font-size: 2em;
  }

  .page-affiliate-program__section-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .page-affiliate-program__advantages-grid,
  .page-affiliate-program__steps-grid {
    grid-template-columns: 1fr;
  }

  .page-affiliate-program__advantage-card,
  .page-affiliate-program__step-card,
  .page-affiliate-program__faq-item {
    padding: 20px;
  }

  .page-affiliate-program__card-title {
    font-size: 1.3em;
  }

  .page-affiliate-program__cta-wrapper {
    flex-direction: column;
    gap: 15px;
  }

  .page-affiliate-program__cta-button {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px;
    font-size: 1em;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Images responsiveness */
  .page-affiliate-program img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-affiliate-program__hero-image-wrapper,
  .page-affiliate-program__advantages-section .page-affiliate-program__container,
  .page-affiliate-program__how-it-works-section .page-affiliate-program__container,
  .page-affiliate-program__commission-structure-section .page-affiliate-program__container,
  .page-affiliate-program__faq-section .page-affiliate-program__container,
  .page-affiliate-program__contact-section .page-affiliate-program__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
  }

  /* Ensure table is scrollable if too wide */
  .page-affiliate-program__table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  .page-affiliate-program__commission-table {
    min-width: 600px; /* Ensure table content is readable */
  }
}

/* Dark background for specific sections */
.page-affiliate-program__dark-section {
  background-color: #1a1a1a; /* Consistent dark background */
  color: #ffffff;
}

.page-affiliate-program__dark-section .page-affiliate-program__section-title {
  color: #FFFFFF;
}

.page-affiliate-program__dark-section .page-affiliate-program__section-description {
  color: #f0f0f0;
}

.page-affiliate-program__dark-section .page-affiliate-program__card-title {
  color: #26A9E0;
}

.page-affiliate-program__dark-section .page-affiliate-program__card-text {
  color: #cccccc;
}

/* Ensure contrast for main content area if not dark section */
.page-affiliate-program__content-area {
  color: #333333; /* Dark text for light background */
  background: #ffffff; /* Default white background */
}

.page-affiliate-program p, .page-affiliate-program li {
  color: inherit;
}

.page-affiliate-program__card {
  background: #ffffff; /* White background for cards in light sections */
  color: #333333;
  border: 1px solid #e0e0e0;
}

.page-affiliate-program__dark-section .page-affiliate-program__card {
  background: rgba(255, 255, 255, 0.08); /* Semi-transparent white for cards in dark sections */
  color: #ffffff;
  border: none;
}

/* Login button specific styling if needed */
.page-affiliate-program__btn-login {
  background-color: #EA7C07;
  color: #ffffff;
  border: 2px solid #EA7C07;
}

.page-affiliate-program__btn-login:hover {
  background-color: #c96706;
  border-color: #c96706;
}