:root {
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1a1a1a;
  --border: #2a2a2a;
  --border2: #333;
  --accent: #c8f542;
  --accent2: #a8d620;
  --text: #f0f0f0;
  --text2: #888;
  --text3: #555;
  --danger: #ff4d4d;
  --success: #4dff91;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(200,245,66,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,245,66,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 48px;
}

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

.logo-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

h1 span { color: var(--accent); }

.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text2);
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 99px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  transition: background 0.3s;
}
.dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.offline { background: var(--danger); }

/* Input section */
.parse-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.url-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
}

.url-input::placeholder { color: var(--text3); }
.url-input:focus { border-color: var(--accent); }

.parse-btn {
  background: var(--accent);
  color: #0d0d0d;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.parse-btn:hover { background: var(--accent2); }
.parse-btn:active { transform: scale(0.97); }
.parse-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.options-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 14px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
}

.toggle {
  width: 36px;
  height: 20px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.on { background: var(--accent); border-color: var(--accent); }

.toggle::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
}

.toggle.on::after { left: 18px; background: #0d0d0d; }

.api-url-hint {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  margin-left: auto;
}

/* Result */
.result-section { margin-bottom: 32px; }

.result-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: slideIn 0.25s ease;
}

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

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.result-url {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 500px;
}

.method-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--border2);
  color: var(--text2);
  white-space: nowrap;
}

.method-badge.ai { border-color: var(--accent); color: var(--accent); }

.result-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text3);
  margin-bottom: 8px;
}

.description-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.no-data { color: var(--text3); font-size: 14px; font-style: italic; }

.socials-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.social-row:hover { border-color: var(--border2); }

.social-name {
  font-size: 13px;
  font-weight: 600;
  min-width: 110px;
  color: var(--text);
}

.social-link {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-link:hover { text-decoration: underline; }

.social-followers {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  background: rgba(200,245,66,0.08);
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

/* Loading */
.loading-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 14px;
  animation: slideIn 0.2s ease;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.error-box {
  padding: 16px 20px;
  background: rgba(255,77,77,0.07);
  border: 1px solid rgba(255,77,77,0.25);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 14px;
  font-family: 'DM Mono', monospace;
  animation: slideIn 0.2s ease;
}

/* History */
.history-section { margin-top: 8px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.clear-btn {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}

.clear-btn:hover { color: var(--danger); }

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  animation: slideIn 0.2s ease;
}

.history-item:hover { border-color: var(--border2); background: var(--bg3); }

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

.history-url {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}

.history-socials-count {
  font-size: 11px;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
}

/* Export bar */
.export-bar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  letter-spacing: 0.02em;
}

.export-btn:hover { border-color: var(--accent); color: var(--accent); }
.export-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.empty-history {
  text-align: center;
  padding: 32px;
  color: var(--text3);
  font-size: 13px;
  font-family: 'DM Mono', monospace;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
