/* assets/css/style.css — Tema K3: Hijau #2E7D32, Oranye #FF9800, Biru #1976D2 */
:root {
  --k3-green: #2e7d32;
  --k3-green-dark: #1b5e20;
  --k3-orange: #ff9800;
  --k3-blue: #1976d2;
  --k3-light: #f4f8f5;
}

/* CEGAH HORIZONTAL SCROLLBAR DI SELURUH DEVICE */
html,
body {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.bg-k3-light {
  background: var(--k3-light);
}
.bg-k3-green {
  background-color: var(--k3-green) !important;
}
.bg-k3-blue {
  background-color: var(--k3-blue) !important;
}
.bg-k3-orange {
  background-color: var(--k3-orange) !important;
}
.text-k3-green {
  color: var(--k3-green) !important;
}
.text-k3-blue {
  color: var(--k3-blue) !important;
}
.bg-k3-navy {
  background: #0a2540 !important;
}
.extra-small {
  font-size: 0.75rem;
}
.py-1-5 {
  padding-top: 0.375rem !important;
  padding-bottom: 0.375rem !important;
}

/* ===== Navbar Seamless Clean Style ===== */
.navbar-k3 {
  background: #0a2540 !important;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand-text .small-sub {
  font-size: 0.725rem;
  letter-spacing: 0.3px;
}

.custom-nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: color 0.2s ease;
  border-radius: 6px;
}

.custom-nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.05);
}

.custom-nav-link.active {
  color: #ffffff !important;
  font-weight: 600;
  background: transparent !important;
}

.custom-nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 12px;
  right: 12px;
  height: 3px;
  background-color: var(--k3-orange);
  border-radius: 2px;
}

.custom-nav-link i {
  font-size: 1.05rem;
  opacity: 0.8;
}

.custom-nav-link.active i {
  color: var(--k3-orange);
  opacity: 1;
}

/* Dropdown Menu Navbar untuk HP */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: rgba(10, 37, 64, 0.98);
    padding: 1rem;
    border-radius: 1rem;
    margin-top: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  }
}

/* Tombol bertema */
.btn-k3-green {
  background: var(--k3-green);
  border-color: var(--k3-green);
  color: #fff;
}
.btn-k3-green:hover {
  background: var(--k3-green-dark);
  border-color: var(--k3-green-dark);
  color: #fff;
}
.btn-k3-blue {
  background: var(--k3-blue);
  border-color: var(--k3-blue);
  color: #fff;
}
.btn-k3-blue:hover {
  background: #0d47a1;
  border-color: #0d47a1;
  color: #fff;
}
.btn-k3-orange {
  background: var(--k3-orange);
  border-color: var(--k3-orange);
  color: #3b2300;
  font-weight: 600;
}
.btn-k3-orange:hover {
  background: #e68900;
  border-color: #e68900;
  color: #3b2300;
}

/* Kartu */
.card {
  border-radius: 1rem;
}
.card-hover {
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.25rem rgba(0, 0, 0, 0.12) !important;
}
.card-login {
  max-width: 480px;
  margin: 0 auto;
}
.stat-angka {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

/* ===== Hero Landing (Full Bleed Presisi Sesuai Gambar) ===== */
.hero {
  background: 
    linear-gradient(90deg, rgba(10, 37, 64, 0.95) 0%, rgba(10, 37, 64, 0.85) 45%, rgba(10, 37, 64, 0.2) 100%),
    url("../img/bg-hero.jpg");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  color: #fff;
  border-radius: 0 !important;
  padding: 4rem 1.5rem;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -1.5rem !important;
  margin-bottom: 2rem;
  min-height: 480px;
  display: flex;
  align-items: center;
}

.hero .badge-k3 {
  background: var(--k3-orange, #ff9800);
  color: #3b2300;
  white-space: normal;
  display: inline-block;
  max-width: 100%;
}

/* Responsif untuk Tampilan HP / Tablet */
@media (max-width: 767.98px) {
  .hero {
    padding: 2.5rem 1rem !important;
    margin-top: -1rem !important;
    background: 
      linear-gradient(180deg, rgba(10, 37, 64, 0.95) 0%, rgba(10, 37, 64, 0.85) 100%),
      url("../img/bg-hero.jpg");
    background-size: cover;
    background-position: center;
    min-height: auto;
  }
}

/* Materi K3 */
.sym {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  flex: 0 0 56px;
}
.sym.circle {
  border-radius: 50%;
}
.sym.square {
  border-radius: 10px;
}
.sym.tri {
  clip-path: polygon(50% 4%, 100% 94%, 0 94%);
  padding-top: 14px;
}
.apd-item {
  background: #e8f5e9;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  height: 100%;
}

/* Kuis & kalkulator */
.opsi-kuis {
  text-align: left;
  white-space: normal;
}
.opsi-kuis.benar {
  background: #e8f5e9;
  border-color: var(--k3-green);
}
.opsi-kuis.salah {
  background: #fdecea;
  border-color: #d32f2f;
}
.skenario {
  background: #fff3e0;
  border-left: 6px solid var(--k3-orange);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}
.cek-kondisi.on {
  background: #fff3e0;
  border-color: var(--k3-orange) !important;
}
.meter {
  height: 16px;
  background: #dbe6de;
  border-radius: 999px;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: 0;
  transition:
    width 0.5s ease,
    background 0.3s;
}
.status-aman {
  color: var(--k3-green);
}
.status-waspada {
  color: #e65100;
}
.status-bahaya {
  color: #d32f2f;
}

/* Cetak laporan */
@media print {
  body.bg-k3-light {
    background: #fff;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  a[href]:after {
    content: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ===== Carousel Infografis ===== */
.carousel-infografis {
  background: transparent !important;
  border-radius: 1rem;
  overflow: hidden;
  max-width: 500px;
  margin: 0 auto;
}

.carousel-infografis .slide-btn {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.carousel-infografis img {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  border-radius: 1rem;
}

.media-card {
  border-top: 5px solid var(--k3-green) !important;
}
.media-card.k3-orange {
  border-top-color: var(--k3-orange) !important;
}
.media-card.k3-blue {
  border-top-color: var(--k3-blue) !important;
}
.media-card.k3-green {
  border-top-color: var(--k3-green) !important;
}
.media-ikon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.media-card .card-arrow {
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}
.media-card:hover .card-arrow {
  transform: translateX(4px);
  color: var(--k3-green) !important;
}

.chat-box {
  max-height: 420px;
  overflow-y: auto;
  background: #f4f8f5;
  border-radius: 0.75rem;
  padding: 0.75rem;
}
.chat-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.6rem;
}
.chat-row.me {
  justify-content: flex-end;
}
.chat-avatar {
  font-size: 1.6rem;
  flex: 0 0 auto;
}
.chat-bubble {
  max-width: 82%;
  padding: 0.55rem 0.8rem;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.chat-bubble.hr {
  background: #fff;
  border-bottom-left-radius: 0.2rem;
}
.chat-bubble.me {
  background: var(--k3-blue);
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

.kabel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.5rem;
}
.kabel-slot,
.kabel-pilih {
  border: 2px solid #dbe6de;
  background: #fff;
  border-radius: 0.6rem;
  padding: 0.4rem;
  text-align: center;
  font-size: 0.75rem;
  cursor: pointer;
  position: relative;
}
.kabel-pilih:hover:not(:disabled),
.kabel-slot:hover:not(:disabled) {
  border-color: var(--k3-blue);
}
.kabel-pilih:disabled {
  opacity: 0.35;
  cursor: default;
}
.kabel-slot:disabled {
  background: #f7f9f8;
  cursor: default;
}
.kabel-warna {
  display: block;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #888;
  margin-bottom: 4px;
}
.kabel-no {
  position: absolute;
  top: -9px;
  left: -6px;
  background: var(--k3-green);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  line-height: 20px;
  font-weight: 700;
}
#topo-tombol .btn.active {
  background: var(--k3-green);
  color: #fff;
}

/* ===== Swiper Coverflow Style ===== */
.swiper-infografis {
  width: 100%;
  padding-top: 20px;
  padding-bottom: 40px;
}

.swiper-infografis .swiper-slide {
  width: 320px;
  transition: all 0.4s ease;
  height: auto;
}

/* Khusus Tampilan Layar HP (Dibawah 576px) */
@media (max-width: 575.98px) {
  .swiper-infografis .swiper-slide {
    width: 250px !important; /* Lebar poster yang pas di layar HP */
    margin: 0 auto;
  }

  /* Melunakkan efek pembesaran di HP agar tidak terlalu terdorong ke atas */
  .swiper-infografis .swiper-slide-active {
    transform: scale(1.02) !important;
  }
}

/* Efek Poster Samping (Non-Active) */
.swiper-infografis .swiper-slide:not(.swiper-slide-active) {
  filter: blur(4px) opacity(0.5);
  transform: scale(0.85);
}

/* Efek Poster Tengah (Active / Focus) */
.swiper-infografis .swiper-slide-active {
  filter: blur(0) opacity(1);
  transform: scale(1.05);
  z-index: 10;
}

.poster-coverflow-card {
  background: transparent !important;
}

.swiper-slide-active .poster-coverflow-card {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2) !important;
}

.poster-img-container {
  height: auto !important;
  overflow: hidden;
  display: block;
  background-color: transparent;
  border-radius: 1rem;
}

.poster-img-container img {
  width: 100%;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 1rem;
  display: block;
}

/* Tombol Navigasi Swiper */
.custom-swiper-nav {
  width: 44px;
  height: 44px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #2e7d32 !important;
  border: 1px solid #e0e0e0;
}

.custom-swiper-nav::after {
  font-size: 18px !important;
  font-weight: bold;
}

.swiper-pagination-bullet-active {
  background-color: #2e7d32 !important;
}

/* ===== Hover Effect ===== */
.hover-opacity {
  transition:
    opacity 0.2s ease,
    background-color 0.2s ease;
}
.hover-opacity:hover {
  opacity: 0.85;
}
