/* ============================================================
   style.css — Grafika Komputer
   Styling tambahan: animasi, scroll behavior, dark mode, dll.
   ============================================================ */

/* ============================================================
   1. SCROLL BEHAVIOR & SCROLLBAR
   ============================================================ */
html {
  scroll-behavior: smooth;
}

/* Scrollbar kustom (WebKit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* ============================================================
   2. DARK MODE (Tailwind dark: variant)
   ============================================================ */
html.dark {
  color-scheme: dark;
}

html.dark body {
  background-color: #0f172a;
  color: #e2e8f0;
}

html.dark nav {
  background-color: rgba(15, 23, 42, 0.9);
  border-color: #1e293b;
}

html.dark .bg-white {
  background-color: #1e293b !important;
}

html.dark .bg-slate-50 {
  background-color: #0f172a !important;
}

html.dark .text-slate-900 {
  color: #f1f5f9 !important;
}

html.dark .text-slate-800 {
  color: #e2e8f0 !important;
}

html.dark .text-slate-700 {
  color: #cbd5e1 !important;
}

html.dark .text-slate-600 {
  color: #94a3b8 !important;
}

html.dark .text-slate-500 {
  color: #64748b !important;
}

html.dark .border-slate-200 {
  border-color: #334155 !important;
}

html.dark .border-slate-100 {
  border-color: #1e293b !important;
}

html.dark .bg-slate-100 {
  background-color: #334155 !important;
}


/* ============================================================
   3. ANIMASI FADE-IN SAAT SCROLL
   ============================================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   4. KARTU MODUL — EFEK HOVER
   ============================================================ */
.modul-card {
  position: relative;
  overflow: hidden;
}

.modul-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(51, 120, 255, 0);
  transition: box-shadow 0.3s ease;
}

.modul-card:hover::after {
  box-shadow: 0 0 0 3px rgba(51, 120, 255, 0.15);
}

/* Garis aksen kiri pada kartu modul */
.modul-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #3378ff, #1a43e1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modul-card:hover::before {
  opacity: 1;
}


/* ============================================================
   5. FILTER BUTTON — STATUS AKTIF
   ============================================================ */
.filter-btn.active {
  background-color: #1f57f5;
  color: #ffffff;
  border-color: #1f57f5;
}


/* ============================================================
   6. CODE BLOCK (untuk modul praktikum nanti)
   ============================================================ */
pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.875em;
}

/* Inline code */
:not(pre) > code {
  background: #f1f5f9;
  color: #1e293b;
  padding: 0.15em 0.4em;
  border-radius: 0.35rem;
  font-size: 0.85em;
}

html.dark :not(pre) > code {
  background: #334155;
  color: #f1f5f9;
}


/* ============================================================
   7. KOTAK CATATAN / CALLOUT
   ============================================================ */
.callout {
  border-left: 4px solid #3378ff;
  background: #eef6ff;
  padding: 1rem 1.25rem;
  border-radius: 0 0.75rem 0.75rem 0;
  margin: 1rem 0;
}

.callout.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.callout.danger {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.callout.success {
  border-left-color: #10b981;
  background: #ecfdf5;
}

html.dark .callout {
  background: #1e293b;
  color: #e2e8f0;
}


/* ============================================================
   8. TABEL RESPONSIF
   ============================================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 600px;
}


/* ============================================================
   9. UTILITAS TAMBAHAN
   ============================================================ */

/* Sembunyikan elemen secara visual tapi tetap terbaca screen reader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Animasi pulse halus untuk indikator */
@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-soft-pulse {
  animation: softPulse 2s ease-in-out infinite;
}

/* Transisi halus untuk semua link */
a {
  transition: color 0.2s ease, background-color 0.2s ease;
}


/* ============================================================
   10. MEDIA QUERY — MOBILE
   ============================================================ */
@media (max-width: 640px) {
  pre {
    font-size: 0.8rem;
    padding: 0.875rem 1rem;
  }
}