/* style/lottery.css */

/* Variables and base styles */
:root {
  --primary-color: #26A9E0;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --background-light: #f9f9f9;
  --background-dark: #26A9E0; /* Using primary color for dark sections */
  --border-color: #e0e0e0;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.2);
}

.page-lottery {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default text color for light body background */
  background-color: var(--secondary-color); /* Matches body background from shared.css */
}

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

.page-lottery__section {
  padding: 60px 0;
  text-align: center;
}

.page-lottery__section-title {
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 40px;
  font-weight: bold;
}

.page-lottery__section-title--light {
  color: var(--text-light);
}

.page-lottery__paragraph {
  font-size: 18px;
  line-height: 1.7;
  max-width: 800px;
  margin: 0 auto 20px auto;
  color: #555555;
}

/* Hero Section */
.page-lottery__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); /* Ensures content is not hidden by fixed header */
  background: linear-gradient(135deg, var(--primary-color) 0%, #a7e1f7 100%); /* Lighter gradient for hero */
  color: var(--text-light);
}

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

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

.page-lottery__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 30px var(--shadow-medium);
}

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

.page-lottery__main-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--text-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-lottery__intro-text {
  font-size: 20px;
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto 30px auto;
  color: var(--text-light);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.page-lottery__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.page-lottery__cta-button {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--shadow-light);
}

.page-lottery__btn-primary {
  background: var(--primary-color);
  color: var(--text-light);
  border: 2px solid var(--primary-color);
}

.page-lottery__btn-primary:hover {
  background: #1f8ec4; /* A slightly darker shade of primary-color */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-medium);
}

.page-lottery__btn-secondary {
  background: var(--secondary-color);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.page-lottery__btn-secondary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-medium);
}


/* Introduction Section */
.page-lottery__introduction {
  background-color: var(--secondary-color);
  color: var(--text-dark);
}

/* Game Types Section */
.page-lottery__game-types {
  background-color: var(--background-dark); /* Using primary color as dark background */
  color: var(--text-light);
}

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

.page-lottery__card {
  background: var(--secondary-color);
  border-radius: 12px;
  box-shadow: 0 8px 25px var(--shadow-light);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--text-dark); /* Card text color */
  border: 1px solid var(--border-color);
}

.page-lottery__card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px var(--shadow-medium);
}

.page-lottery__card-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 25px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.page-lottery__card-title {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: 15px;
  font-weight: bold;
}

.page-lottery__card-description {
  font-size: 16px;
  color: #666666;
  margin-bottom: 25px;
  line-height: 1.7;
}

.page-lottery__card-button {
  display: inline-block;
  padding: 12px 30px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

/* Benefits Section */
.page-lottery__benefits {
  background-color: var(--background-light);
  color: var(--text-dark);
}

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

.page-lottery__feature-item {
  background: var(--secondary-color);
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-light);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease;
  border: 1px solid var(--border-color);
}

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

.page-lottery__feature-icon {
  width: 250px; /* Min size 200x200px, so this will be overwritten by imageRequirements */
  height: 250px; /* Min size 200x200px */
  object-fit: contain;
  margin: 0 auto 20px auto; /* Center it */
}

.page-lottery__feature-title {
  font-size: 22px;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-weight: bold;
}

.page-lottery__feature-description {
  font-size: 16px;
  color: #666666;
}

/* How-to-Play Section */
.page-lottery__how-to-play {
  background-color: var(--background-dark);
  color: var(--text-light);
}

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

.page-lottery__step-item {
  background: rgba(255, 255, 255, 0.15); /* Slightly transparent white for dark background */
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background-color 0.3s ease;
}

.page-lottery__step-item:hover {
  background: rgba(255, 255, 255, 0.25);
}

.page-lottery__step-number {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color);
  color: var(--text-light);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  border: 3px solid var(--secondary-color);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.page-lottery__step-title {
  font-size: 22px;
  color: var(--text-light);
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: bold;
}

.page-lottery__step-description {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 25px;
}

.page-lottery__step-button {
  display: inline-block;
  padding: 10px 25px;
  background: var(--secondary-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid var(--primary-color);
}

.page-lottery__step-button:hover {
  background: #f0f0f0;
  color: #1f8ec4;
}

/* Tips Section */
.page-lottery__tips {
  background-color: var(--secondary-color);
  color: var(--text-dark);
}

.page-lottery__tips-content {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  text-align: left;
  margin-top: 40px;
}

.page-lottery__tips-image {
  flex: 0 0 45%;
  max-width: 45%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 25px var(--shadow-light);
}

.page-lottery__tips-text {
  flex: 1;
}

.page-lottery__list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.page-lottery__list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 15px;
  font-size: 17px;
  color: #444444;
}

.page-lottery__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 20px;
  line-height: 1;
}

/* FAQ Section */
.page-lottery__faq {
  background-color: var(--background-light);
  color: var(--text-dark);
}

.page-lottery__faq-list {
  max-width: 900px;
  margin: 40px auto 0 auto;
}

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

/* FAQ默认状态 - 答案隐藏 */
.page-lottery__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展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-lottery__faq-item.active .page-lottery__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值 đủ lớn để chứa mọi nội dung */
  padding: 20px 15px !important;
  opacity: 1;
  background: var(--secondary-color); /* Use secondary color for answer background */
  border-radius: 0 0 5px 5px;
  border: 1px solid var(--border-color);
  border-top: none;
  color: var(--text-dark);
  text-align: left;
}

/* Vấn đề FAQ */
.page-lottery__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  text-align: left;
}

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

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

/* Tiêu đề vấn đề FAQ */
.page-lottery__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Tăng kích thước font để dễ đọc hơn */
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Ngăn chặn thẻ h3 chặn sự kiện click */
  color: var(--primary-color); /* Màu chữ câu hỏi FAQ */
}

/* Biểu tượng chuyển đổi */
.page-lottery__faq-toggle {
  font-size: 28px; /* Tăng kích thước biểu tượng */
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color); /* Màu biểu tượng */
  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: 32px; /* Tăng diện tích biểu tượng */
  height: 32px;
}

.page-lottery__faq-item.active .page-lottery__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Chuyển đổi thành dấu 'x' khi mở */
}


/* --- Thiết kế đáp ứng --- */

/* Thích ứng di động cho tất cả hình ảnh */
.page-lottery img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Thích ứng di động cho tất cả nút */
.page-lottery__cta-button,
.page-lottery__btn-primary,
.page-lottery__btn-secondary,
.page-lottery a[class*="button"],
.page-lottery a[class*="btn"],
.page-lottery__card-button,
.page-lottery__step-button {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

/* Vùng chứa nút */
.page-lottery__cta-buttons,
.page-lottery__button-group,
.page-lottery__btn-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

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

  .page-lottery__container {
    padding: 0 15px;
  }

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

  .page-lottery__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .page-lottery__paragraph {
    font-size: 16px;
    margin-bottom: 15px;
  }

  /* Hero Section Mobile */
  .page-lottery__hero-section {
    padding-top: var(--header-offset, 120px) !important;
    padding-bottom: 40px;
  }

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

  .page-lottery__intro-text {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .page-lottery__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px; /* Add padding to container */
  }

  /* Tất cả nút cho di động */
  .page-lottery__cta-button,
  .page-lottery__btn-primary,
  .page-lottery__btn-secondary,
  .page-lottery a[class*="button"],
  .page-lottery a[class*="btn"],
  .page-lottery__card-button,
  .page-lottery__step-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding: 12px 20px;
    font-size: 16px;
  }

  /* Vùng chứa nút cho di động */
  .page-lottery__cta-buttons,
  .page-lottery__button-group,
  .page-lottery__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }

  /* Lưới thẻ trên di động */
  .page-lottery__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-lottery__card {
    padding: 20px;
  }

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

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

  /* Lưới tính năng trên di động */
  .page-lottery__features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-lottery__feature-icon {
    width: 200px !important; /* Đảm bảo kích thước tối thiểu */
    height: 200px !important; /* Đảm bảo kích thước tối thiểu */
  }

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

  /* Các bước trên di động */
  .page-lottery__steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-lottery__step-item {
    padding: 25px;
  }

  .page-lottery__step-number {
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: -15px;
  }

  .page-lottery__step-title {
    font-size: 20px;
    margin-top: 15px;
  }

  /* Phần Mẹo trên di động */
  .page-lottery__tips-content {
    flex-direction: column;
    gap: 20px;
  }

  .page-lottery__tips-image {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .page-lottery__list li {
    font-size: 16px;
    padding-left: 25px;
    margin-bottom: 10px;
  }

  .page-lottery__list li::before {
    font-size: 18px;
  }

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

/* Đảm bảo hình ảnh khu vực nội dung không quá nhỏ */
.page-lottery__card-image,
.page-lottery__feature-icon,
.page-lottery__tips-image {
  min-width: 200px;
  min-height: 200px;
}

/* Kiểu hình ảnh toàn cầu để ngăn chặn các biểu tượng nhỏ và đảm bảo tính đáp ứng */
.page-lottery img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* Mặc định object-fit, có thể bị ghi đè */
}

/* Giới hạn kích thước CSS của hình ảnh khu vực nội dung */
.page-lottery img {
  min-width: 200px;
  min-height: 200px;
}
.page-lottery__card-image {
  width: 100%; /* Đảm bảo nó chiếm toàn bộ chiều rộng của vùng chứa */
  height: 200px; /* Chiều cao cụ thể, nhưng min-height vẫn áp dụng */
  object-fit: cover;
}
.page-lottery__feature-icon {
  width: 250px; /* Đặt chiều rộng rõ ràng để khớp với yêu cầu placeholder */
  height: 250px; /* Đặt chiều cao rõ ràng để khớp với yêu cầu placeholder */
  object-fit: contain; /* Biểu tượng có thể cần 'contain' */
  margin: 0 auto 20px auto; /* Căn giữa */
}
.page-lottery__tips-image {
  width: 100%;
  height: auto;
  min-height: 300px; /* Đảm bảo nó không quá nhỏ đối với hình ảnh nội dung */
  object-fit: cover;
}

/* Không có bộ lọc CSS trên hình ảnh */
.page-lottery img {
  filter: none !important;
}