/* style/index.css */

:root {
  --primary-color: #113B7A;
  --secondary-color: #1D5FD1;
  --card-bg: #10233F;
  --text-main: #F3F8FF;
  --text-secondary: #AFC4E8;
  --border-color: #244D84;
  --glow-color: #4FA8FF;
  --gold-color: #F2C14E;
  --divider-color: #1B3357;
  --deep-navy-color: #08162B;
  --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
}

.page-index {
  color: var(--text-main); /* Default text color for main content on dark body background */
  background-color: var(--deep-navy-color); /* Inherited from body, but explicitly set for safety */
}

/* 🚨 Desktop video section styles (must strictly comply) */
.page-index__video-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  padding-top: 10px; /* body { padding-top: var(--header-offset); } in shared.css; this is a small decorative top margin */
  background-color: var(--deep-navy-color);
}

.page-index__video-container {
  position: relative;
  width: 100%; /* Must include width: 100% for desktop */
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* 🚨 Video click link styles (must strictly comply) */
.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 - 🚨 PageSpeed optimization: fixed aspect ratio to prevent CLS */
  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 on the parent <a> */
}

/* 🚨 Video click hint overlay styles (optional, enhances UX) */
.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.3);
  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: 18px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  background: rgba(0, 123, 255, 0.8);
  border-radius: 5px;
  white-space: nowrap;
}

/* 🚨 Play Now button styles (must strictly comply, centered below video) */
.page-index__video-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
}

.page-index__play-now-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--button-gradient);
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
}

.page-index__play-now-button:hover {
  background: linear-gradient(180deg, #1144A6 0%, #2B73F6 100%); /* Slightly reverse gradient for hover effect */
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-index__play-now-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 🚨 Promo Dark Section (Module 2) */
.page-index__promo-dark {
  background: var(--card-bg); /* Custom background color from prompt */
  padding: 40px 20px;
  color: var(--text-main);
}

.page-index__gifcode-tabs {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.page-index__gifcode-title {
  color: var(--gold-color); /* Adjusted for contrast on dark background */
  text-align: center;
  text-transform: uppercase;
  font-size: 2.2rem;
  margin-bottom: 30px;
  font-weight: bold;
  letter-spacing: 1px;
}

.page-index__gifcode-tab-nav {
  display: flex;
  justify-content: center;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 16px 0 40px;
}

.page-index__gifcode-tab-nav li {
  display: inline-block;
}

.page-index__gifcode-tab-nav a {
  color: var(--text-secondary); /* Default tab text color */
  text-decoration: none;
  text-transform: uppercase;
  padding: 10px 15px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 1.1rem;
}

.page-index__gifcode-tab-nav a.is-active {
  color: var(--gold-color); /* Active tab text color, adjusted for contrast */
  border-bottom-color: var(--gold-color); /* Active tab underline */
}

.page-index__gifcode-tab-nav a:hover {
  color: var(--gold-color);
}

.page-index__gifcode-panel {
  display: none;
}

.page-index__gifcode-panel.is-active {
  display: block;
}

.page-index__gifcode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1250px;
  margin: 0 auto;
  justify-content: center;
}

.page-index__gifcode-col {
  flex: 1 1 calc(50% - 10px); /* 2 columns on desktop */
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.page-index__gifcode-img {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.page-index__gifcode-img:hover {
  transform: translateY(-3px);
}

.page-index__gifcode-img img {
  display: block;
  width: 100%;
  aspect-ratio: 370 / 127; /* Fixed aspect ratio for consistent card size */
  object-fit: cover;
  transition: transform 0.3s;
}

.page-index__gifcode-img:hover img {
  transform: scale(1.05);
}

.page-index__blog-section-title {
  color: var(--gold-color); /* Adjusted for contrast on dark background */
  text-align: center;
  margin: 60px 0 40px;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* 🚨 Latest Articles Slider (Module 3) */
.page-index__blog-slider {
  padding: 60px 0;
  background: var(--deep-navy-color); /* Inherits from body, but explicitly set */
  color: var(--text-main);
}

.page-index__blog-slider-wrap {
  position: relative;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 50px; /* Space for navigation arrows */
}

.page-index__blog-slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
}

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.page-index__post-item {
  flex: 0 0 calc((100% - 80px) / 5); /* 5 cards visible on desktop, 4*20px gap = 80px */
  scroll-snap-align: start;
  min-width: 0;
  transition: transform 0.3s ease;
}

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

.page-index__post-box {
  position: relative;
  background: var(--card-bg); /* Dark background for post box */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  height: 100%; /* Ensure consistent height for flex items */
  display: flex;
  flex-direction: column;
}

.page-index__post-image {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.page-index__post-cover {
  position: relative;
  padding-top: 120px; /* Fixed height for cover image as per demo */
  overflow: hidden;
}

.page-index__post-cover-link {
  display: block;
  position: absolute;
  inset: 0;
}

.page-index__post-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-index__post-cover-link:hover img {
  transform: scale(1.08);
}

.page-index__post-text {
  padding: 15px;
  text-align: center;
  color: var(--text-main); /* Light text on dark card background */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__post-title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: bold;
}

.page-index__post-title a {
  color: var(--text-main); /* Light text on dark card background */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__post-title a:hover {
  color: var(--gold-color); /* Gold hover color */
}

.page-index__post-divider {
  width: 40px;
  height: 2px;
  background: var(--divider-color);
  margin: 8px auto;
}

.page-index__post-excerpt {
  color: var(--text-secondary); /* Secondary light text for excerpt */
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
}

.page-index__post-date {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffffff; /* White background for date badge */
  border: 2px solid var(--primary-color); /* Dark blue border */
  padding: 5px 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.page-index__post-date-day {
  display: block;
  font-weight: 700;
  color: #333333; /* Dark text on white background */
}

.page-index__post-date-month {
  display: block;
  font-size: 11px;
  color: #666666; /* Slightly lighter dark text */
  text-transform: uppercase;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

.page-index__blog-slider-prev {
  left: 0;
}

.page-index__blog-slider-next {
  right: 0;
}

/* 🚨 Mobile Responsive Design (must strictly comply) */
@media (max-width: 849px) {
  .page-index__blog-slider-wrap {
    padding: 0 40px;
  }
  .page-index__post-item {
    flex: 0 0 calc((100% - 40px) / 3); /* 3 cards visible, 2*20px gap = 40px */
  }
}

@media (max-width: 768px) {
  .page-index img,
  .page-index video,
  .page-index__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__video-section,
  .page-index__video-container,
  .page-index__video-wrapper,
  .page-index__promo-dark,
  .page-index__gifcode-tabs,
  .page-index__blog-slider,
  .page-index__blog-slider-wrap {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    overflow: hidden !important;
  }

  .page-index__video-section {
    padding-top: 10px !important;
    padding-bottom: 40px !important;
  }

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

  .page-index__gifcode-title {
    font-size: 1.8rem;
  }

  .page-index__gifcode-tab-nav {
    gap: 15px;
    margin-bottom: 30px;
  }

  .page-index__gifcode-tab-nav a {
    font-size: 1rem;
    padding: 8px 10px;
  }

  .page-index__gifcode-col {
    flex: 1 1 100%; /* Single column on mobile */
  }

  .page-index__blog-section-title {
    font-size: 1.6rem;
    margin-top: 40px;
    margin-bottom: 30px;
  }

  .page-index__blog-slider-wrap {
    padding: 0 15px; /* Adjust padding for mobile arrows */
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }
}

@media (max-width: 549px) {
  .page-index__blog-slider-wrap {
    padding: 0 35px; /* Ensure arrows are visible */
  }
  .page-index__post-item {
    flex: 0 0 100%; /* 1 card visible on small mobile */
  }
  .page-index__blog-slider-prev {
    left: 5px;
  }
  .page-index__blog-slider-next {
    right: 5px;
  }
}