/* =====================================================
   DANY OKTAVIAN SCRIPT - Main Stylesheet
   Dark theme matching the prototype
   ===================================================== */

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Dark Theme Colors */
  --bg-primary:    #0d1117;
  --bg-surface:    #161b22;
  --bg-card:       #1c2128;
  --bg-card-hover: #21262d;
  --border:        #30363d;
  --border-muted:  #21262d;

  /* Text */
  --text-primary:  #e6edf3;
  --text-secondary:#8b949e;
  --text-muted:    #6e7681;

  /* Accents */
  --blue:    #58a6ff;
  --blue-bg: #1f6feb22;
  --green:   #3fb950;
  --orange:  #d29922;
  --red:     #f85149;
  --purple:  #bc8cff;

  /* Tag Colors */
  --skin-color:    #ffa657;
  --skin-bg:       #ffa65718;
  --drone-color:   #58a6ff;
  --drone-bg:      #58a6ff18;
  --radar-color:   #ff7b72;
  --radar-bg:      #ff7b7218;
  --sound-color:   #d2a8ff;
  --sound-bg:      #d2a8ff18;
  --intro-color:   #3fb950;
  --intro-bg:      #3fb95018;
  --map-color:     #a5d6ff;
  --map-bg:        #a5d6ff18;
  --backup-color:  #8b949e;
  --backup-bg:     #8b949e18;
  --guide-color:   #f2ca3f;
  --guide-bg:      #f2ca3f18;

  /* Layout */
  --navbar-height: 56px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-blue: 0 0 20px rgba(88,166,255,0.15);

  /* Transition */
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg-primary:    #ffffff;
  --bg-surface:    #f6f8fa;
  --bg-card:       #ffffff;
  --bg-card-hover: #f6f8fa;
  --border:        #d0d7de;
  --border-muted:  #e8ecf0;
  --text-primary:  #1f2328;
  --text-secondary:#656d76;
  --text-muted:    #9198a1;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: var(--navbar-height);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- CONTAINER ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: #1f6feb;
  color: #ffffff;
  border-color: #1f6feb;
}
.btn-primary:hover {
  background: #388bfd;
  border-color: #388bfd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31,111,235,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-surface);
  border-color: var(--text-secondary);
}

.w-full { width: 100%; justify-content: center; }

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-height);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 20px rgba(0,0,0,0.1);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(88,166,255,0.1);
  border: 1px solid rgba(88,166,255,0.3);
  border-radius: var(--radius-md);
}

.logo-image-container {
  overflow: hidden;
  padding: 0;
  border-color: var(--border);
}

.logo-image-file {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}
.logo-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.1em;
}

/* Nav Links */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.nav-link.active { color: var(--blue); }

/* Navbar Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Search Trigger */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition);
  min-width: 140px;
}
.search-trigger:hover {
  border-color: var(--blue);
  color: var(--text-primary);
}
.search-placeholder { flex: 1; text-align: left; }
.search-trigger kbd {
  font-size: 11px;
  padding: 2px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

/* Theme Toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--navbar-height);
  left: 0; right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  padding: 16px;
  max-height: calc(100vh - var(--navbar-height) - 70px); /* 70px = mobile bottom nav */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-menu.open { display: block; }
.mobile-nav-links { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.mobile-nav-link:hover { background: var(--bg-card); color: var(--text-primary); }
.mobile-nav-link.active { color: var(--blue); background: rgba(88,166,255,.08); }
.mobile-auth { display: flex; gap: 8px; flex-direction: column; }
.mobile-auth .btn,
.mobile-auth form,
.mobile-auth > a { width: 100%; box-sizing: border-box; }
.mobile-auth form button { width: 100%; text-align: center; justify-content: center; }

.navbar.scrolled {
  background: rgba(13, 17, 23, 0.98);
  box-shadow: 0 1px 20px rgba(0,0,0,0.4);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 20px rgba(0,0,0,0.1);
}

/* =====================================================
   SEARCH MODAL
   ===================================================== */
.search-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal-overlay.open { display: flex; }

.search-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-modal-header { padding: 16px; border-bottom: 1px solid var(--border); }
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.search-modal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
}
.search-modal-input::placeholder { color: var(--text-muted); }
.search-esc {
  font-size: 11px;
  padding: 3px 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
}
.search-modal-body { padding: 16px; }
.search-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.search-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.search-tag {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.search-tag:hover { border-color: var(--blue); color: var(--blue); }

/* =====================================================
   SEARCH RESULTS LIST — scrollable popular-style
   ===================================================== */
@keyframes srSpin { to { transform: rotate(360deg); } }

.search-results-list {
  max-height: 368px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.search-results-list::-webkit-scrollbar { width: 4px; }
.search-results-list::-webkit-scrollbar-track { background: transparent; }
.search-results-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background .1s;
  border-bottom: 1px solid var(--border-muted);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.sr-active { background: var(--bg-card-hover); }

.search-result-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; overflow: hidden;
}
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.search-result-info { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; margin-bottom: 3px;
}
.search-result-title mark {
  background: rgba(88,166,255,.18); color: #58a6ff;
  border-radius: 2px; font-weight: 700; padding: 0 1px;
  font-style: normal;
}
.search-result-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
}
.search-result-cat {
  padding: 1px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.search-result-arrow {
  color: var(--text-muted); flex-shrink: 0;
  opacity: 0; transition: opacity .12s;
}
.search-result-item:hover .search-result-arrow,
.search-result-item.sr-active .search-result-arrow { opacity: 1; }

.search-view-all {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  font-size: 13px; font-weight: 600; color: var(--blue);
  text-decoration: none;
  transition: background .15s;
  border-top: 1px solid var(--border);
}
.search-view-all:hover { background: var(--bg-card-hover); }

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-surface) 100%);
  padding: 40px 0 50px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Subtle grid bg */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(88,166,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,166,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: 60px;
  align-items: center;
}

/* Hero Left */
.hero-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.hero-highlight {
  background: linear-gradient(135deg, #58a6ff, #bc8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
}

/* Hero Search */
.hero-search {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  max-width: 480px;
}
.hero-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
  color: var(--text-secondary);
}
.hero-search-input-wrap:focus-within { border-color: var(--blue); }
.hero-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}
.hero-search-input::placeholder { color: var(--text-muted); }
.hero-search-btn { padding: 10px 18px; border-radius: var(--radius-md); }

/* Stats */
.hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Hero Right: Code Preview */
.hero-right { position: relative; }

.code-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
  position: relative;
}

.code-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #1c2128;
  border-bottom: 1px solid var(--border);
}
.code-preview-dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }

.code-preview-tabs { display: flex; gap: 4px; }
.code-tab {
  padding: 4px 10px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}
.code-tab.active { background: var(--bg-primary); color: var(--text-primary); }

.code-preview-body { padding: 20px; overflow: auto; }
.code-block { font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.8; }

.mlbb-preview-body {
  padding: 0;
  overflow: hidden;
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mlbb-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mlbb-preview-card:hover .mlbb-hero-img {
  transform: scale(1.04);
}

.code-fn   { color: #d2a8ff; }
.code-name { color: #79c0ff; }
.code-kw   { color: #ff7b72; }
.code-str  { color: #a5d6ff; }
.code-var  { color: #ffa657; }

/* Badge */
.hero-badge {
  position: absolute;
  bottom: -16px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}
.hero-badge-icon {
  width: 40px;
  height: 40px;
  background: rgba(61,220,132,0.1);
  border: 1px solid rgba(61,220,132,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-badge-pct {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}
.hero-badge-text {
  font-size: 11px;
  color: var(--text-secondary);
}

/* =====================================================
   TECH CATEGORIES
   ===================================================== */
.tech-categories {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.tech-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform var(--transition);
  cursor: pointer;
  min-width: 72px;
}
.tech-item:hover { transform: translateY(-4px); }
.tech-item:hover .tech-icon-wrap {
  border-color: var(--cat-color) !important;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--cat-color) 25%, transparent);
}

.tech-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.tech-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.tech-item:hover .tech-name { color: var(--text-primary); }

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content-wrapper { padding: 40px 0 60px; }

.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

/* Posts Area */
.posts-section { margin-bottom: 40px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-see-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--blue);
  transition: gap var(--transition);
}
.section-see-all:hover { gap: 8px; }

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Post Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.post-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-card-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card-image-label {
  font-size: 24px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 14px;
  border-radius: var(--radius-md);
}

.post-card-body { padding: 14px; }
.post-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 6px 0 8px;
  line-height: 1.4;
}
.post-card-title a:hover { color: var(--blue); }
.post-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post Meta */
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.post-date, .post-views, .post-downloads {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tags */
.post-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.tag-skin    { color: var(--skin-color);    background: var(--skin-bg); }
.tag-drone   { color: var(--drone-color);   background: var(--drone-bg); }
.tag-radar   { color: var(--radar-color);   background: var(--radar-bg); }
.tag-sound   { color: var(--sound-color);   background: var(--sound-bg); }
.tag-intro   { color: var(--intro-color);   background: var(--intro-bg); }
.tag-map     { color: var(--map-color);     background: var(--map-bg); }
.tag-backup  { color: var(--backup-color);  background: var(--backup-bg); }
.tag-guide   { color: var(--guide-color);   background: var(--guide-bg); }

/* Popular Posts List */
.popular-list { display: flex; flex-direction: column; gap: 16px; }
.popular-post-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.popular-post-item:hover {
  border-color: var(--blue);
  transform: translateX(4px);
}
.popular-rank {
  font-size: 22px;
  font-weight: 900;
  color: var(--border);
  min-width: 28px;
  font-family: 'JetBrains Mono', monospace;
}
.popular-post-image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.popular-post-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.popular-post-tag {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 4px;
  white-space: nowrap;
}
.popular-post-body { flex: 1; }
.popular-post-title {
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0 8px;
}
.popular-post-title a:hover { color: var(--blue); }

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 76px; }

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.sidebar-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Trending List */
.trending-list { padding: 8px 0; }
.trending-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  transition: background var(--transition);
}
.trending-item:hover { background: var(--bg-card-hover); }
.trending-rank {
  font-size: 18px;
  font-weight: 800;
  color: var(--border);
  min-width: 24px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.3;
}
.trending-info { flex: 1; }
.trending-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
  transition: color var(--transition);
}
.trending-title:hover { color: var(--blue); }
.trending-views {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Kategori List */
.kategori-list { padding: 8px 0; }
.kategori-item { border-bottom: 1px solid var(--border-muted); }
.kategori-item:last-child { border-bottom: none; }
.kategori-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  transition: background var(--transition);
}
.kategori-link:hover { background: var(--bg-card-hover); }
.kategori-name {
  font-size: 13px;
  color: var(--text-primary);
}
.kategori-count {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-see-all {
  display: block;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: var(--blue);
  border-top: 1px solid var(--border);
  transition: background var(--transition);
}
.sidebar-see-all:hover { background: var(--bg-card-hover); }

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.footer-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 14px 0 20px;
}

.footer-social { display: flex; gap: 10px; }
.social-link {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.social-link:hover { color: var(--text-primary); border-color: var(--text-secondary); }

.footer-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 14px; color: var(--text-secondary); transition: color var(--transition); }
.footer-links a:hover { color: var(--blue); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-badge {
  padding: 4px 12px;
  background: rgba(61,220,132,0.1);
  border: 1px solid rgba(61,220,132,0.3);
  border-radius: 20px;
  color: #3fb950;
  font-size: 12px;
  font-weight: 500;
}

/* =====================================================
   MOBILE BOTTOM NAV
   ===================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}

.mobile-bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  padding: 6px 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: color var(--transition);
  text-decoration: none;
  position: relative;
}

/* Indicator bar di atas item aktif */
.mobile-bottom-link::before {
  content: '';
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 24px; height: 3px;
  background: var(--blue);
  border-radius: 0 0 3px 3px;
  transition: transform .2s ease;
}

.mobile-bottom-link.active {
  color: var(--blue);
}
.mobile-bottom-link.active::before {
  transform: translateX(-50%) scaleX(1);
}

/* Icon wrapper aktif — background pill */
.mobile-bottom-link .mbn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 28px;
  border-radius: 14px;
  transition: background .2s;
}
.mobile-bottom-link.active .mbn-icon {
  background: rgba(88,166,255,.15);
}
.mobile-bottom-link:hover .mbn-icon {
  background: rgba(88,166,255,.1);
}
.mobile-bottom-link:hover { color: var(--blue); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  .hero { padding: 40px 0; }
  .hero-container { grid-template-columns: 1fr; gap: 40px; padding: 0 20px; }
  .hero-right { display: none; }
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar-card { flex: 1; min-width: 280px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 1200px) {
  .navbar-links { display: none; }
  .search-trigger { min-width: unset; }
  .search-placeholder { display: none; }
  .navbar-actions #btn-masuk,
  .navbar-actions #btn-daftar { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 768px) {
  /* Layout */
  .hero { padding: 40px 0 30px; }
  .hero-stats { gap: 16px; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  /* Search trigger — icon only, ukuran sama dengan theme-toggle */
  .search-trigger {
    min-width: unset;
    width: 36px; height: 36px;
    padding: 0;
    justify-content: center;
  }
  .search-placeholder { display: none; }
  .search-trigger kbd  { display: none; }

  /* User button — bulat hanya avatar */
  .navbar-user-btn {
    padding: 4px !important;
    border-radius: 50% !important;
    gap: 0 !important;
    min-width: unset !important;
  }
  .navbar-user-btn .user-name-text { display: none; }
  .navbar-user-btn .user-chevron   { display: none; }
  .user-dropdown-menu { right: 0; min-width: 180px; }

  /* Sembunyikan seluruh navbar-user-dropdown di mobile */
  .navbar-user-dropdown { display: none; }

  /* Admin btn — sembunyikan di mobile, sudah ada di mobile-menu */
  #btn-admin { display: none !important; }

  /* Hamburger — selalu tampil */
  .hamburger { display: flex !important; }

  /* Mobile bottom nav */
  .mobile-bottom-nav {
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body { padding-bottom: 70px; }

  /* mobile-auth — button full width & sama tinggi */
  .mobile-auth { flex-direction: column; gap: 8px; }
  .mobile-auth .btn { width: 100%; justify-content: center; }
  .mobile-auth form { width: 100%; }
  .mobile-auth form button { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .navbar-container { padding: 0 12px; gap: 8px; }

  .hero-title { font-size: 26px; }
  .hero-search { flex-direction: column; }
  .hero-stats { gap: 12px; }
  .hero-stat { flex-direction: row; align-items: center; }
  .tech-grid { gap: 8px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
  .tech-item { min-width: 64px; }
}

/* =====================================================
   NAVBAR USER DROPDOWN — theme-safe classes
   ===================================================== */
.user-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.dropdown-info {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}
.dropdown-email {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
  box-sizing: border-box;
}
.dropdown-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.dropdown-item-danger { color: #f85149 !important; }
.dropdown-item-danger:hover {
  background: rgba(248, 81, 73, .08) !important;
  color: #f85149 !important;
}

/* ===== NAVBAR USER BUTTON — responsive (handled in 768px block above) ===== */

/* =====================================================
   SHARE BUTTONS
   ===================================================== */

/* Inline share row di hero-body */
.detail-share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Icon-only share button (hero-body row) */
.share-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  flex-shrink: 0;
}
.share-icon-btn:hover        { transform: translateY(-2px); border-color: transparent; color: #fff; }
.share-icon-wa:hover         { background: #25d366; }
.share-icon-tg:hover         { background: #2ca5e0; }
.share-icon-x:hover          { background: #000; }
.share-icon-copy:hover       { background: #58a6ff; border-color: #58a6ff; }

/* Grid share widget di sidebar */
.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Full share button (sidebar widget) */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all .18s;
  font-family: 'Inter', sans-serif;
}
.share-btn:hover             { transform: translateY(-2px); border-color: transparent; color: #fff; }
.share-btn-wa:hover          { background: #25d366; }
.share-btn-tg:hover          { background: #2ca5e0; }
.share-btn-x:hover           { background: #000; }
.share-btn-fb:hover          { background: #1877f2; }
.share-btn-copy:hover        { background: #58a6ff; border-color: #58a6ff; color: #fff; }
.share-btn-native:hover      { background: #6e40c9; border-color: #6e40c9; color: #fff; }

/* Copied state */
.share-btn-copy.copied,
.share-icon-copy.copied {
  background: #238636;
  border-color: #238636;
  color: #fff;
}
