/* style/mahjong.css */

/* Base styles for the Mạt Chược page */
.page-mahjong {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #f0f0f0; /* Default text color for dark body background */
  background-color: var(--dark-bg-1);
}

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

/* Header spacing for fixed navigation bar */
.page-mahjong__hero-section {
  padding-top: 120px; /* Adjust for fixed header */
  padding-bottom: 60px;
  text-align: center;
}

.page-mahjong__section {
  padding: 60px 0;
}

.page-mahjong__dark-section {
  background-color: #0A2E36; /* Brand primary dark color */
  color: #ffffff;
}

.page-mahjong__light-bg {
  background-color: #ffffff;
  color: #333333;
}

.page-mahjong__main-title {
  font-size: 3.2em;
  color: #FFD700; /* Gold accent for main title */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-mahjong__section-title {
  font-size: 2.5em;
  color: #FFD700; /* Gold accent for section titles */
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-mahjong__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: #FFD700;
  border-radius: 2px;
}

.page-mahjong__description {
  font-size: 1.1em;
  margin-bottom: 30px;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #f0f0f0; /* Ensure light color for dark sections */
}

.page-mahjong__light-bg .page-mahjong__description {
  color: #555555; /* Darker color for light sections */
}

.page-mahjong__cta-group {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-mahjong__btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.page-mahjong__btn--primary {
  background-color: #FFD700; /* Gold button */
  color: #0A2E36; /* Dark text for gold button */
}

.page-mahjong__btn--primary:hover {
  background-color: #e0b800;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.page-mahjong__btn--secondary {
  background-color: transparent;
  color: #FFD700; /* Gold text for secondary button */
  border-color: #FFD700;
}

.page-mahjong__btn--secondary:hover {
  background-color: #FFD700;
  color: #0A2E36;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.page-mahjong__btn--small {
  padding: 10px 20px;
  font-size: 0.9em;
}

.page-mahjong__content-wrapper {
  display: flex;
  gap: 40px;
  align-items: center;
  margin-top: 40px;
}

.page-mahjong__image-wrapper {
  flex: 1;
  min-width: 300px;
}

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

.page-mahjong__image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: block;
  max-width: 100%;
}

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

.page-mahjong__card {
  background-color: rgba(255, 255, 255, 0.08); /* Semi-transparent white for dark background */
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: #f0f0f0;
  height: 100%; /* Ensure cards have equal height */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.page-mahjong__light-bg .page-mahjong__card {
  background-color: #f9f9f9;
  color: #333333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.page-mahjong__card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.page-mahjong__card-title {
  font-size: 1.5em;
  color: #FFD700;
  margin-bottom: 15px;
}

.page-mahjong__light-bg .page-mahjong__card-title {
  color: #0A2E36;
}

.page-mahjong__card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  max-width: 100%;
}

.page-mahjong__list {
  list-style: none;
  padding: 0;
  margin-top: 40px;
}

.page-mahjong__list-item {
  background-color: #f9f9f9;
  color: #333333;
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 25px 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

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

.page-mahjong__list-title {
  font-size: 1.4em;
  color: #0A2E36;
  margin-top: 0;
  margin-bottom: 10px;
}

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

.page-mahjong__feature-card {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  color: #f0f0f0;
  transition: transform 0.3s ease;
}

.page-mahjong__feature-card:hover {
  transform: translateY(-8px);
}

.page-mahjong__feature-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
  max-width: 100%;
}

.page-mahjong__feature-title {
  font-size: 1.4em;
  color: #FFD700;
  margin-bottom: 10px;
}

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

.page-mahjong__step-card {
  background-color: #f9f9f9;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  color: #333333;
  transition: transform 0.3s ease;
}

.page-mahjong__step-card:hover {
  transform: translateY(-5px);
}

.page-mahjong__step-number {
  width: 60px;
  height: 60px;
  background-color: #0A2E36;
  color: #FFD700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  font-weight: bold;
  margin: 0 auto 20px auto;
}

.page-mahjong__step-title {
  font-size: 1.5em;
  color: #0A2E36;
  margin-bottom: 15px;
}

/* FAQ styles */
.page-mahjong__faq-list {
  margin-top: 40px;
}

.page-mahjong__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.page-mahjong__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background: #FFD700; /* Gold background for question */
  color: #0A2E36; /* Dark text for question */
  border: 1px solid #e0b800;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-mahjong__faq-question:hover {
  background: #e0b800;
  border-color: #c9a500;
}

.page-mahjong__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click event */
}

.page-mahjong__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #0A2E36;
  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: 28px;
  height: 28px;
}

.page-mahjong__faq-item.active .page-mahjong__faq-toggle {
  transform: rotate(45deg); /* Change to X or rotate for active state */
  color: #0A2E36;
}

.page-mahjong__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 25px;
  opacity: 0;
  background: #ffffff;
  color: #333333;
  border-radius: 0 0 8px 8px;
}

.page-mahjong__faq-item.active .page-mahjong__faq-answer {
  max-height: 2000px !important; /* Use !important and sufficiently large value */
  padding: 20px 25px !important;
  opacity: 1;
}

/* Footer spacing to ensure content above footer is visible */
.page-mahjong__footer-spacing {
  height: 60px; /* Adjust as needed */
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-mahjong__main-title {
    font-size: 2.8em;
  }

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

  .page-mahjong__content-wrapper {
    flex-direction: column;
    text-align: center;
  }

  .page-mahjong__image-wrapper {
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  .page-mahjong__hero-section {
    padding-top: 100px; /* Adjust for mobile fixed header */
    padding-bottom: 40px;
  }

  .page-mahjong__section {
    padding: 40px 0;
  }

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

  .page-mahjong__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-mahjong__description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .page-mahjong__cta-group {
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
  }

  .page-mahjong__btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 1em;
  }

  .page-mahjong__grid, .page-mahjong__features-grid, .page-mahjong__steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-mahjong__card, .page-mahjong__feature-card, .page-mahjong__step-card {
    padding: 25px;
  }

  .page-mahjong__card-title, .page-mahjong__feature-title, .page-mahjong__step-title {
    font-size: 1.3em;
  }

  .page-mahjong__card-image {
    height: 180px;
  }

  .page-mahjong__list-item {
    padding: 20px 25px;
    margin-bottom: 15px;
  }

  .page-mahjong__list-title {
    font-size: 1.2em;
  }

  .page-mahjong__faq-question {
    padding: 15px 20px;
  }

  .page-mahjong__faq-question h3 {
    font-size: 1em;
  }

  .page-mahjong__faq-toggle {
    font-size: 20px;
    width: 24px;
    height: 24px;
  }

  .page-mahjong__faq-item.active .page-mahjong__faq-answer {
    padding: 15px 20px !important;
  }

  /* Mobile image adaptation */
  .page-mahjong img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-mahjong__section,
  .page-mahjong__card,
  .page-mahjong__container,
  .page-mahjong__feature-card,
  .page-mahjong__step-card,
  .page-mahjong__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-mahjong__container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-mahjong__footer-spacing {
    height: 40px;
  }
}