/* RESET & GAYA DASAR (DESKTOP / SMART TV >= 1024px) */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Segoe UI', sans-serif; background: #f1f5f9; color: #1e293b; }

.page-wrapper {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  grid-template-areas:
    "header header header"
    "sidebar main promo"
    "footer footer footer";
  gap: 16px;
  max-width: 1440px; /* Menjaga agar tetap proporsional di Smart TV / 4K */
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

.header {
  grid-area: header;
  background: #1b365d; color: #fff;
  padding: 16px 24px; border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.logo { font-weight: bold; font-size: 1.2rem; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: #e2e8f0; text-decoration: none; font-weight: 500; }
.hamburger-btn {
  display: none; /* Disembunyikan di Desktop & Tablet */
  background: #2563eb; color: #fff; border: none;
  padding: 8px 12px; border-radius: 6px; font-size: 1.2rem; cursor: pointer;
}

.sidebar-kiri {
  grid-area: sidebar; background: #0d9488; color: #fff;
  padding: 20px; border-radius: 10px;
}
.sidebar-kiri ul { list-style: none; margin-top: 12px; line-height: 2; }

.konten-utama {
  grid-area: main; background: #fff;
  padding: 20px; border-radius: 10px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 Kolom di Desktop */
  gap: 16px; margin-top: 16px;
}
.card {
  background: #eff6ff; border: 1px solid #bfdbfe;
  padding: 16px; border-radius: 8px;
}

.widget-promo {
  grid-area: promo; background: #f59e0b; color: #fff;
  padding: 20px; border-radius: 10px;
}
.promo-box { background: rgba(0,0,0,0.15); padding: 12px; border-radius: 6px; margin-top: 10px; }

.footer {
  grid-area: footer; background: #334155; color: #f8fafc;
  text-align: center; padding: 14px; border-radius: 10px;
}

/* BREAKPOINT 1: TABLET (601px s.d. 1023px)
   Perubahan: Grid jadi 2 kolom, Widget Promo DIHILANGKAN */
@media screen and (min-width: 601px) and (max-width: 1023px) {
  .page-wrapper {
    grid-template-columns: 190px 1fr;
    grid-template-areas:
      "header header"
      "sidebar main"
      "footer footer";
  }
  .widget-promo { display: none; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* BREAKPOINT 2: SMARTPHONE (<= 600px)
   Perubahan: Grid 1 kolom, Sidebar, Nav Teks & Promo DIHILANGKAN */
@media screen and (max-width: 600px) {
  .page-wrapper {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "footer";
    padding: 10px;
  }
  .nav-links,
  .sidebar-kiri,
  .widget-promo { display: none; }
  .hamburger-btn { display: block; }
  .card-grid { grid-template-columns: 1fr; }
}

/* Tantangan 1 - Gambar kartu responsif */
.card img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
  border-radius: 6px;
}

/* ★ BARU: LIQUID GLASS (diletakkan SEBELUM Tantangan 2 & 3 agar tidak menimpanya) */

/* Latar gradien + gumpalan warna yang bergerak pelan di belakang kaca */
body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #0d9488 100%);
  background-attachment: fixed;
  color: #f8fafc;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(56,189,248,.60), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(168,85,247,.55), transparent 40%),
    radial-gradient(circle at 75% 85%, rgba(245,158,11,.50), transparent 40%),
    radial-gradient(circle at 20% 85%, rgba(20,184,166,.55), transparent 40%);
  animation: gerak-blob 18s ease-in-out infinite alternate;
}
@keyframes gerak-blob {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.15) translate(-2%, 3%); }
}

/* Efek kaca untuk semua panel */
.header, .sidebar-kiri, .konten-utama, .widget-promo, .footer {
  background-image: linear-gradient(120deg,
    rgba(255,255,255,.28), rgba(255,255,255,.06) 40%, rgba(255,255,255,.14));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 18px;
  box-shadow:
    0 8px 32px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -1px 0 rgba(255,255,255,.12);
}

/* Tint warna tiap panel */
.header       { background-color: rgba(27,54,93,.45); }
.sidebar-kiri { background-color: rgba(13,148,136,.38); }
.konten-utama { background-color: rgba(255,255,255,.10); }
.widget-promo { background-color: rgba(245,158,11,.38); }
.footer       { background-color: rgba(51,65,85,.45); }

/* Kartu kaca + efek hover */
.card {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  border-radius: 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}
.card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,.22);
  box-shadow: 0 14px 30px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.6);
}
.card h4 { margin-bottom: 6px; }
.card p { color: #e2e8f0; font-size: .92rem; line-height: 1.5; }
.card img { box-shadow: 0 4px 12px rgba(0,0,0,.3); }

.promo-box {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 12px;
}

/* Menu navigasi & tombol hamburger */
.nav-links a {
  padding: 6px 14px; border-radius: 999px;
  transition: background .25s ease;
}
.nav-links a:hover { background: rgba(255,255,255,.25); }
.hamburger-btn {
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Logo SMKN 9 Medan & RPL */
.logo { display: flex; align-items: center; gap: 10px; }
.logo img {
  height: 44px; width: auto;
  padding: 3px;
  background: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
@media screen and (max-width: 600px) {
  .logo { font-size: .95rem; gap: 6px; }
  .logo img { height: 36px; }
}
/* ★ BARU: selesai Liquid Glass */

/* Tantangan 2 - Orientasi landscape
   (diubah sedikit: teal dibuat semi-transparan agar efek kaca tetap terlihat) */
@media (max-width: 850px) and (orientation: landscape) {
  .header { background-color: rgba(13,148,136,.65); }
}

/* Tantangan 3 - Smart TV */
@media (min-width: 1921px) {
  html { font-size: 20px; }
}

/* ★ BARU: gambar SVG pada kartu (aturan sama seperti .card img) */
.card svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
  }
  /* ★ BARU: selesai */

  /* ★ BARU: Efek cahaya mengikuti kursor */

/* Cahaya besar di belakang konten */
.cursor-glow {
    position: fixed;
    top: 0; left: 0;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle,
      rgba(125,211,252,.45) 0%,
      rgba(168,85,247,.25) 40%,
      transparent 70%);
    pointer-events: none;   /* supaya tidak menghalangi klik */
    z-index: 0;
    opacity: 0;
    transition: opacity .4s ease;
    filter: blur(10px);
    will-change: transform;
  }
  .page-wrapper { position: relative; z-index: 1; }
  
  /* Kilau di dalam kartu, tepat di bawah kursor */
  .card { position: relative; overflow: hidden; }
  .card::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
      rgba(255,255,255,.35), transparent 60%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
  }
  .card:hover::after { opacity: 1; }
  
  /* Di layar sentuh (tanpa kursor) efek dimatikan */
  @media (hover: none) {
    .cursor-glow { display: none; }
  }
  /* ★ BARU: selesai */

  /* ★ BARU: Halaman & navbar aktif */
.halaman[hidden] { display: none; }
.halaman { animation: muncul .4s ease; }
@keyframes muncul {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.nav-links a.aktif { background: rgba(255,255,255,.3); }

/* Menu hamburger di smartphone */
@media screen and (max-width: 600px) {
  .header { flex-wrap: wrap; gap: 10px; }
  .nav-links.buka {
    display: flex; flex-wrap: wrap; gap: 8px;
    flex-basis: 100%; order: 3;
  }
}

/* ★ BARU: Latar hitam */
html, body { background: #000; min-height: 100%; }
body { background-image: none; }
body::before { opacity: .35; }   /* gumpalan warna diredupkan */

/* ★ BARU: Full screen & responsif di semua perangkat */
.page-wrapper {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
}
@media screen and (min-width: 1024px) {
  .page-wrapper {
    grid-template-columns: clamp(200px, 16vw, 340px) 1fr clamp(200px, 16vw, 340px);
  }
}

/* ★ BARU: Menu Cepat bisa diklik */
.sidebar-kiri li {
  cursor: pointer;
  padding: 0 10px;
  border-radius: 10px;
  transition: background .25s ease, transform .25s ease;
}
.sidebar-kiri li:hover { background: rgba(255,255,255,.22); transform: translateX(4px); }
.sidebar-kiri li.aktif { background: rgba(255,255,255,.32); font-weight: 600; }

/* ★ BARU: Chatbot pindah ke kiri bawah */
.chat-toggle { right: auto; left: 20px; }
.chat-box    { right: auto; left: 20px; }

/* ★ BARU: Navbar fluid */
.nav-links { position: relative; }
.nav-links a { position: relative; z-index: 1; }
.nav-links a.aktif { background: transparent; }   /* kotak diganti .nav-pill */
.nav-pill {
  position: absolute; z-index: 0; left: 0; top: 0;
  width: 0; height: 0; opacity: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.28);
  border: 1px solid rgba(255,255,255,.45);
  box-shadow: 0 4px 14px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.6);
  pointer-events: none;
  transition: left .5s cubic-bezier(.34,1.35,.5,1),
              width .5s cubic-bezier(.34,1.35,.5,1),
              opacity .3s ease;
}

/* ★ BARU: Chatbot - tombol kanan bawah */
.chat-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 58px; height: 58px; border-radius: 50%;
  font-size: 1.6rem; color: #fff; cursor: pointer;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.45);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
.chat-toggle:hover { transform: scale(1.1); }
.chat-toggle.sembunyi { transform: scale(0); opacity: 0; pointer-events: none; }

/* ★ BARU: Chatbot - layar penuh, latar blur, membesar dari pojok kanan bawah */
.chat-box {
  position: fixed; inset: 0; z-index: 60;
  display: flex; padding: 3vh 3vw;
  background: rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  clip-path: circle(0px at calc(100% - 49px) calc(100% - 49px));
  visibility: hidden; pointer-events: none;
  transition: clip-path .8s cubic-bezier(.22,1,.36,1), visibility 0s linear .8s;
}
.chat-box.buka {
  clip-path: circle(160vmax at calc(100% - 49px) calc(100% - 49px));
  visibility: visible; pointer-events: auto;
  transition: clip-path .8s cubic-bezier(.22,1,.36,1), visibility 0s;
}

.chat-panel {
  flex: 1; max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden;
  color: #fff; border-radius: 26px;
  background: rgba(15,23,42,.6);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4);
  transform-origin: 100% 100%;
  transform: scale(.3); opacity: 0;
  transition: transform .8s cubic-bezier(.22,1.2,.36,1), opacity .4s ease;
}
.chat-box.buka .chat-panel { transform: scale(1); opacity: 1; }

.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; background: rgba(255,255,255,.12);
}
.chat-head button {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; margin-left: 6px;
}
.chat-pesan {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.pesan { max-width: 80%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; }
.pesan.bot  { align-self: flex-start; background: rgba(255,255,255,.18); }
.pesan.user { align-self: flex-end; background: rgba(37,99,235,.8); }
.pesan.mengetik { opacity: .6; animation: kedip 1s infinite; }
@keyframes kedip { 50% { opacity: .25; } }

.chat-pilihan {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px; padding: 14px; background: rgba(255,255,255,.08);
}
.chat-pilihan button {
  padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  color: #fff; font-size: .95rem;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.35);
  transition: background .25s ease, transform .25s ease;
}
.chat-pilihan button:hover { background: rgba(255,255,255,.28); transform: translateY(-2px); }

.chat-toggle { left: auto; right: 20px; }

/* ★ BARU: Navbar lebih tipis & animasi lebih mulus */
.nav-links { gap: 12px; }
.nav-links a {
  padding: 3px 12px;                 /* sebelumnya 6px 14px */
  opacity: .8;
  transition: opacity .4s ease, transform .4s ease;
}
.nav-links a.aktif,
.nav-links a:hover { opacity: 1; }
.nav-links a.aktif { transform: scale(1.04); }

.nav-pill {
  width: auto;                       /* lebar ditentukan left + right */
  background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.16));
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 3px 10px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.55);
  transform-origin: center;
}
.nav-pill.bergerak { transform: scaleY(.82); }   /* sedikit "gepeng" saat bergerak */

/* Header tidak ikut melar mengisi tinggi layar */
.page-wrapper { grid-template-rows: auto 1fr auto; }

/* Transisi halaman lebih halus */
.halaman { animation: muncul2 .7s cubic-bezier(.22,1,.36,1); }
@keyframes muncul2 {
  from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
