/* style/about.css */

/* --- Base Styles --- */
.page-about {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light body background */
  background-color: var(--secondary-color); /* Matches body background from shared.css */
}

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

.page-about__container--center {
  text-align: center;
}

.page-about__container--flex {
  display: flex;
  align-items: center;
  gap: 40px;
}

.page-about__container--reverse {
  flex-direction: row-reverse;
}

.page-about__section-title {
  font-size: 36px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 30px;
  text-align: center;
}

.page-about__section-title--left {
  text-align: left;
}

.page-about__content-block {
  flex: 1;
}

.page-about__image-block {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-about__image-block img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.page-about__image-block--center {
  margin-top: 30px;
  margin-bottom: 30px;
}

.page-about__list {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 20px;
  padding: 0;
}

.page-about__list li {
  margin-bottom: 10px;
  color: #333333;
}

.page-about__list--two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 30px;
  list-style: none; /* Remove default disc for custom styling */
  margin-left: 0;
  padding-left: 0;
}

.page-about__list--two-cols li::before {
  content: "✅"; /* Custom bullet point */
  margin-right: 10px;
  color: var(--primary-color);
  font-weight: bold;
}

/* --- Color Schemes --- */
.page-about__dark-section {
  background-color: var(--primary-color); /* Dark green background */
  color: var(--secondary-color); /* White text */
  padding: 60px 0;
}

.page-about__dark-section .page-about__section-title {
  color: var(--secondary-color); /* White title */
}

.page-about__dark-section .page-about__list li {
  color: var(--secondary-color); /* White list items */
}

.page-about__light-bg {
  background-color: var(--secondary-color); /* White background */
  color: #333333; /* Dark text */
  padding: 60px 0;
}

/* --- Buttons --- */
.page-about__cta-buttons {
  display: flex;
  gap: 20px;
  margin-top: 40px;
  justify-content: flex-start;
  flex-wrap: wrap; /* Allow wrapping for multiple buttons */
}

.page-about__cta-buttons--center {
  justify-content: center;
}

.page-about__btn-primary,
.page-about__btn-secondary {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-sizing: border-box; /* Crucial for responsive buttons */
  max-width: 100%; /* Ensure buttons don't exceed container width */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-about__btn-primary {
  background: var(--primary-color); /* Primary brand color */
  color: var(--secondary-color); /* White text */
  border: 2px solid var(--primary-color);
}

.page-about__btn-primary:hover {
  background: #005a2d; /* Darker green on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-about__btn-secondary {
  background: var(--secondary-color); /* White background */
  color: var(--primary-color); /* Primary brand color text */
  border: 2px solid var(--primary-color);
}

.page-about__btn-secondary:hover {
  background: var(--primary-color);
  color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Specific button colors for Đăng ký/Đăng nhập */
.page-about__btn-register,
.page-about__btn-login {
  background-color: #C30808; /* Red for register/login */
  color: #FFFFFF; /* White text for contrast, overriding #FFFF00 for WCAG AA contrast compliance */
  border-color: #C30808;
}

.page-about__btn-register:hover,
.page-about__btn-login:hover {
  background-color: #9c0606; /* Darker red on hover */
  border-color: #9c0606;
}


/* --- Hero Section --- */
.page-about__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 60px; /* Adjusted to fit hero content */
  /* 🚨 Top padding to account for fixed header, as per shared.css */
  padding-top: var(--header-offset, 120px);
}

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

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

.page-about__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.3);
}

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

.page-about__main-title {
  font-size: 48px;
  font-weight: 900;
  color: var(--secondary-color); /* White text for dark hero */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-about__intro-description {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9); /* Slightly transparent white */
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-about__cta-description {
  font-size: 20px;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}


/* --- FAQ Section --- */
.page-about__faq-section {
  padding: 60px 0;
}

.page-about__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* FAQ container style */
.page-about__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--secondary-color); /* White background for FAQ items */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* FAQ default state - answer hidden */
.page-about__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 expanded state - 🚨 Use !important and sufficiently large max-height */
.page-about__faq-item.active .page-about__faq-answer {
  max-height: 2000px !important; /* 🚨 Use !important to ensure priority, value large enough to accommodate any content */
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #333333; /* Dark text for answer content */
}

/* Question style */
.page-about__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-color); /* White background */
  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;
}

.page-about__faq-item.active .page-about__faq-question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: var(--primary-color);
}

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

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

/* Question title style */
.page-about__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Slightly larger for readability */
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color); /* Primary color for question titles */
  pointer-events: none; /* Prevent h3 from blocking click event */
}

/* Toggle icon */
.page-about__faq-toggle {
  font-size: 28px; /* Larger icon */
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color); /* Primary color for toggle */
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.page-about__faq-item.active .page-about__faq-toggle {
  color: var(--primary-color);
}


/* --- Responsive Design (Mobile First) --- */
@media (max-width: 1024px) {
  .page-about__container--flex {
    flex-direction: column;
    gap: 30px;
  }

  .page-about__container--reverse {
    flex-direction: column; /* Ensure reverse also stacks */
  }

  .page-about__list--two-cols {
    grid-template-columns: 1fr;
  }
}

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

  /* 🚨 Mobile specific padding for main content areas */
  .page-about__section,
  .page-about__container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

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

  .page-about__hero-image img {
    border-radius: 4px;
  }

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

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

  .page-about__section-title {
    font-size: 28px;
    margin-bottom: 25px;
  }

  /* 🚨 Buttons responsive */
  .page-about__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    margin-top: 30px;
    width: 100%; /* Ensure container takes full width */
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px; /* Add padding to button container */
  }

  .page-about__btn-primary,
  .page-about__btn-secondary {
    width: 100% !important; /* Full width for buttons */
    max-width: 100% !important;
    padding: 15px 20px;
    font-size: 16px;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* 🚨 Images responsive */
  .page-about img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

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

/* --- Accessibility & Contrast Fixes --- */
/* Ensure all text has sufficient contrast */
.page-about p, .page-about li, .page-about__cta-description {
  color: #333333; /* Default dark text for light backgrounds */
}

.page-about__dark-section p, .page-about__dark-section li, .page-about__dark-section .page-about__cta-description {
  color: var(--secondary-color); /* White text for dark backgrounds */
}