/* style/mahjong.css */

/* Base Styles for Mahjong Page */
.page-mahjong {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #f0f0f0; /* Light text for dark background */
  background-color: #1a1a1a; /* Dark background, simulating var(--dark-bg-1) */
  padding-top: 80px; /* Adjust for fixed header */
}

@media (max-width: 768px) {
  .page-mahjong {
    padding-top: 60px; /* Adjust for fixed header on mobile */
  }
}

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

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

.page-mahjong__section-title {
  font-size: 38px;
  color: #FFD700; /* Gold heading */
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.page-mahjong__text-block {
  font-size: 17px;
  margin-bottom: 20px;
  text-align: justify;
  color: #e0e0e0;
}

.page-mahjong__highlight {
  color: #FFD700;
  font-weight: bold;
}

.page-mahjong a {
  color: #FFD700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-mahjong a:hover {
  color: #DC143C;
}

/* Buttons */
.page-mahjong__btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.page-mahjong__btn--primary {
  background-color: #FFD700; /* Gold button */
  color: #1a1a1a; /* Dark text for contrast */
  border: 2px solid #FFD700;
}

.page-mahjong__btn--primary:hover {
  background-color: #e6c200;
  border-color: #e6c200;
}

.page-mahjong__btn--secondary {
  background-color: transparent;
  color: #FFD700; /* Gold text */
  border: 2px solid #FFD700;
}

.page-mahjong__btn--secondary:hover {
  background-color: #FFD700;
  color: #1a1a1a;
}

/* Hero Section */
.page-mahjong__hero-section {
  position: relative;
  background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
  padding: 100px 0;
  overflow: hidden;
}

.page-mahjong__hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  gap: 40px;
}

.page-mahjong__hero-content {
  flex: 1;
  max-width: 600px;
  z-index: 1;
}

.page-mahjong__hero-title {
  font-size: 48px;
  color: #FFD700;
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.page-mahjong__hero-description {
  font-size: 19px;
  color: #e0e0e0;
  margin-bottom: 30px;
}

.page-mahjong__hero-buttons {
  display: flex;
  gap: 15px;
}

.page-mahjong__hero-image-wrapper {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.page-mahjong__hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  object-fit: cover;
}

/* Section About */
.page-mahjong__section--about {
  background-color: #222222;
}

/* Advantages Section */
.page-mahjong__section--advantages {
  background-color: #1a1a1a;
}

.page-mahjong__grid {
  display: grid;
  gap: 30px;
}

.page-mahjong__grid--3-cols {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.page-mahjong__card {
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-mahjong__card-image {
  max-width: 100%;
  height: 250px;
  object-fit: contain; /* Changed to contain for service images */
  margin-bottom: 20px;
  border-radius: 5px;
}

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

.page-mahjong__card-text {
  font-size: 16px;
  color: #e0e0e0;
}

/* Guide Section */
.page-mahjong__section--guide {
  background-color: #222222;
}

.page-mahjong__guide-list {
  list-style: none;
  padding: 0;
  margin-top: 30px;
}

.page-mahjong__guide-list li {
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 20px;
  padding: 25px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.page-mahjong__guide-step-title {
  font-size: 22px;
  color: #FFD700;
  margin-bottom: 10px;
}

.page-mahjong__guide-list p {
  font-size: 16px;
  color: #e0e0e0;
}

.page-mahjong__cta-block {
  text-align: center;
  margin-top: 40px;
  padding: 30px;
  background-color: #333333;
  border-radius: 10px;
  border: 1px solid #FFD700;
}

.page-mahjong__cta-block p {
  font-size: 20px;
  color: #f0f0f0;
  margin-bottom: 20px;
}

/* Variants Section */
.page-mahjong__section--variants {
  background-color: #1a1a1a;
}

.page-mahjong__grid--2-cols {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.page-mahjong__game-card {
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-mahjong__game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-mahjong__game-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.page-mahjong__game-info {
  padding: 20px;
}

.page-mahjong__game-title {
  font-size: 24px;
  color: #FFD700;
  margin-bottom: 10px;
}

.page-mahjong__game-description {
  font-size: 16px;
  color: #e0e0e0;
  margin-bottom: 20px;
}

/* Strategies Section */
.page-mahjong__section--strategies {
  background-color: #222222;
}

.page-mahjong__strategy-card {
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.page-mahjong__strategy-title {
  font-size: 20px;
  color: #FFD700;
  margin-bottom: 10px;
}

.page-mahjong__strategy-text {
  font-size: 16px;
  color: #e0e0e0;
}

/* Other Games Section */
.page-mahjong__section--other-games {
  background-color: #1a1a1a;
}

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

.page-mahjong__game-item {
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  padding-bottom: 20px;
}

.page-mahjong__game-item-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 15px;
}

.page-mahjong__game-item-title {
  font-size: 22px;
  color: #FFD700;
  margin-bottom: 10px;
  padding: 0 15px;
}

.page-mahjong__game-item-description {
  font-size: 15px;
  color: #e0e0e0;
  padding: 0 15px;
}

/* FAQ Section */
.page-mahjong__section--faq {
  background-color: #222222;
}

.page-mahjong__faq-list {
  margin-top: 40px;
}

/* FAQ container style */
.page-mahjong__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ default state - answer hidden */
.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;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ expanded state - 🚨 Use!important and sufficiently large max-height */
.page-mahjong__faq-item.active .page-mahjong__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: #333333; /* Darker background for answer */
  border-radius: 0 0 5px 5px;
  color: #e0e0e0;
}

/* Question style */
.page-mahjong__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #2a2a2a; /* Dark background for question */
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-mahjong__faq-question:hover {
  background: #333333;
  border-color: #FFD700;
}

.page-mahjong__faq-question:active {
  background: #3a3a3a;
}

/* Question title style */
.page-mahjong__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: #FFD700; /* Gold text for question */
  pointer-events: none; /* Prevent h3 tag from blocking click event */
}

/* Toggle icon */
.page-mahjong__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #FFD700;
  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: 32px;
  height: 32px;
}

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

/* Conclusion Section */
.page-mahjong__section--conclusion {
  background-color: #1a1a1a;
  text-align: center;
}

.page-mahjong__cta-final {
  margin-top: 40px;
}

.page-mahjong__cta-final .page-mahjong__btn {
  font-size: 20px;
  padding: 15px 35px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-mahjong__hero-title {
    font-size: 40px;
  }
  .page-mahjong__hero-description {
    font-size: 18px;
  }
  .page-mahjong__section-title {
    font-size: 32px;
  }
  .page-mahjong__grid--3-cols {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .page-mahjong__grid--2-cols {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  .page-mahjong__game-showcase {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-mahjong__hero-section {
    padding: 60px 0;
  }
  .page-mahjong__hero-container {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }
  .page-mahjong__hero-content {
    max-width: 100%;
  }
  .page-mahjong__hero-title {
    font-size: 32px;
  }
  .page-mahjong__hero-description {
    font-size: 16px;
  }
  .page-mahjong__hero-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .page-mahjong__section {
    padding: 40px 0;
  }
  .page-mahjong__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }
  .page-mahjong__text-block {
    font-size: 15px;
  }
  .page-mahjong__grid--3-cols, .page-mahjong__grid--2-cols, .page-mahjong__game-showcase {
    grid-template-columns: 1fr;
  }
  .page-mahjong__card, .page-mahjong__game-card, .page-mahjong__game-item {
    padding: 20px;
  }
  .page-mahjong__card-image {
    height: 200px;
  }
  .page-mahjong__game-image {
    height: 250px;
  }
  .page-mahjong__guide-list li {
    padding: 20px;
  }
  .page-mahjong__guide-step-title {
    font-size: 20px;
  }
  .page-mahjong__cta-block p {
    font-size: 18px;
  }

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

  /* Ensure images and containers adapt to mobile */
  .page-mahjong img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-mahjong__section,
  .page-mahjong__card,
  .page-mahjong__container,
  .page-mahjong__game-item,
  .page-mahjong__game-card,
  .page-mahjong__strategy-card,
  .page-mahjong__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}