/* ── ADB Tools – GDrive Downloader
   Tokens persis sama dengan Advanced Digital Box ── */

:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --primary-ring: rgba(37, 99, 235, 0.2);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary: #3b82f6;
  --primary-soft: rgba(59, 130, 246, 0.12);
  --primary-ring: rgba(59, 130, 246, 0.25);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  transition: background 0.2s, color 0.2s;
  overflow-x: hidden;
}

/* ── Header (sama persis dengan ADB) ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.site-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.site-brand h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: 0.2s;
  text-decoration: none;
}

.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg);
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb span { color: var(--text); font-weight: 500; }

/* ── Tool header block ── */
.tool-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tool-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.tool-header-text h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  border: none;
  padding: 0;
}

.tool-header-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Section label (same as ADB h2 style) ── */
.section-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

/* ── Main card (surface) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card.focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring), var(--shadow-sm);
}

/* ── Input group ── */
.input-group {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.url-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input::placeholder { color: var(--text-muted); }

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

.btn-primary {
  height: 44px;
  padding: 0 1.25rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Progress bar ── */
.progress-wrap {
  margin-top: 1rem;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  display: none;
}

.progress-wrap.show { display: block; }

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 1s linear;
}

/* ── Status message ── */
.status-box {
  margin-top: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  display: none;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.5;
}

.status-box.show { display: flex; }

.status-box.waiting {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .status-box.waiting {
  border-color: rgba(59, 130, 246, 0.25);
}

.status-box.success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

[data-theme="dark"] .status-box.success {
  border-color: rgba(74, 222, 128, 0.2);
}

.status-box.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .status-box.error {
  border-color: rgba(248, 113, 113, 0.2);
}

.status-box a {
  color: inherit;
  font-weight: 600;
  text-underline-offset: 3px;
}

.status-box svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Spinner ── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
  opacity: 0.7;
}

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

/* ── Feature tags ── */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tag svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Steps ── */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.step-item:last-child { border-bottom: none; }

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .step-num {
  border-color: rgba(59, 130, 246, 0.25);
}

.step-body h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text);
}

.step-body p {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.step-body strong { color: var(--text); font-weight: 600; }
.step-body em { font-style: normal; color: var(--primary); font-weight: 500; }

/* ── Capabilities ── */
.cap-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.cap-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.cap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ── Notice box ── */
.notice-box {
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

[data-theme="dark"] .notice-box {
  border-color: rgba(248, 113, 113, 0.2);
}

.notice-icon {
  color: var(--danger);
  flex-shrink: 0;
  margin-top: 2px;
}

.notice-icon svg { width: 18px; height: 18px; }

.notice-box h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.notice-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notice-box li {
  font-size: 0.825rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.notice-box li::before { content: '–'; position: absolute; left: 0; color: var(--text-muted); }

.notice-box a { color: var(--primary); text-underline-offset: 3px; }

/* ── Footer (sama persis dengan ADB) ── */
footer {
  margin-top: 4rem;
  text-align: center;
  font-size: 0.85rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--primary); }

.admin-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8rem;
}

.admin-link:hover { color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 600px) {
  body { padding: 1rem; }
  header { flex-direction: column; align-items: flex-start; }
  .tool-header { gap: 0.75rem; }
  .tool-icon { width: 42px; height: 42px; }
  .tool-header-text h2 { font-size: 1.15rem; }
  .input-group { flex-direction: column; }
  .btn-primary { height: 44px; justify-content: center; width: 100%; }
  .cap-list { grid-template-columns: 1fr; }
  .notice-box { flex-direction: column; }
}
