/* style/index.css */

/* Root variables for brand colors */
:root {
    --primary-color: #4A148C; /* Deep Purple */
    --secondary-color: #FFC107; /* Gold/Amber */
    --text-light: #ffffff;
    --text-dark: #333333;
    --background-light: #f9f9f9;
    --background-dark: #1a1a1a; /* Assuming --dark-bg is similar */
    --border-color: #e0e0e0;
}

/* General page styling */
.page-index {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-light); /* Default for dark body background */
    background-color: var(--background-dark); /* Ensure consistency if shared.css has dark bg */
}

/* Section styling */
.page-index__section,
.page-index__video-section,
.page-index__title-section,
.page-index__featured-games-section,
.page-index__promotions-section,
.page-index__faq-section,
.page-index__brand-section,
.page-index__blog-section {
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden; /* Prevent horizontal scroll */
}

.page-index__dark-section {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.page-index__light-bg {
    background-color: var(--background-light);
    color: var(--text-dark);
}

/* Container styling */
.page-index__video-container,
.page-index__title-container,
.page-index__featured-games-container,
.page-index__promotions-container,
.page-index__faq-container,
.page-index__brand-container,
.page-index__blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Inner padding for containers */
    box-sizing: border-box;
}

/* Headings */
.page-index h1, .page-index h2, .page-index h3 {
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: bold;
}

.page-index h1 {
    font-size: 48px;
    color: var(--secondary-color); /* Gold for H1 */
}

.page-index h2 {
    font-size: 38px;
    color: var(--text-light); /* Default for dark sections */
}

.page-index__light-bg h2 {
    color: var(--primary-color); /* Deep purple for light sections */
}

.page-index h3 {
    font-size: 28px;
    color: var(--text-light);
}

.page-index__light-bg h3 {
    color: var(--primary-color);
}

.page-index p {
    font-size: 18px;
    margin-bottom: 20px;
}

.page-index__light-bg p {
    color: var(--text-dark);
}

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

.page-index__cta-button,
.page-index__play-now-button,
.page-index__game-card-button,
.page-index__promotion-card-button,
.page-index__view-all-button {
    display: inline-block;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text breaking */
    max-width: 100%; /* Ensure button adapts to container */
    box-sizing: border-box;
}

.page-index__cta-button--primary,
.page-index__play-now-button {
    background: var(--secondary-color); /* Gold */
    color: var(--primary-color); /* Deep Purple text for contrast */
    box-shadow: 0 6px 15px rgba(255, 193, 7, 0.4);
}

.page-index__cta-button--primary:hover,
.page-index__play-now-button:hover {
    background: #e6b000; /* Darker Gold */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.6);
}

.page-index__cta-button--secondary {
    background: var(--primary-color); /* Deep Purple */
    color: var(--text-light); /* White text */
    border: 2px solid var(--secondary-color); /* Gold border */
    box-shadow: 0 6px 15px rgba(74, 20, 140, 0.4);
}

.page-index__cta-button--secondary:hover {
    background: #621aae; /* Lighter Purple */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 20, 140, 0.6);
}

.page-index__game-card-button,
.page-index__promotion-card-button,
.page-index__view-all-button {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 10px 25px;
    font-size: 16px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.page-index__game-card-button:hover,
.page-index__promotion-card-button:hover,
.page-index__view-all-button:hover {
    background: #e6b000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Images */
.page-index img {
    max-width: 100%;
    height: auto;
    display: block; /* Ensure images take full width of parent */
    border-radius: 8px; /* Consistent styling */
    object-fit: cover; /* For consistent image display in cards */
}

/* Video Area */
.page-index__video-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  padding-top: var(--header-offset, 120px); /* Fixed header offset */
  background-color: var(--background-dark);
}

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

.page-index__video-link {
  display: block;
  text-decoration: none;
  position: relative;
  width: 100%;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__video-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-index__video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-index__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  object-fit: cover;
  pointer-events: none; /* Prevent video controls from blocking click event */
}

.page-index__video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.page-index__video-link:hover .page-index__video-overlay {
  opacity: 1;
}

.page-index__video-click-hint {
  color: #ffffff;
  font-size: 20px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 15px 30px;
  background: rgba(255, 193, 7, 0.8); /* Secondary color with transparency */
  border-radius: 50px;
  white-space: nowrap;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

.page-index__video-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
}

/* Featured Games Section */
.page-index__featured-games-description {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
    color: var(--text-light);
}

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

.page-index__game-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

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

.page-index__game-card-image {
    width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: 5px;
}

.page-index__game-card-title {
    font-size: 22px;
    margin-bottom: 10px;
}

.page-index__game-card-title a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-index__game-card-title a:hover {
    color: #e6b000;
}

.page-index__game-card-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    flex-grow: 1; /* Allows text to take available space */
    margin-bottom: 20px;
}

/* Promotions Section */
.page-index__promotions-section {
    background-color: var(--background-light);
    color: var(--text-dark);
}

.page-index__promotions-title {
    color: var(--primary-color);
}

.page-index__promotions-description {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
    color: var(--text-dark);
}

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

.page-index__promotion-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.page-index__promotion-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.page-index__promotion-card-title {
    font-size: 22px;
    margin: 20px 20px 10px 20px;
    color: var(--primary-color);
}

.page-index__promotion-card-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-index__promotion-card-title a:hover {
    color: #3a1070;
}

.page-index__promotion-card-text {
    font-size: 16px;
    color: var(--text-dark);
    padding: 0 20px;
    flex-grow: 1;
    margin-bottom: 20px;
}

.page-index__promotion-card-button {
    margin: 0 20px 20px 20px;
    align-self: flex-start; /* Align button to start within card */
}

.page-index__view-all-promotions {
    margin-top: 50px;
}

/* FAQ Section */
.page-index__faq-main-title {
    color: var(--primary-color);
}

.page-index__faq-description {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.page-index__faq-list {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

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

.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #fff;
  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;
}

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

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

.page-index__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px; /* Adjusted for better readability */
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color); /* FAQ question color */
  pointer-events: none; /* Prevent h3 from blocking click event */
}

.page-index__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: var(--primary-color); /* Toggle icon color */
  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;
}

/* FAQ default state - answer hidden */
.page-index__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 expanded state - IMPORTANT: use !important and sufficient max-height */
.page-index__faq-item.active .page-index__faq-answer {
  max-height: 2000px !important; /* Sufficiently large to contain any content */
  padding: 20px 15px !important;
  opacity: 1;
  background: #ffffff; /* Consistent background with questions */
  border-radius: 0 0 5px 5px;
  border: 1px solid var(--border-color);
  border-top: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-index__faq-item.active .page-index__faq-toggle {
  color: var(--secondary-color); /* Gold color when active */
  transform: rotate(45deg); /* Optional: rotate for 'x' effect, or just change text to '−' */
}