/*--------------------------------------------------------------
# Custom Index Page Styles
# File ini berisi style khusus halaman index/landing page
# Dipindahkan dari inline <style> di index.php agar lebih rapi
--------------------------------------------------------------*/

/* ============================================================
   CHART SECTION - Statistik (#services)
   ============================================================ */

/* Section Statistik - lebih kompak */
#services.services.section {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* Chart wrapper - ukuran lebih kecil & kompak */
#services .chart-wrapper {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: auto;
  overflow: hidden;
}

#services .chart-wrapper .chart-title {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  line-height: 1.3;
}

#services .chart-wrapper .chart-canvas-wrap {
  width: 100%;
  height: 280px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

#services .chart-wrapper .chart-canvas-wrap canvas {
  max-height: 280px !important;
  width: 100% !important;
}

/* Highcharts container - responsif penuh */
#services .chart-highcharts-container {
  width: 100%;
  height: 100%;
  min-height: 260px;
}

/* Highcharts pie: teks label & legend hitam */
#services .chart-wrapper .chart-canvas-wrap .highcharts-data-labels text,
#services .chart-wrapper .chart-canvas-wrap .highcharts-legend-item text {
  fill: #000000 !important;
  color: #000000 !important;
}

/* Pie Persemaian di baris atas: sedikit lebih besar dari chart lain */
#services .chart-canvas-wrap--large {
  height: 320px;
}

#services .chart-canvas-wrap--large .chart-highcharts-container {
  min-height: 300px;
}

/* Kurangi gap antar baris chart */
#services .row.gy-4 {
  --bs-gutter-y: 1rem;
}

#services .row.mt-2 {
  margin-top: 0.5rem !important;
}

/* ---- Tablet landscape (max 991px) ---- */
@media (max-width: 991px) {
  #services.services.section {
    padding-top: 30px;
    padding-bottom: 30px;
  }
  #services .chart-wrapper .chart-canvas-wrap {
    height: 250px;
  }
  #services .chart-wrapper .chart-canvas-wrap canvas {
    max-height: 250px !important;
  }
  #services .chart-highcharts-container {
    min-height: 230px;
  }
  #services .chart-canvas-wrap--large {
    height: 280px;
  }
  #services .chart-canvas-wrap--large .chart-highcharts-container {
    min-height: 260px;
  }
}

/* ---- Tablet portrait / phablet (max 767px) ---- */
@media (max-width: 767px) {
  #services.services.section {
    padding-top: 25px;
    padding-bottom: 25px;
  }
  #services .chart-wrapper {
    padding: 10px;
  }
  #services .chart-wrapper .chart-title {
    font-size: 13px;
    margin-bottom: 6px;
  }
  #services .chart-wrapper .chart-canvas-wrap {
    height: 230px;
  }
  #services .chart-wrapper .chart-canvas-wrap canvas {
    max-height: 230px !important;
  }
  #services .chart-highcharts-container {
    min-height: 210px;
  }
  #services .chart-canvas-wrap--large {
    height: 260px;
  }
  #services .chart-canvas-wrap--large .chart-highcharts-container {
    min-height: 240px;
  }

  /* Highcharts legend & label lebih kecil di tablet */
  #services .chart-wrapper .chart-canvas-wrap .highcharts-legend-item text {
    font-size: 11px !important;
  }
  #services .chart-wrapper .chart-canvas-wrap .highcharts-data-labels text {
    font-size: 10px !important;
  }
}

/* ============================================================
   NEWS SECTION - Berita Card & Swiper
   ============================================================ */

.news-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 35px rgba(0, 0, 0, 0.15);
}

.news-image {
  position: relative;
  overflow: hidden;
}

.news-image img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
  transform: scale(1.1);
}

.news-date {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 15px;
  font-size: 14px;
  border-top-right-radius: 10px;
}

.news-content {
  padding: 20px;
}

.news-category {
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 10px;
}

.news-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
  line-height: 1.4;
}

.news-excerpt {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 15px;
}

.news-actions {
  display: flex;
  gap: 10px;
}

.news-actions a {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 50%;
  color: #333;
  transition: all 0.3s ease;
}

.news-actions a:hover {
  background: #0d6efd;
  color: #fff;
}

.swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: #0d6efd;
  opacity: 0.5;
}

.swiper-pagination-bullet-active {
  opacity: 1;
}

/* ============================================================
   RESPONSIVE - Mobile & Tablet (setelah logo-app pindah ke slider)
   ============================================================ */

/* ---- Tablet (max 768px) ---- */
@media (max-width: 768px) {

  /* About Section */
  #about .about-img img {
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
  }
  #about .about-img .position-absolute {
    font-size: 0.85rem;
  }
  #about .about-img .position-absolute h4 {
    font-size: 1rem;
  }
  #about .about-content h3 {
    font-size: 1.3rem;
  }
  #about .about-content h4 {
    font-size: 1.1rem;
  }
  #about .about-content p.lead {
    font-size: 0.92rem;
    line-height: 1.6;
  }
  #about .about-content p {
    font-size: 0.88rem;
  }

  /* News Section */
  .news-image img {
    height: 200px;
  }
  .news-title {
    font-size: 16px;
  }
  .news-excerpt {
    font-size: 13px;
  }
  .news-content {
    padding: 15px;
  }

  /* Pejabat Section */
  #pejabat .member .pic img {
    height: 280px;
    object-fit: cover;
    object-position: top;
  }
  #pejabat .member .member-info h5 {
    font-size: 0.85rem;
  }
  #pejabat .member .member-info span {
    font-size: 0.78rem;
  }

  /* Chart Section - duplikat dihapus, dihandle di media query chart khusus di atas */

  /* Contact / Pengaduan Section */
  #contact .section-title h2 {
    font-size: 1.3rem;
  }
  #contact .section-title h5 {
    font-size: 0.9rem;
  }
  #contact .section-title small {
    font-size: 0.78rem;
  }
}

/* ---- Mobile (max 576px) ---- */
@media (max-width: 576px) {

  /* About Section - stack vertically */
  #about .about-img img {
    max-height: 250px;
  }
  #about .about-img .position-absolute {
    padding: 8px !important;
  }
  #about .about-img .position-absolute h4 {
    font-size: 0.9rem;
  }
  #about .about-img .position-absolute p {
    font-size: 0.75rem;
  }
  #about .about-content {
    padding-left: 0 !important;
  }
  #about .about-content h3 {
    font-size: 1.15rem;
  }
  #about .about-content h4 {
    font-size: 1rem;
  }
  #about .about-content p.lead {
    font-size: 0.85rem;
  }
  #about .about-content .col-md-6 span {
    font-size: 0.82rem;
  }

  /* News Section */
  .news-image img {
    height: 180px;
  }
  .news-title {
    font-size: 15px;
  }
  .news-excerpt {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .news-date {
    font-size: 12px;
    padding: 5px 10px;
  }
  .news-content {
    padding: 12px;
  }
  .news-actions a {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  /* Pejabat Section */
  #pejabat .member .pic img {
    height: 240px;
  }
  #pejabat .member .member-info {
    padding: 12px;
  }
  #pejabat .member .member-info h5 {
    font-size: 0.8rem;
  }
  #pejabat .member .member-info span {
    font-size: 0.72rem;
  }

  /* Chart Section - Mobile */
  #services.services.section {
    padding-top: 20px;
    padding-bottom: 20px;
  }
  #services .chart-wrapper {
    padding: 8px;
    border-radius: 8px;
  }
  #services .chart-wrapper .chart-title {
    font-size: 12px;
    margin-bottom: 6px;
  }
  #services .chart-wrapper .chart-canvas-wrap {
    height: 200px;
  }
  #services .chart-wrapper .chart-canvas-wrap canvas {
    max-height: 200px !important;
  }
  #services .chart-highcharts-container {
    min-height: 180px;
  }
  #services .chart-canvas-wrap--large {
    height: 230px;
  }
  #services .chart-canvas-wrap--large .chart-highcharts-container {
    min-height: 210px;
  }
  /* Row gap lebih kecil di mobile */
  #services .row.gy-4 {
    --bs-gutter-y: 0.75rem;
  }
  #services .row.mt-2 {
    margin-top: 0.25rem !important;
  }
  /* Highcharts legend & label lebih kecil di mobile */
  #services .chart-wrapper .chart-canvas-wrap .highcharts-legend-item text {
    font-size: 10px !important;
  }
  #services .chart-wrapper .chart-canvas-wrap .highcharts-data-labels text {
    font-size: 9px !important;
  }

  /* Contact / Pengaduan Section */
  #contact .section-title h2 {
    font-size: 1.1rem;
  }
  #contact .section-title h5 {
    font-size: 0.82rem;
  }
  #contact .section-title small {
    font-size: 0.72rem;
    line-height: 1.4;
  }

  /* Section title global */
  .section-title h2 {
    font-size: 1.3rem;
  }
  .section-title p {
    font-size: 1.1rem !important;
  }
}

/* ---- Mobile kecil (max 400px) ---- */
@media (max-width: 400px) {

  /* About Section */
  #about .about-img img {
    max-height: 200px;
  }
  #about .about-content h3 {
    font-size: 1rem;
  }
  #about .about-content p.lead {
    font-size: 0.8rem;
  }

  /* News Section */
  .news-image img {
    height: 150px;
  }
  .news-title {
    font-size: 14px;
  }

  /* Pejabat Section */
  #pejabat .member .pic img {
    height: 200px;
  }
  #pejabat .member .member-info h5 {
    font-size: 0.75rem;
  }

  /* Chart Section - Mobile kecil */
  #services.services.section {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  #services .chart-wrapper {
    padding: 6px;
  }
  #services .chart-wrapper .chart-title {
    font-size: 11px;
    margin-bottom: 4px;
  }
  #services .chart-wrapper .chart-canvas-wrap {
    height: 180px;
  }
  #services .chart-wrapper .chart-canvas-wrap canvas {
    max-height: 180px !important;
  }
  #services .chart-highcharts-container {
    min-height: 160px;
  }
  #services .chart-canvas-wrap--large {
    height: 200px;
  }
  #services .chart-canvas-wrap--large .chart-highcharts-container {
    min-height: 180px;
  }
  /* Sembunyikan data label di layar sangat kecil untuk menghindari overlap */
  #services .chart-wrapper .chart-canvas-wrap .highcharts-data-labels {
    display: none !important;
  }
}
