/* ================= THEME ================= */
:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-solid: #121212;
  --surface-hover: #1c1c1e;
  
  /* Border tipis dengan sentuhan cahaya */
  --border: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.15);
  
  --text: #f5f5f7;
  --text-muted: #86868b;
  
  --primary: #ffffff;
  --primary-text: #000000;
  --primary-gradient: linear-gradient(180deg, #ffffff 0%, #e5e5ea 100%);
  
  --danger: #ff453a;
  --success: #32d74b;
  
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #fbfbfd;
  --surface-solid: #ffffff;
  --surface-hover: #f5f5f7;
  
  --border: rgba(0, 0, 0, 0.08);
  --border-highlight: rgba(0, 0, 0, 0.15);
  
  --text: #1d1d1f;
  --text-muted: #86868b;
  
  --primary: #000000;
  --primary-text: #ffffff;
  --primary-gradient: linear-gradient(180deg, #333333 0%, #000000 100%);
}

/* ================= RESET ================= */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.4s, color 0.4s;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--text); }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: transparent; -webkit-tap-highlight-color: transparent; }
input { font-family: inherit; }

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ================= BACKGROUND GRID ================= */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 50% 0%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, black 20%, transparent 70%);
  opacity: 0.8;
  pointer-events: none;
}

/* ================= HEADER ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  background: var(--primary-gradient);
  color: var(--primary-text);
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.5);
}

.theme-toggle {
  color: var(--text-muted);
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  transition: var(--transition);
}

.theme-toggle:hover { color: var(--text); background: var(--surface-hover); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ================= MAIN ================= */
main {
  flex: 1;
  padding: 80px 0 80px;
}

/* ================= HERO ================= */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

h1 {
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--text) 30%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
  max-width: 480px;
  margin: 0 auto 40px;
  letter-spacing: -0.01em;
}

/* ================= INPUT BOX ================= */
.input-box {
  display: flex;
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  max-width: 580px;
  margin: 0 auto;
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.1),
    0 8px 24px rgba(0,0,0,0.2),
    inset 0 1px 0 var(--border-highlight);
  transition: var(--transition);
}

.input-box:focus-within {
  border-color: var(--text-muted);
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.1),
    0 12px 32px rgba(0,0,0,0.3),
    inset 0 1px 0 var(--border-highlight);
}

.input-field {
  display: flex;
  align-items: center;
  flex: 1;
  padding-left: 12px;
  gap: 12px;
  overflow: hidden;
}

.input-field svg { color: var(--text-muted); flex-shrink: 0; }

#urlInput {
  width: 100%;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  text-overflow: ellipsis;
}
#urlInput::placeholder { color: var(--text-muted); font-weight: 400; }

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  color: var(--text-muted);
  transition: var(--transition);
}
.btn-icon:hover { color: var(--text); background: var(--surface-hover); }

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: var(--primary-text);
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-submit:hover { transform: translateY(-1px); opacity: 0.9; }
.btn-submit:active { transform: scale(0.97); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.message {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
  text-align: center;
}
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

/* ================= PLATFORMS ================= */
.platforms {
  margin-top: 40px;
  text-align: center;
}

.platforms-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.platforms-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto;
}

.platform-card {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0 1px 0 var(--border-highlight);
}

.platform-card:hover {
  color: var(--text);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.platform-card svg { width: 14px; height: 14px; opacity: 0.6; }

/* ================= RESULT SECTION ================= */
.result-section {
  margin-top: 48px;
  display: none;
}
.result-section.active { display: block; }

.result-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.1),
    0 12px 32px rgba(0,0,0,0.2),
    inset 0 1px 0 var(--border-highlight);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-header {
  display: flex;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.thumbnail {
  width: 96px; height: 96px;
  border-radius: var(--radius-sm);
  background: var(--bg) center/cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
}

.meta h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta p {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.badge {
  background: var(--border);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border-highlight);
}

.download-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}

.download-item:hover { 
  background: var(--surface-hover); 
  border-color: var(--border); 
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-title {
  font-size: 14px;
  font-weight: 600;
}

.item-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-dl {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), inset 0 1px 0 var(--border-highlight);
}

.btn-dl:hover {
  background: var(--primary-gradient);
  color: var(--primary-text);
  border-color: var(--primary);
}

/* ================= HOW TO ================= */
.how-to {
  margin-top: 80px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.steps {
  display: grid;
  gap: 16px;
}
@media (min-width: 600px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  text-align: left;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0 1px 0 var(--border-highlight);
}

.step-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.step-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 var(--border-highlight);
}

.step-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}

/* ================= FOOTER ================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  background: var(--surface-solid);
}

.footer-brand {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.footer p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
  font-weight: 500;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.footer-links a { font-size: 13px; font-weight: 600; }

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.5;
  font-weight: 500;
}

/* ================= SPINNER ================= */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: var(--primary-text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
[data-theme="light"] .spinner { border-color: rgba(255,255,255,0.2); border-top-color: var(--primary-text); }

.spinner-light {
  border-color: var(--border);
  border-top-color: var(--text);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsif */
@media (max-width: 600px) {
  .card-header { flex-direction: column; align-items: center; text-align: center; }
  .thumbnail { width: 100%; height: 180px; }
  .meta { align-items: center; }
  .meta p { justify-content: center; }
  .download-item { flex-direction: column; gap: 16px; align-items: flex-start; }
  .btn-dl { width: 100%; justify-content: center; }
  
  .input-box { padding: 4px; }
  .btn-submit { padding: 0 16px; font-size: 14px; }
}
