.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light body background */
  background-color: #ffffff;
}

.page-index__section {
  padding: 40px 0;
  text-align: center;
}

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

.page-index__section-title {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 30px;
  color: #26A9E0;
}

.tieudevip {
  display: inline-block;
  padding: 10px 20px;
  border: 2px solid #26A9E0;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(38, 169, 224, 0.2);
  text-transform: uppercase;
  font-size: 1.8em;
  color: #26A9E0;
  margin-bottom: 30px;
}

/* Module 0: Hero Carousel */
.page-index__hero-carousel-section {
  padding-top: 10px; /* Offset for fixed header, as body padding-top is handled by shared.css */
  padding-bottom: 0;
  overflow: hidden;
  position: relative;
}

.page-index__hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 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-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

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

.page-index__hero-slider-prev:hover,
.page-index__hero-slider-next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.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;
}

.page-index__hero-slider-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
}

.page-index__hero-slider-dots button.is-active {
  background-color: #26A9E0;
}

/* Module 1: Guide Section */
.page-index__guide-section {
  padding-top: 60px;
  padding-bottom: 60px;
}

.page-index__guide-box {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px 24px;
  background: #f5e6d3;
  border-radius: 4px;
  box-sizing: border-box;
}

.page-index__guide-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* For staggered layout */
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.page-index__guide-card {
  display: block;
  flex: 0 0 calc(20% - 8px); /* Account for gap */
  max-width: calc(20% - 8px);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-index__guide-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 250 / 350; /* Maintain portrait aspect ratio */
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

/* PC staggered layout */
.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-top: 60px;
  padding-bottom: 60px;
  background-color: #f9f9f9;
}

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

.page-index__home-content-box {
  max-width: 91%; /* ~1100px on 1200px container */
  margin: 0 auto;
  padding: 10px 16px;
  border: 5px solid #26A9E0; /* Using brand color */
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(38, 169, 224, 0.5); /* Using brand color */
  height: 700px; /* Fixed height for desktop */
  text-align: left;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #333333;
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 15px; /* Space for scrollbar */
  box-sizing: border-box;
}

.page-index__home-content-inner h1.page-index__home-content-title {
  font-size: 2.2em;
  font-weight: bold;
  color: #26A9E0;
  margin-bottom: 20px;
  text-align: center;
}

.page-index__home-content-inner h2 {
  font-size: 1.8em;
  color: #26A9E0;
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-index__home-content-inner h3 {
  font-size: 1.4em;
  color: #333333;
  margin-top: 25px;
  margin-bottom: 10px;
}

.page-index__home-content-inner p {
  margin-bottom: 15px;
  font-size: 1em;
  line-height: 1.7;
}

.page-index__home-content-inner ul,
.page-index__home-content-inner ol {
  margin-bottom: 15px;
  padding-left: 25px;
  text-align: left;
}

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

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

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

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

/* Module 3: Latest Blog Posts */
.page-index__blog-section {
  padding-top: 60px;
  padding-bottom: 60px;
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Changed to 3 columns for better fit with 6-8 cards */
  gap: 25px;
  margin-top: 30px;
}

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

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

.page-index__blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-index__blog-media {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.page-index__blog-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.page-index__blog-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: #26A9E0;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.85em;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

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

.page-index__blog-title {
  font-size: 1.25em;
  color: #26A9E0;
  margin: 15px;
  font-weight: bold;
  flex-grow: 1;
}

.page-index__blog-excerpt {
  font-size: 0.95em;
  color: #666666;
  margin: 0 15px 15px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Limit to 2 lines */
  -webkit-box-orient: vertical;
}

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

/* Module 4: App Download Promotion */
.page-index__app-download-section {
  background-color: #26A9E0;
  color: #ffffff;
  padding: 60px 0;
}

.page-index__app-download-section .page-index__section-title {
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

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

.page-index__app-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary {
  background-color: #EA7C07; /* Login color for primary action */
  color: #ffffff;
  border: 2px solid #EA7C07;
}

.page-index__btn-primary:hover {
  background-color: #d16b00;
  border-color: #d16b00;
}

.page-index__btn-secondary {
  background-color: #ffffff;
  color: #26A9E0;
  border: 2px solid #ffffff;
}

.page-index__btn-secondary:hover {
  background-color: #f0f0f0;
  border-color: #f0f0f0;
}

/* General image responsiveness */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Media Queries for Responsive Design */
@media (max-width: 1024px) {
  .page-index__blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .page-index__section {
    padding: 30px 0;
  }

  .page-index__section-content {
    padding: 0 15px; /* Add padding for mobile content */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-index__section-title,
  .tieudevip {
    font-size: 1.5em;
    margin-bottom: 20px;
    padding: 8px 15px;
  }

  /* Module 0: Hero Carousel - Mobile */
  .page-index__hero-carousel-section {
    padding-top: 10px !important; /* Ensure minimal top padding */
  }

  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    font-size: 1.2em;
    padding: 8px 12px;
  }

  /* Module 1: Guide Section - Mobile */
  .page-index__guide-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .page-index__guide-box {
    padding: 15px;
  }

  .page-index__guide-grid {
    display: grid; /* Use grid for mobile layout */
    grid-template-columns: repeat(6, 1fr); /* Base for 2 or 3 columns */
    gap: 10px;
    margin-top: 15px;
  }

  .page-index__guide-card {
    flex: none; /* Reset flex properties */
    max-width: none; /* Reset max-width */
    padding-top: 0 !important; /* Remove staggered padding */
  }

  /* Mobile layout: 2 cards in first row, 3 cards in second row */
  .page-index__guide-card--pos-1,
  .page-index__guide-card--pos-2 {
    grid-column: span 3; /* Two items, each takes half (3/6) */
  }

  .page-index__guide-card--pos-3,
  .page-index__guide-card--pos-4,
  .page-index__guide-card--pos-5 {
    grid-column: span 2; /* Three items, each takes one-third (2/6) */
  }

  .page-index__guide-card img {
    aspect-ratio: 250 / 350; /* Maintain portrait aspect ratio */
    object-fit: contain;
  }

  /* Module 2: Home Content Long Text Area - Mobile */
  .page-index__home-content-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .page-index__home-content-box {
    max-width: 100%;
    height: auto; /* Allow height to expand */
    padding: 15px;
    border-width: 3px;
    box-shadow: 0 0 10px rgba(38, 169, 224, 0.3);
  }

  .page-index__home-content-inner {
    height: auto; /* Allow content to scroll naturally */
    overflow-y: visible; /* Remove scrollbar */
    padding-right: 0; /* No scrollbar padding */
  }

  .page-index__home-content-inner h1.page-index__home-content-title {
    font-size: 1.6em;
  }

  .page-index__home-content-inner h2 {
    font-size: 1.4em;
  }

  .page-index__home-content-inner h3 {
    font-size: 1.2em;
  }

  /* Module 3: Latest Blog Posts - Mobile */
  .page-index__blog-section {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .page-index__blog-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .page-index__blog-card {
    margin-bottom: 0;
  }

  .page-index__blog-title {
    font-size: 1.1em;
  }

  .page-index__blog-excerpt {
    font-size: 0.9em;
  }

  /* Module 4: App Download Promotion - Mobile */
  .page-index__app-download-section {
    padding: 40px 0;
  }

  .page-index__app-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__btn-primary,
  .page-index__btn-secondary {
    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;
  }

  /* General image responsiveness for mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__card,
  .page-index__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}