@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'pnum' 1, 'tnum' 0, 'onum' 1, 'lnum' 0, 'dlig' 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
}

h2 {
  font-size: 2.25rem;
}

h3 {
  font-size: 1.875rem;
}

code, pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', monospace;
  font-size: 0.9em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #3b82f6;
}

::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* Gradient Background Effect */
.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.gradient-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(30px, -30px) rotate(5deg); }
}

/* Navigation Styles */
.nav-link {
  position: relative;
  display: block;
  padding: 0.625rem 1rem;
  margin: 0.25rem 0;
  color: #9ca3af;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Introduction section links */
.sidebar nav > ul > li:nth-child(1) .nav-link:hover {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.sidebar nav > ul > li:nth-child(1) .nav-link.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.sidebar nav > ul > li:nth-child(1) .nav-link.active::before {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

/* Core Concepts section links */
.sidebar nav > ul > li:nth-child(2) .nav-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.sidebar nav > ul > li:nth-child(2) .nav-link.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.sidebar nav > ul > li:nth-child(2) .nav-link.active::before {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

/* Advanced section links */
.sidebar nav > ul > li:nth-child(3) .nav-link:hover {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.sidebar nav > ul > li:nth-child(3) .nav-link.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
  color: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.sidebar nav > ul > li:nth-child(3) .nav-link.active::before {
  background: linear-gradient(180deg, #a855f7 0%, #9333ea 100%);
}

/* Reference section links */
.sidebar nav > ul > li:nth-child(4) .nav-link:hover {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.sidebar nav > ul > li:nth-child(4) .nav-link.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
  color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.sidebar nav > ul > li:nth-child(4) .nav-link.active::before {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.nav-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  position: relative;
  transition: all 0.3s ease;
}

/* Introduction Section */
.nav-heading:nth-of-type(1) {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  border-left: 3px solid #22c55e;
  color: #22c55e;
}

.nav-heading:nth-of-type(1)::before {
  content: "🚀";
  margin-right: 0.5rem;
}

/* Core Concepts Section */
.nav-heading:nth-of-type(2) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
  border-left: 3px solid #3b82f6;
  color: #3b82f6;
}

.nav-heading:nth-of-type(2)::before {
  content: "⚙️";
  margin-right: 0.5rem;
}

/* Advanced Section */
.nav-heading:nth-of-type(3) {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.05));
  border-left: 3px solid #a855f7;
  color: #a855f7;
}

.nav-heading:nth-of-type(3)::before {
  content: "🔥";
  margin-right: 0.5rem;
}

/* Reference Section */
.nav-heading:nth-of-type(4) {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
  border-left: 3px solid #f59e0b;
  color: #f59e0b;
}

.nav-heading:nth-of-type(4)::before {
  content: "📚";
  margin-right: 0.5rem;
}

/* Hover effects for nav headings */
.nav-heading:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Stagger animation for nav links */
.sidebar nav > ul > li:nth-child(1) .nav-link {
  animation: slideInLeft 0.6s ease-out 0.1s both;
}

.sidebar nav > ul > li:nth-child(1) .nav-link:nth-child(1) { animation-delay: 0.1s; }
.sidebar nav > ul > li:nth-child(1) .nav-link:nth-child(2) { animation-delay: 0.2s; }

.sidebar nav > ul > li:nth-child(2) .nav-link {
  animation: slideInLeft 0.6s ease-out 0.2s both;
}

.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(1) { animation-delay: 0.3s; }
.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(2) { animation-delay: 0.4s; }
.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(3) { animation-delay: 0.5s; }
.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(4) { animation-delay: 0.6s; }
.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(5) { animation-delay: 0.7s; }
.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(6) { animation-delay: 0.8s; }
.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(7) { animation-delay: 0.9s; }
.sidebar nav > ul > li:nth-child(2) .nav-link:nth-child(8) { animation-delay: 1.0s; }

.sidebar nav > ul > li:nth-child(3) .nav-link {
  animation: slideInLeft 0.6s ease-out 0.4s both;
}

.sidebar nav > ul > li:nth-child(3) .nav-link:nth-child(1) { animation-delay: 1.1s; }
.sidebar nav > ul > li:nth-child(3) .nav-link:nth-child(2) { animation-delay: 1.2s; }

.sidebar nav > ul > li:nth-child(4) .nav-link {
  animation: slideInLeft 0.6s ease-out 0.6s both;
}

.sidebar nav > ul > li:nth-child(4) .nav-link:nth-child(1) { animation-delay: 1.3s; }
.sidebar nav > ul > li:nth-child(4) .nav-link:nth-child(2) { animation-delay: 1.4s; }

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Section separators */
.nav-heading:not(:first-child) {
  margin-top: 2rem;
  position: relative;
}

.nav-heading:not(:first-child)::after {
  content: '';
  position: absolute;
  top: -1rem;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(75, 85, 99, 0.3), transparent);
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  z-index: 50;
  height: 100vh;
  width: 280px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar.active {
  left: 0;
}

@media (min-width: 1024px) {
  .sidebar {
    left: 0;
  }
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Menu Button */
.menu-btn {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 60;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-btn:hover {
  transform: scale(1.05);
}

.menu-btn:active {
  transform: scale(0.95);
}

@media (min-width: 1024px) {
  .menu-btn {
    display: none;
  }
}

.menu-icon {
  position: relative;
  width: 24px;
  height: 18px;
}

.menu-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-icon span:nth-child(3) { bottom: 0; }

.menu-btn.active .menu-icon span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-btn.active .menu-icon span:nth-child(2) {
  opacity: 0;
}

.menu-btn.active .menu-icon span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* -- GAYA BLOK KODE YANG DISEMPURNAKAN -- */

/* Wrapper utama untuk keseluruhan blok kode (header + pre) */
.code-container {
  position: relative;
  margin: 2rem 0;
  border-radius: 16px; /* Memberi radius pada container, bukan pada elemen di dalamnya */
  border: 1px solid rgba(59, 130, 246, 0.2);
  overflow: hidden; /* PENTING: untuk memaksa radius pada elemen anak */
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Efek hover pada keseluruhan blok kode */
.code-container:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.2);
}

/* Header blok kode */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 3rem;
  background: rgba(17, 24, 39, 0.95);
}

/* Teks nama bahasa (misal: Python, Bash) */
.code-language {
  font-size: 0.8rem;
  font-weight: 600;
  color: #93c5fd; /* Warna biru lebih terang */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Ikon dinamis berdasarkan bahasa */
.code-language.lang-python::before { content: '🐍'; font-size: 1rem; }
.code-language.lang-bash::before { content: '💲'; font-size: 1rem; color: #a5b4fc; }
.code-language.lang-json::before { content: '{ }'; font-size: 1rem; font-weight: bold; color: #facc15; }

/* Area kode <pre> */
pre[class*="language-"] {
  margin: 0;
  padding: 1.5rem;
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(10px);
  overflow-x: auto;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Tombol Copy (kembali ke header) */
.copy-btn {
  padding: 0.4rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  min-width: 80px;
  justify-content: center;
}

.copy-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Button Styles */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  border: 2px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.05);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

/* Logo Animation */
.logo {
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.3s ease;
}

.logo:hover::after {
  width: 100%;
}

/* Hero Title Animation */
.hero-title {
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Styles */
section {
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Content Card */
.content-card {
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(10px);
  padding: 2rem;
  transition: all 0.3s ease;
}

.content-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.feature-icon {
  flex-shrink: 0;
  font-size: 1.5rem;
}

/* Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Documentation Links */
.doc-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.doc-link {
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  text-decoration: none;
  color: #e5e7eb;
  transition: all 0.3s ease;
}

.doc-link:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

/* Contributing Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.step {
  padding: 1rem;
  background: rgba(17, 24, 39, 0.6);
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  color: #9ca3af;
}