/* Base styles for the terms-conditions page */
.page-terms-conditions {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background: #F5F7FA; /* Body background from custom palette */
}

/* Specific styling for sections */
.page-terms-conditions__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-terms-conditions__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 10px; /* Small top padding as per instruction */
  padding-bottom: 40px;
  overflow: hidden;
  background: #E53935; /* Using main brand color for hero background */
}

.page-terms-conditions__hero-image {
  width: 100%;
  height: auto;
  max-height: 500px; /* Max height for visual appeal */
  object-fit: cover;
  display: block;
}

.page-terms-conditions__hero-content {
  position: relative;
  z-index: 2;
  color: #ffffff;
  padding: 20px 15px;
  max-width: 900px;
}

.page-terms-conditions__main-title {
  font-size: 2.8em;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
  color: #ffffff;
}

.page-terms-conditions__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-terms-conditions__content-area {
  padding: 60px 0;
  background: #F5F7FA; /* Background from custom palette */
  color: #333333; /* Text Main from custom palette */
}

.page-terms-conditions__section-title {
  font-size: 2em;
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 25px;
  color: #E53935; /* Main brand color for titles */
  text-align: left;
}

.page-terms-conditions p {
  margin-bottom: 15px;
  font-size: 1.05em;
  color: #333333; /* Text Main from custom palette */
}

.page-terms-conditions__list {
  list-style-type: disc;
  margin-left: 25px;
  margin-bottom: 20px;
  color: #333333; /* Text Main from custom palette */
}

.page-terms-conditions__list li {
  margin-bottom: 10px;
  color: #333333; /* Text Main from custom palette */
}

.page-terms-conditions__list-strong {
  font-weight: bold;
  color: #E53935; /* Main brand color for emphasis */
}

.page-terms-conditions__content-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 30px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.page-terms-conditions__link {
  color: #E53935; /* Main brand color for links */
  text-decoration: underline;
}

.page-terms-conditions__link:hover {
  color: #FF5A4F; /* Auxiliary brand color on hover */
}

/* CTA Section */
.page-terms-conditions__cta-section {
  background: #E53935; /* Main brand color for dark section */
  color: #ffffff;
  padding: 60px 0;
  text-align: center;
}

.page-terms-conditions__cta-title {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-terms-conditions__cta-description {
  font-size: 1.1em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.page-terms-conditions__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.page-terms-conditions__btn-primary,
.page-terms-conditions__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-terms-conditions__btn-primary {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Custom button gradient */
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.page-terms-conditions__btn-primary:hover {
  background: linear-gradient(180deg, #E53935 0%, #FF5A4F 100%);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.page-terms-conditions__btn-secondary {
  background: #ffffff;
  color: #E53935; /* Main brand color for text */
  border: 2px solid #E53935; /* Main brand color for border */
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.page-terms-conditions__btn-secondary:hover {
  background: #f0f0f0;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

/* FAQ Section Styling */
.page-terms-conditions__faq-list {
  margin-top: 40px;
}

details.page-terms-conditions__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid #E0E0E0; /* Border color from custom palette */
  overflow: hidden;
  background: #ffffff; /* Card BG from custom palette */
}
details.page-terms-conditions__faq-item summary.page-terms-conditions__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
  color: #333333; /* Text Main from custom palette */
}
details.page-terms-conditions__faq-item summary.page-terms-conditions__faq-question::-webkit-details-marker {
  display: none;
}
details.page-terms-conditions__faq-item summary.page-terms-conditions__faq-question:hover {
  background: #f5f5f5;
}
.page-terms-conditions__faq-qtext {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #333333; /* Text Main from custom palette */
}
.page-terms-conditions__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #E53935; /* Main brand color for toggle icon */
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-terms-conditions__faq-item .page-terms-conditions__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #333333; /* Text Main from custom palette */
}

/* --- Responsive CSS --- */

/* Mobile Images & Containers (General) */
.page-terms-conditions img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Mobile Buttons & Containers (General) */
.page-terms-conditions__cta-button,
.page-terms-conditions__btn-primary,
.page-terms-conditions__btn-secondary,
.page-terms-conditions a[class*="button"],
.page-terms-conditions a[class*="btn"] {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-terms-conditions__cta-buttons,
.page-terms-conditions__button-group,
.page-terms-conditions__btn-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Game Trial CSS - MUST BE EXACTLY AS PROVIDED IN TEMPLATE */
@media (max-width: 1023px) {
  .page-terms-conditions__home-hero {
    display: block !important;
    grid-template-columns: none !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .page-terms-conditions__hero-brand,
  .page-terms-conditions__hero-jackpot {
    display: none !important;
  }
  .page-terms-conditions__game-trial {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    margin: 0 auto;
    padding: 0 0 12px !important;
    box-sizing: border-box;
  }
  .page-terms-conditions__game-trial-shell {
    height: auto !important;
    max-height: none !important;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-terms-conditions__game-trial-topbar,
  .page-terms-conditions__game-trial-bottombar {
    display: none !important;
  }
  .page-terms-conditions__game-trial-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1024 / 768;
    flex: none !important;
    min-height: 240px;
    max-height: none !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-terms-conditions__game-trial-frame {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: 100%;
    border: none;
    z-index: 1;
    overflow: hidden;
  }
  .page-terms-conditions__game-trial-overlay {
    z-index: 5 !important;
    pointer-events: auto !important;
  }
  .page-terms-conditions__game-trial-start {
    z-index: 6 !important;
    pointer-events: auto !important;
    touch-action: manipulation;
  }
}

@media (min-width: 1024px) {
  .page-terms-conditions__home-hero {
    display: grid;
    grid-template-columns: 26% 48% 26%;
    gap: 16px;
    align-items: stretch;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px 24px;
    box-sizing: border-box;
  }
  .page-terms-conditions__hero-brand,
  .page-terms-conditions__hero-jackpot,
  .page-terms-conditions__game-trial {
    height: 300px;
    max-height: 300px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .page-terms-conditions__game-trial {
    max-width: none !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .page-terms-conditions__game-trial-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 300px;
    box-sizing: border-box;
  }
  .page-terms-conditions__game-trial-viewport {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
  }
  .page-terms-conditions__game-trial-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none;
  }
  .page-terms-conditions__hero-jackpot-claim {
    background: #c62828 !important;
    color: #fff !important;
  }
  /* PC specific styles for other modules (if they were present on homepage) */
  .page-terms-conditions__promo-strip {
    margin-top: 16px; /* Example, if promo strip was on homepage */
  }
  .page-terms-conditions__promo-strip-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .page-terms-conditions__hot-games-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    text-align: center;
  }
  .page-terms-conditions__hot-games-name,
  .page-terms-conditions__hot-games-rtp,
  .page-terms-conditions__hot-games-desc {
    display: block; /* Ensure these are visible on PC */
  }
  .page-terms-conditions__brand-intro,
  .page-terms-conditions__winner-ticker {
    /* Styles for PC */
  }
}

/* Mobile (max-width: 768px) specific styles */
@media (max-width: 768px) {
  .page-terms-conditions__main-title {
    font-size: 2em;
  }
  .page-terms-conditions__hero-description {
    font-size: 1em;
  }
  .page-terms-conditions__section-title {
    font-size: 1.5em;
    margin-top: 30px;
    margin-bottom: 20px;
  }
  .page-terms-conditions p,
  .page-terms-conditions__list li {
    font-size: 0.95em;
  }
  .page-terms-conditions__cta-title {
    font-size: 1.8em;
  }
  .page-terms-conditions__cta-description {
    font-size: 0.95em;
  }
  .page-terms-conditions__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px; /* Add padding to container */
  }
  .page-terms-conditions__btn-primary,
  .page-terms-conditions__btn-secondary,
  .page-terms-conditions a[class*="button"],
  .page-terms-conditions a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important; /* Ensure height adjusts */
    padding: 12px 15px !important;
    font-size: 1em !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
  }

  /* Image responsive adaptation for mobile */
  .page-terms-conditions img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-terms-conditions__container,
  .page-terms-conditions__hero-section,
  .page-terms-conditions__content-area,
  .page-terms-conditions__cta-section,
  .page-terms-conditions__card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* FAQ mobile styles */
  details.page-terms-conditions__faq-item summary.page-terms-conditions__faq-question { padding: 15px; }
  .page-terms-conditions__faq-qtext { font-size: 15px; }
  details.page-terms-conditions__faq-item .page-terms-conditions__faq-answer { padding: 0 15px 15px; }

  /* Specific module mobile rules as per template (even if not on this page) */
  /* 2. Ưu đãi `__promo-strip` */
  .page-terms-conditions__promo-strip-track {
    grid-template-columns: repeat(2, 1fr) !important; /* Changed from 4 to 2 for mobile */
    overflow-x: hidden;
    gap: 15px;
  }
  .page-terms-conditions__promo-strip-card {
    flex-direction: column !important; /* Stack image and text */
    text-align: center;
  }
  .page-terms-conditions__promo-strip-card img {
    max-width: 100% !important;
    height: auto !important;
    margin-bottom: 10px;
  }
  .page-terms-conditions__promo-strip-card-content {
    padding: 0 10px;
  }
  .page-terms-conditions__promo-strip-card-button {
    width: 100% !important;
    padding: 10px 15px !important;
  }
  /* 3. Hấp dẫn `__hot-games` */
  .page-terms-conditions__hot-games-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
  }
  .page-terms-conditions__hot-games-item img {
    width: 100% !important;
    height: auto !important;
  }
  .page-terms-conditions__hot-games-name,
  .page-terms-conditions__hot-games-rtp,
  .page-terms-conditions__hot-games-desc {
    display: none !important; /* Hide details on mobile */
  }
  /* 4. Thương hiệu `__brand-intro` (if present on homepage) */
  .page-terms-conditions__brand-intro {
    padding: 30px 15px;
  }
  .page-terms-conditions__brand-intro-content {
    flex-direction: column;
    text-align: center;
  }
  .page-terms-conditions__brand-intro-image {
    margin-bottom: 20px;
  }
  /* 5. Dòng người thắng `__winner-ticker` */
  .page-terms-conditions__winner-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 10px 15px;
    font-size: 0.9em;
  }
  body {
    padding-bottom: 40px;
  } /* Adjust body padding for fixed ticker */
  main.page-content {
    padding-bottom: 40px;
  } /* Fallback for main content */
}

/* Overlay and modal for game trial (even if not on this page, as per js requirements) */
.page-terms-conditions__game-trial-overlay {
  z-index: 5;
  pointer-events: auto;
}
.page-terms-conditions__game-trial-overlay.is-hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden; /* Added for extra hidden state */
}
.page-terms-conditions__game-trial-start {
  z-index: 6;
  pointer-events: auto;
  touch-action: manipulation;
}
.page-terms-conditions__game-trial-shell {
  border: 1px solid rgba(212,175,55,.45);
  border-radius: 10px;
  overflow: hidden;
}
.page-terms-conditions__reward-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.page-terms-conditions__reward-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.page-terms-conditions__reward-modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  color: #333;
}
.page-terms-conditions__reward-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}
.page-terms-conditions__reward-modal-close:hover {
  color: #333;
}
.page-terms-conditions__reward-modal h3 {
  color: #E53935;
  font-size: 1.8em;
  margin-bottom: 15px;
}
.page-terms-conditions__reward-modal p {
  margin-bottom: 25px;
}
.page-terms-conditions__reward-modal .page-terms-conditions__btn-primary {
  margin-top: 10px;
  width: auto;
  min-width: 180px;
}
/* For body class when modal is open */
body.page-terms-conditions--reward-open {
  overflow: hidden;
}