/* General page-index styles */
.page-index {
  font-family: Arial, sans-serif;
  color: #1F2D3D; /* Text Main */
  background: #F4F7FB; /* Background */
  line-height: 1.6;
}

.page-index__section {
  padding: 20px 0;
  margin-bottom: 20px;
}

.page-index__section-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__section-title {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30px;
  color: #2F6BFF;
  position: relative;
  padding-bottom: 15px;
}

/* TieuDeVip style */
.tieudevip {
  font-size: 2.5em;
  font-weight: 700;
  color: #2F6BFF;
  text-align: center;
  margin-bottom: 40px;
  padding: 10px 20px;
  border: 2px solid #2F6BFF;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(47, 107, 255, 0.2);
  display: inline-block;
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Buttons */
.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-width: 100%; /* For responsiveness */
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text wrap */
}

.page-index__btn-primary {
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%); /* Button color */
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.4);
}

.page-index__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(47, 107, 255, 0.6);
}

.page-index__btn-secondary {
  background: #FFFFFF;
  color: #2F6BFF;
  border: 2px solid #2F6BFF;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.2);
}

.page-index__btn-secondary:hover {
  background: #2F6BFF;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(47, 107, 255, 0.4);
}

/* Images basic responsive */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Module 0: Hero Carousel */
.page-index__hero-carousel-section {
  padding-top: 10px; /* Assuming shared.css handles body padding-top */
  margin-bottom: 0;
  overflow: hidden; /* To contain slider elements */
}

.page-index__hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.page-index__hero-slide {
  display: none;
  width: 100%;
}

.page-index__hero-slide.is-active {
  display: block;
}

.page-index__hero-slider-prev,
.page-index__hero-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  font-size: 1.5em;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.page-index__hero-slider-prev:hover,
.page-index__hero-slider-next:hover {
  opacity: 1;
}

.page-index__hero-slider-prev {
  left: 10px;
}

.page-index__hero-slider-next {
  right: 10px;
}

.page-index__hero-slider-prev::before { content: '‹'; }
.page-index__hero-slider-next::before { content: '›'; }

.page-index__hero-slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.page-index__hero-slider-dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.page-index__hero-slider-dot.is-active {
  background: #FFFFFF;
}

/* Module 1: Operation Guide Section */
.page-index__guide-section {
  padding: 40px 0;
}

.page-index__guide-box {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px 24px;
  background: #f5e6d3; /* Light beige as per demo */
  border-radius: 4px;
  box-sizing: border-box;
  text-align: center; /* To center the tieudevip title */
}

.page-index__guide-grid {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping on desktop */
  align-items: flex-start; /* For staggered effect */
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.page-index__guide-card {
  display: block;
  flex: 0 0 19%; /* Adjusted to fit 5 cards with gap */
  max-width: 19%; /* Adjusted for 5 cards */
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.page-index__guide-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.page-index__guide-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 250 / 350; /* Maintain portrait aspect ratio */
  object-fit: contain; /* Ensure image content is visible */
  display: block;
}

/* PC staggered layout for guide cards */
.page-index__guide-card--pos-1,
.page-index__guide-card--pos-5 {
  padding-top: 50px;
}

.page-index__guide-card--pos-2,
.page-index__guide-card--pos-4 {
  padding-top: 25px;
}

.page-index__guide-card--pos-3 {
  padding-top: 0;
}

/* Module 2: Home Content Long Text Area */
.page-index__home-content-section {
  padding: 40px 0;
  background: #F4F7FB; /* Consistent with body background */
}

.page-index__home-content-row {
  display: flex;
  justify-content: center;
}

.page-index__home-content-box {
  max-width: 91%; /* As per requirement */
  margin: 0 auto;
  padding: 10px 16px;
  border: 5px solid #3477c9; /* Blue border */
  border-radius: 15px;
  box-shadow: 0 0 20px #3477c9; /* Blue glow shadow */
  height: 700px; /* Fixed height for desktop */
  text-align: left;
  box-sizing: border-box;
  background: #FFFFFF; /* Card BG */
  color: #1F2D3D; /* Text Main */
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto; /* Scrollable content */
  overflow-x: hidden;
  padding-right: 8px; /* For scrollbar space */
}

.page-index__home-content-inner::-webkit-scrollbar {
  width: 8px;
}

.page-index__home-content-inner::-webkit-scrollbar-thumb {
  background-color: #A5C4FF; /* Glow color for scrollbar */
  border-radius: 4px;
}

.page-index__home-content-inner::-webkit-scrollbar-track {
  background-color: #D6E2FF; /* Border color for scrollbar track */
}

.page-index__home-content-title {
  font-size: 2.8em; /* H1 specific size, not too large */
  font-weight: bold;
  color: #000000; /* Custom Color_1776249996415 */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-index__home-content-subtitle {
  font-size: 1.8em; /* H2 specific size */
  font-weight: bold;
  color: #2F6BFF;
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-index__home-content-box h3 {
  font-size: 1.4em; /* H3 specific size */
  font-weight: bold;
  color: #1F2D3D;
  margin-top: 20px;
  margin-bottom: 10px;
}

.page-index__home-content-box p {
  margin-bottom: 15px;
  color: #1F2D3D;
}

.page-index__home-content-box ul,
.page-index__home-content-box ol {
  margin-bottom: 15px;
  padding-left: 25px;
  color: #1F2D3D;
}

.page-index__home-content-box li {
  margin-bottom: 8px;
}

.page-index__wp-caption {
  margin: 20px auto;
  text-align: center;
}

.page-index__wp-caption img {
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.page-index__wp-caption figcaption {
  font-style: italic;
  font-size: 0.9em;
  color: #666;
  margin-top: 10px;
}

/* Module 3: Latest Blog Posts Section */
.page-index__blog-section {
  padding: 40px 0;
  background: #F4F7FB;
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns for desktop */
  gap: 20px;
  margin-top: 30px;
}

.page-index__blog-card {
  background: #FFFFFF; /* Card BG */
  border-radius: 15px; /* Rounded corners for card */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.page-index__blog-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-index__blog-media {
  position: relative;
  overflow: hidden;
  border-radius: 15px 15px 0 0; /* Top corners rounded */
}

.page-index__blog-media img {
  width: 100%;
  height: 200px; /* Fixed height for blog card images */
  object-fit: cover;
  transition: transform 0.3s ease;
  border-radius: 15px 15px 0 0; /* Apply border-radius to image as well */
}

.page-index__blog-card:hover .page-index__blog-media img {
  transform: scale(1.05);
}

.page-index__blog-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #2F6BFF;
  color: #FFFFFF;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
}

.page-index__blog-date span:first-child {
  display: block;
  font-size: 1.2em;
}

.page-index__blog-title {
  font-size: 1.3em;
  font-weight: bold;
  color: #1F2D3D;
  padding: 15px 15px 5px;
  line-height: 1.4;
}

.page-index__blog-excerpt {
  font-size: 0.9em;
  color: #666;
  padding: 0 15px 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-index__view-all-posts {
  text-align: center;
  margin-top: 40px;
}

/* Module 4: App Download Section */
.page-index__app-download-section {
  padding: 40px 0;
  background: #F4F7FB;
  text-align: center;
}

.page-index__app-download-description {
  font-size: 1.1em;
  color: #1F2D3D;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__app-download-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

/* Image captions for app download */
.page-index__app-download-section .page-index__wp-caption img {
  max-width: 400px; /* Smaller image for QR code */
}

/* ==========================================================================
   Mobile Styles (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .page-index__section-content {
    padding: 0 10px;
  }

  .page-index__section-title {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  .tieudevip {
    font-size: 1.8em;
    padding: 8px 15px;
    margin-bottom: 25px;
    max-width: 95%;
  }

  /* Universal image responsiveness for mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  /* Universal container responsiveness for mobile */
  .page-index__section,
  .page-index__card,
  .page-index__container,
  .page-index__home-content-box,
  .page-index__guide-box,
  .page-index__app-download-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Universal button responsiveness for mobile */
  .page-index__cta-button,
  .page-index__btn-primary,
  .page-index__btn-secondary,
  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-index__app-download-buttons {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 10px;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Module 0: Hero Carousel */
  .page-index__hero-carousel-section {
    padding-top: 10px !important; /* Keep small top padding */
  }
  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 8px 12px;
    font-size: 1.2em;
  }
  .page-index__hero-slider-dots {
    bottom: 5px;
    gap: 5px;
  }
  .page-index__hero-slider-dot {
    width: 8px;
    height: 8px;
  }

  /* Module 1: Operation Guide Section */
  .page-index__guide-section {
    padding: 20px 0;
  }
  .page-index__guide-box {
    padding: 15px 10px;
  }
  .page-index__guide-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 columns for 2+3 layout */
    gap: 8px;
    margin-top: 20px;
  }
  .page-index__guide-card {
    flex: none;
    max-width: none;
    padding-top: 0 !important;
  }
  .page-index__guide-card--pos-1,
  .page-index__guide-card--pos-2 {
    grid-column: span 3; /* First two cards take 3 columns each (50%) */
  }
  .page-index__guide-card--pos-3,
  .page-index__guide-card--pos-4,
  .page-index__guide-card--pos-5 {
    grid-column: span 2; /* Last three cards take 2 columns each (33.33%) */
  }
  .page-index__guide-card img {
    height: auto; /* Maintain aspect ratio */
  }

  /* Module 2: Home Content Long Text Area */
  .page-index__home-content-section {
    padding: 20px 0;
  }
  .page-index__home-content-box {
    max-width: 100%;
    height: auto; /* Auto height for mobile */
    padding: 20px 15px;
    border-width: 3px;
    box-shadow: 0 0 10px #3477c9;
  }
  .page-index__home-content-inner {
    height: auto; /* Auto height for mobile */
    overflow: visible; /* No scrollbar for mobile */
    padding-right: 0;
  }
  .page-index__home-content-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }
  .page-index__home-content-subtitle {
    font-size: 1.4em;
    margin-top: 25px;
    margin-bottom: 10px;
  }
  .page-index__home-content-box h3 {
    font-size: 1.2em;
    margin-top: 15px;
    margin-bottom: 8px;
  }
  .page-index__home-content-box p,
  .page-index__home-content-box ul,
  .page-index__home-content-box ol,
  .page-index__home-content-box li {
    font-size: 0.95em;
  }

  /* Module 3: Latest Blog Posts Section */
  .page-index__blog-section {
    padding: 20px 0;
  }
  .page-index__blog-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for mobile */
    gap: 15px;
    margin-top: 20px;
  }
  .page-index__blog-card {
    border-radius: 10px;
  }
}