/**
 * RESPONSIVE FIX CSS
 * File ini untuk memperbaiki masalah responsivitas website LHR 2025
 * Tambahkan di header.php setelah style.css
 */

/* ============================================
   FIX 1: Card dengan width viewport
   ============================================ */
.card-tbl.data-utm.bg-white {
  width: 100% !important;
  max-width: 98vw;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* ============================================
   FIX 2: Card1-data dengan 100vw
   ============================================ */
.card1-data {
  width: 100% !important;
  max-width: 100vw;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* ============================================
   FIX 3: Footer image container (131vw - sangat bermasalah!)
   ============================================ */
.img-proyek {
  width: 100% !important;
  max-width: 100vw;
  margin: 4vh 0;
  padding: 0 1rem;
  box-sizing: border-box;
}

.img-proyek img {
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* ============================================
   FIX 4: Video player responsif
   ============================================ */
video {
  width: 100% !important;
  max-width: 720px;
  height: auto !important;
}

/* ============================================
   FIX 5: Button dengan width viewport
   ============================================ */
button.btn.btn-primary.ekr {
  min-width: 40px;
  width: auto !important;
  padding: 0.5rem 1rem;
}

button.btn.btn-primary.rumus {
  min-width: 80px;
  width: auto !important;
  padding: 0.5rem 1rem;
}

/* ============================================
   FIX 6: Grafik box responsif
   ============================================ */
.grafik-box {
  width: 100% !important;
  max-width: 47vw;
  box-sizing: border-box;
}

.grafik-chart {
  width: 100% !important;
  max-width: 100vw;
  box-sizing: border-box;
}

/* ============================================
   FIX 7: Modal responsif
   ============================================ */
.modal-content {
  width: 90% !important;
  max-width: 80vw;
  box-sizing: border-box;
}

.modal-content.cacahruas {
  width: 90% !important;
  max-width: 80vw;
  box-sizing: border-box;
}

/* ============================================
   FIX 8: Map container height
   ============================================ */
.container-peta {
  height: 60vh;
  min-height: 400px;
  box-sizing: border-box;
}

.map1.leaflet-container {
  height: 35vh !important;
  min-height: 300px;
}

#map {
  min-height: 60vh !important;
}

/* ============================================
   FIX 9: Control forms width
   ============================================ */
.control-forms {
  width: 100% !important;
  max-width: 500px;
  box-sizing: border-box;
}

/* ============================================
   FIX 10: Card aduan width
   ============================================ */
.card-aduan {
  width: 95% !important;
  max-width: 79vw;
  margin: 20px auto !important;
  box-sizing: border-box;
}

/* ============================================
   FIX 11: Peta utama data isi
   ============================================ */
.peta-utama.data-isi {
  width: 100% !important;
  max-width: 500px;
  box-sizing: border-box;
}

/* ============================================
   FIX 12: Card left width
   ============================================ */
.card1-data .left {
  width: 100% !important;
  max-width: 350px;
  box-sizing: border-box;
}

/* ============================================
   FIX 13: Card1 width
   ============================================ */
.card1 {
  width: 100% !important;
  max-width: 300px;
  margin: 0 auto 20px !important;
  box-sizing: border-box;
}

/* ============================================
   FIX 14: Card login width
   ============================================ */
.card-tbl.data-login {
  width: 90% !important;
  max-width: 400px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ============================================
   FIX 15: Footer right width
   ============================================ */
.footer-right {
  width: 100% !important;
  max-width: 250px;
  margin: 20px auto !important;
  box-sizing: border-box;
}

/* ============================================
   MOBILE SPECIFIC FIXES (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {
  /* Grafik box full width di mobile */
  .grafik-box {
    width: 100% !important;
    max-width: 100%;
    margin: 10px 0;
  }

  /* Modal lebih lebar di mobile */
  .modal-content,
  .modal-content.cacahruas {
    width: 95% !important;
    max-width: 95vw;
    padding: 15px;
  }

  /* Map height lebih kecil di mobile */
  .container-peta {
    height: 50vh;
    min-height: 300px;
  }

  .map1.leaflet-container {
    height: 30vh !important;
    min-height: 250px;
  }

  #map {
    min-height: 50vh !important;
  }

  /* Card full width di mobile */
  .card-tbl {
    margin: 0 0 20px 0 !important;
    width: 100% !important;
  }

  /* Select dropdown full width */
  .form-select {
    width: 100% !important;
  }

  /* Row dengan gap lebih kecil */
  .row.g-2 {
    gap: 0.5rem !important;
  }

  /* Card aduan full width */
  .card-aduan {
    width: 95% !important;
    margin: 20px auto !important;
  }

  /* Container aduan image */
  .container-aduan img,
  .container-form img {
    width: 100% !important;
    margin: 20px 0 !important;
  }

  /* Table container */
  .table-container {
    flex-direction: column;
    padding: 0 5%;
  }

  /* Card1 data left */
  .card1-data .left {
    width: 100% !important;
    margin-bottom: 20px;
  }

  /* Peta utama */
  .peta-utama {
    width: 100% !important;
    margin: 10px 0 !important;
  }

  /* Video embed */
  .video-embed {
    width: 100% !important;
    padding: 10px;
  }

  /* Form control */
  .form-control {
    width: 100% !important;
  }

  /* Button group */
  .d-flex.gap-2 {
    flex-direction: column;
    gap: 0.5rem !important;
  }
}

/* ============================================
   TABLET SPECIFIC FIXES (768px - 991px)
   ============================================ */
@media (min-width: 768px) and (max-width: 991px) {
  .grafik-box {
    width: 100% !important;
    max-width: 100%;
  }

  .container-peta {
    height: 70vh;
  }

  .map1.leaflet-container {
    height: 40vh !important;
  }

  #map {
    min-height: 70vh !important;
  }
}

/* ============================================
   DESKTOP FIXES (992px+)
   ============================================ */
@media (min-width: 992px) {
  .container-peta {
    height: 80vh;
  }

  .map1.leaflet-container {
    height: 35vh !important;
  }

  #map {
    min-height: 80vh !important;
  }
}

/* ============================================
   GENERAL FIXES
   ============================================ */
/* Prevent horizontal scroll */
body,
html {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Box sizing untuk semua elemen */
* {
  box-sizing: border-box;
}

/* Image responsif */
img {
  max-width: 100%;
  height: auto;
}

/* Table responsif */
table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

@media (min-width: 768px) {
  table {
    display: table;
  }
}


