/**
 * TUTORIAL PREMIUM MODERN MINIMALIST (Stripe / Apple Docs Aesthetic)
 * Bersih, elegan, tipografi presisi, whitespace seimbang, modern & bernuansa developer doc kelas atas.
 */

:root {
  /* Brand Accent */
  --primary: #F97316;
  --primary-hover: #EA580C;
  --primary-soft: #FFF7ED;
  --primary-glow: rgba(249, 115, 22, 0.08);

  /* Neutrals */
  --bg-page: #FAFAFA;
  --surface: #FFFFFF;
  --border-subtle: #EBECEF;
  --border-strong: #D1D5DB;

  /* Typography */
  --text-title: #111827;
  --text-body: #374151;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;

  /* Accents */
  --accent-blue: #0284C7;
  --accent-blue-soft: #F0F9FF;
  --accent-green: #10B981;
  --accent-green-soft: #ECFDF5;

  /* Sizing */
  --sidebar-w: 280px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  letter-spacing: -0.01em;

  /* Proteksi Anti Copy & Anti Klik Kanan */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* App Wrapper Layout */
.doc-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigasi Minimalis (Docs Style) */
.doc-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

/* Scrollbar Minimalis */
.doc-sidebar::-webkit-scrollbar {
  width: 5px;
}
.doc-sidebar::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 999px;
}

.doc-sidebar-header {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Tombol Kembali ke Platform / Bank Soal */
.btn-back-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  margin-bottom: 0.85rem;
  transition: all 0.2s ease;
}

.btn-back-platform:hover {
  color: var(--primary);
  background: #FFF7ED;
  border-color: #FDBA74;
  transform: translateX(-2px);
}

.btn-back-platform span.arrow {
  font-size: 13px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.btn-back-platform:hover span.arrow {
  transform: translateX(-2px);
}

.badge-tag {
  display: inline-block;
  background: #F3F4F6;
  color: #4B5563;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.doc-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 2px;
  letter-spacing: -0.02em;
}

.doc-sidebar-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Nav Menu Items */
.doc-nav {
  padding: 1rem 0.75rem 3rem;
  flex: 1;
}

.nav-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-light);
  padding: 1.1rem 0.65rem 0.35rem;
}

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.nav-step-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #F3F4F6;
  font-family: monospace;
  transition: all 0.2s ease;
}

.nav-item-link:hover {
  background: #F3F4F6;
  color: var(--text-title);
  transform: translateX(4px);
}

.nav-item-link:hover .nav-step-badge {
  background: #E5E7EB;
  color: var(--text-title);
}

.nav-item-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.nav-item-link.active .nav-step-badge {
  background: var(--primary);
  color: #FFFFFF;
}

/* Reading Progress Bar di Atas Layar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #EA580C);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Main Content Area */
.doc-main {
  flex: 1;
  min-width: 0;
  max-width: 1300px;
  padding: 3rem 4rem 6rem;
  margin: 0 auto;
  width: 100%;
}

/* Minimalist Hero Section */
.friendly-hero {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  margin-bottom: 3.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.friendly-hero:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.friendly-hero h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-title);
  margin-top: 0;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.friendly-hero p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.hero-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12.5px;
  color: var(--text-muted);
}

.meta-item strong {
  color: var(--text-title);
}

/* Step Card Minimalis */
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lesson-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

/* Tombol Floating Scroll-to-Top */
#btn-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-title);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
}

#btn-back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#btn-back-to-top:hover {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.25);
}

.lesson-header {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.lesson-number {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #F3F4F6;
  color: var(--text-title);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #E5E7EB;
}

.lesson-title-area h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-title);
  margin: 0 0 3px;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.lesson-tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* Clean Explanatory Dialog */
.teacher-dialog {
  display: flex;
  gap: 0.85rem;
  background: #F9FAFB;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.teacher-avatar {
  font-size: 1.15rem;
  line-height: 1.4;
}

.teacher-message {
  font-size: 13.5px;
  color: var(--text-body);
  line-height: 1.65;
}

.teacher-message strong {
  color: var(--text-title);
}

/* Checklist Box */
.checklist-card {
  background: #FAFAFA;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
}

.checklist-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-title);
  margin-bottom: 0.65rem;
}

.action-steps {
  padding-left: 1.25rem;
  margin: 0;
}

.action-steps li {
  margin-bottom: 0.45rem;
  color: var(--text-body);
  font-size: 13.5px;
}

.action-steps li strong {
  color: var(--text-title);
}

/* Sublime Text Tag */
.sublime-pill {
  display: inline-flex;
  align-items: center;
  background: #1E293B;
  color: #F8FAFC;
  border: 1px solid #334155;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  font-family: monospace;
  font-weight: 600;
}

/* Pewarnaan Khusus URL & Localhost (Mudah Diingat) */
.url-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
  padding: 1.5px 8px;
  border-radius: 6px;
  font-family: "Consolas", monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Pewarnaan File Path Direktori */
.path-pill {
  display: inline-flex;
  align-items: center;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  padding: 1px 7px;
  border-radius: 5px;
  font-family: "Consolas", monospace;
  font-size: 12px;
  font-weight: 600;
}

/* Pewarnaan Database & Tabel */
.db-pill {
  display: inline-flex;
  align-items: center;
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #E9D5FF;
  padding: 1px 7px;
  border-radius: 5px;
  font-family: "Consolas", monospace;
  font-size: 12px;
  font-weight: 600;
}

/* Default Inline Code Style */
code:not([class*="language-"]) {
  background: #F1F5F9;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "Consolas", monospace;
  font-size: 12.5px;
  font-weight: 600;
}

/* Code Snippet Window */
.code-window {
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1E293B;
  border: 1px solid #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.code-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0F172A;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid #1E293B;
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #EF4444; opacity: 0.8; }
.dot-yellow { background: #F59E0B; opacity: 0.8; }
.dot-green { background: #10B981; opacity: 0.8; }

.code-filepath {
  color: #94A3B8;
  font-size: 12px;
  font-family: monospace;
  font-weight: 500;
}

.code-lang-label {
  color: #64748B;
  font-size: 11px;
  font-family: monospace;
  font-weight: 600;
  text-transform: uppercase;
}

.code-comment-hint {
  font-size: 10.5px;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.08);
  padding: 1.5px 7px;
  border-radius: 4px;
  font-weight: 500;
}

pre {
  margin: 0 !important;
  padding: 1rem 1.25rem !important;
  background: #0F172A !important;
}

pre code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: #E2E8F0 !important; /* Warna teks default putih terang kontras tinggi */
}

/* Pesan Singkat di Bawah Kotak Kode */
.code-bottom-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0B1120;
  border-top: 1px solid #1E293B;
  padding: 0.45rem 1rem;
  font-size: 11.5px;
  color: #94A3B8;
}

.code-bottom-note span.icon {
  color: #F59E0B;
  font-size: 13px;
}

/* Warna sintaks terang khusus untuk Apache Conf (.htaccess) */
pre code.language-apache,
pre code.language-apache .hljs-section,
pre code.language-apache .hljs-keyword {
  color: #38BDF8 !important; /* Biru terang untuk keyword RewriteEngine, RewriteCond, IfModule */
  font-weight: 600;
}

pre code.language-apache .hljs-attribute,
pre code.language-apache .hljs-variable {
  color: #FBBF24 !important; /* Kuning terang untuk flag & variabel */
}

pre code.language-apache .hljs-literal,
pre code.language-apache .hljs-number {
  color: #A7F3D0 !important; /* Hijau muda terang */
}

/* Screen Image Mockup Wrapper */
.screen-mockup {
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.screen-mockup img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  display: block;
  background: #FAFAFA;
}

.screen-caption {
  padding: 0.6rem 1rem;
  background: #FAFAFA;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

/* Subtle Callouts */
.callout-box {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
  font-size: 13.5px;
}

.callout-info {
  background: var(--accent-blue-soft);
  border-left: 3px solid var(--accent-blue);
  color: #0369A1;
}

.callout-success {
  background: var(--accent-green-soft);
  border-left: 3px solid var(--accent-green);
  color: #065F46;
}

/* Minimal Table */
.friendly-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 13px;
}

.friendly-table th {
  background: #F9FAFB;
  color: var(--text-title);
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.friendly-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
}

/* Responsive */
/* Status Kunci Navigasi Sebelum Konfirmasi Peringatan */
body.must-agree .doc-nav a:not([href="index.html"]),
body.must-agree .lesson-card a[href$=".html"],
body.must-agree .doc-main a[href$=".html"] {
  pointer-events: none !important;
  opacity: 0.45 !important;
  filter: grayscale(1) !important;
  cursor: not-allowed !important;
}

body.must-agree .doc-nav a:not([href="index.html"])::after {
  content: " 🔒";
  font-size: 11px;
}

/* Agreement Alert Box Enhancements */
.agreement-card {
  background: #FFFBEB;
  border: 2px solid #F59E0B;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  margin-bottom: 2.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.agreement-card.agreed {
  background: #F0FDF4;
  border-color: #10B981;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.1);
}

.btn-agree {
  background: #D97706;
  color: #FFFFFF;
  border: none;
  padding: 0.65rem 1.35rem;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-agree:hover {
  background: #B45309;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.btn-agree:disabled {
  background: #D1D5DB;
  color: #6B7280;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes shake-anim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake-anim 0.4s ease-in-out;
}
@media (max-width: 1200px) {
  .doc-main {
    padding: 2.5rem 2.5rem 5rem;
  }
}

@media (max-width: 900px) {
  .doc-sidebar {
    display: none;
  }
  .doc-main {
    padding: 2rem 1.25rem;
  }
  .lesson-card, .friendly-hero {
    padding: 1.5rem;
  }
}
