/* style/game-library.css */

/* --- Base & Layout --- */
.page-game-library {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text for light body background */
  background-color: var(--body-bg, #FFFFFF); /* Ensure body background is respected */
}

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

.page-game-library__section-title {
  font-size: 36px;
  font-weight: bold;
  color: #017439; /* Brand primary color for titles */
  text-align: center;
  margin-bottom: 20px;
  padding-top: 40px;
}

.page-game-library__section-description {
  font-size: 18px;
  color: #555555;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 50px auto;
}

/* --- Hero Section --- */
.page-game-library__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: linear-gradient(135deg, #017439, #379461); /* Gradient background for visual appeal */
  color: #FFFFFF; /* Light text for dark background */
  overflow: hidden; /* Ensure content doesn't overflow */
}

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

.page-game-library__hero-image-main {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 30px;
}

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

.page-game-library__hero-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #FFFF00; /* Yellow for prominence */
  line-height: 1.2;
}

.page-game-library__hero-description {
  font-size: 20px;
  margin-bottom: 40px;
  color: #f0f0f0;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-library__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: #C30808; /* Red for CTA, as per custom colors */
  color: #FFFF00; /* Yellow text for CTA */
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-game-library__cta-button:hover {
  background: #e02020;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-game-library__cta-button--inverted {
  background: #FFFFFF;
  color: #017439;
  border: 2px solid #017439;
}

.page-game-library__cta-button--inverted:hover {
  background: #f0f0f0;
  color: #005a2e;
}


/* --- Game Categories Section --- */
.page-game-library__game-categories {
  padding: 80px 0;
  background-color: #f8f8f8; /* Light background for this section */
  color: #333333;
}

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

.page-game-library__category-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: #333333;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-game-library__category-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

.page-game-library__card-title {
  font-size: 24px;
  font-weight: bold;
  margin: 20px 20px 10px 20px;
  color: #017439;
}

.page-game-library__card-text {
  font-size: 16px;
  margin: 0 20px 20px 20px;
  flex-grow: 1; /* Ensure text fills space */
}

/* --- Why Choose Us Section --- */
.page-game-library__why-choose-us {
  padding: 80px 0;
  background-color: #017439; /* Dark background */
  color: #ffffff; /* Light text */
  text-align: center;
}

.page-game-library__why-choose-us .page-game-library__section-title {
  color: #FFFF00; /* Yellow title for contrast */
  margin-bottom: 60px;
}

.page-game-library__feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.page-game-library__feature-item {
  background: rgba(255, 255, 255, 0.1); /* Slightly transparent white background */
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.page-game-library__feature-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.page-game-library__feature-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #ffffff;
}

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

/* --- FAQ Section --- */
.page-game-library__faq-section {
  padding: 80px 0;
  background-color: #f8f8f8; /* Light background */
  color: #333333;
}

.page-game-library__faq-list {
  max-width: 900px;
  margin: 50px auto 0 auto;
}

/* FAQ容器样式 */
.page-game-library__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ默认状态 - 答案隐藏 */
.page-game-library__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展开状态 - [31m[1m[5m🚨[0m[31m[1m Sử dụng!important và đủ lớn max-height để đảm bảo có thể mở rộng [0m*/
.page-game-library__faq-item.active .page-game-library__faq-answer {
  max-height: 2000px !important; /* [31m[1m[5m🚨[0m[31m[1m Sử dụng !important để đảm bảo ưu tiên, giá trị đủ lớn để chứa mọi nội dung [0m*/
  padding: 20px 15px !important;
  opacity: 1;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
}

/* Vấn đề kiểu dáng */
.page-game-library__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  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-game-library__faq-question:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

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

/* Kiểu dáng tiêu đề câu hỏi */
.page-game-library__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn chặn thẻ h3 chặn sự kiện click */
  color: #017439; /* Brand color for question titles */
}

/* Biểu tượng chuyển đổi */
.page-game-library__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Ngăn chặn biểu tượng chặn sự kiện click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-game-library__faq-item.active .page-game-library__faq-toggle {
  color: #333;
  transform: rotate(45deg); /* Xoay để tạo hiệu ứng 'x' */
}


/* --- Responsive Design (Mobile) --- */
@media (max-width: 768px) {
  .page-game-library__container {
    padding: 0 15px !important; /* Đảm bảo đệm cho thiết bị di động */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-game-library__section-title {
    font-size: 28px;
    padding-top: 30px;
  }

  .page-game-library__section-description {
    font-size: 16px;
    margin-bottom: 30px;
  }

  /* Phần Hero */
  .page-game-library__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Độ lệch tiêu đề di động */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }

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

  .page-game-library__hero-description {
    font-size: 17px;
    margin-bottom: 30px;
  }

  .page-game-library__cta-button {
    padding: 12px 30px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Phần danh mục trò chơi */
  .page-game-library__game-categories {
    padding: 50px 0;
  }

  .page-game-library__category-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
  }

  .page-game-library__category-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .page-game-library__category-image {
    height: 180px; /* Điều chỉnh chiều cao cho thiết bị di động */
  }

  .page-game-library__card-title {
    font-size: 20px;
    margin: 15px 15px 8px 15px;
  }

  .page-game-library__card-text {
    font-size: 15px;
    margin: 0 15px 15px 15px;
  }

  /* Phần tại sao chọn chúng tôi */
  .page-game-library__why-choose-us {
    padding: 50px 0;
  }

  .page-game-library__why-choose-us .page-game-library__section-title {
    margin-bottom: 40px;
  }

  .page-game-library__feature-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
  }

  .page-game-library__feature-item {
    padding: 25px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-game-library__feature-title {
    font-size: 20px;
  }

  /* Phần FAQ */
  .page-game-library__faq-section {
    padding: 50px 0;
  }

  .page-game-library__faq-list {
    margin-top: 30px;
  }

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

  /* Khả năng phản hồi hình ảnh trên thiết bị di động cho tất cả hình ảnh trong khu vực nội dung */
  .page-game-library img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  
  .page-game-library__section,
  .page-game-library__card,
  .page-game-library__container,
  .page-game-library__category-card,
  .page-game-library__feature-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}