@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0c0c0f;
  --surface: #16161a;
  --surface-2: #1e1e24;
  --border: #2a2a32;
  --text: #e8e6e3;
  --text-dim: #94929d;
  --accent: #fc5c2d;
  --accent-glow: rgba(252, 92, 45, 0.15);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.12);
  --radius: 12px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Header ── */
header {
  text-align: center;
  margin-bottom: 48px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

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

header p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.tab:hover:not(.active) {
  color: var(--text);
  background: var(--surface-2);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── SOP Steps ── */
.sop-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
  padding-left: 72px;
}

.step-num {
  position: absolute;
  left: 24px;
  top: 24px;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.sop-step h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.sop-step p {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.sop-step code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--border);
}

.sop-step .code-block {
  display: block;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--green);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.sop-note {
  background: var(--accent-glow);
  border: 1px solid rgba(252, 92, 45, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.sop-note strong { color: var(--accent); }

/* ── Scraper Inputs ── */
.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

textarea {
  width: 100%;
  min-height: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea::placeholder { color: #4a4a55; }

/* ── Buttons ── */
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #e04f25;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
}

/* ── Status Banner ── */
.status {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  display: none;
}

.status.success {
  display: block;
  background: var(--green-dim);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--green);
}

.status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

/* ── Preview Table ── */
.preview-wrapper {
  margin-top: 24px;
  display: none;
}

.preview-wrapper.show { display: block; }

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

.preview-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.preview-header span {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 1100px;
}

th {
  background: var(--surface-2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr:hover td { background: var(--surface); }

.veg-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.veg-badge.veg   { background: var(--green-dim); color: var(--green); }
.veg-badge.nonveg { background: rgba(239, 68, 68, 0.1); color: #f87171; }

/* ── Footer ── */
footer {
  text-align: center;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .container { padding: 24px 16px 60px; }
  header h1  { font-size: 1.5rem; }
  .sop-step  { padding-left: 60px; }
  .btn       { padding: 12px 20px; font-size: 0.85rem; }
}

footer a { color: var(--text-dim); }
footer a:hover { color: var(--accent); }

/* ── Phone notice ── */
.mobile-notice {
  background: var(--accent-glow);
  border: 1px solid rgba(252, 92, 45, 0.35);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 28px;
  text-align: center;
}
.mobile-notice[hidden] { display: none; }
.mobile-notice-icon { font-size: 2rem; margin-bottom: 4px; }
.mobile-notice h2 { font-size: 1.25rem; margin-bottom: 8px; }
.mobile-notice p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 16px; }
.mobile-notice .btn-row { justify-content: center; }
.mobile-notice-url {
  margin: 14px 0 0 !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem !important;
  color: var(--text) !important;
  word-break: break-all;
}
.mobile-notice-more { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 0.85rem; }
