/* OfferLens Web App — Dark Theme */
/* Reuses same design language as Chrome Extension, adapted for full-width */

:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #1e2130;
  --bg-input: #252836;
  --border: #2d3143;
  --text-primary: #e4e6f0;
  --text-secondary: #8b8fa8;
  --text-muted: #646890;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --radius: 8px;
  --radius-sm: 4px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

#app {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.logo:hover { text-decoration: none; }

.demo-counter {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
}
.demo-counter.warning { color: var(--yellow); }
.demo-counter.danger { color: var(--red); }

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-small { font-size: 12px; padding: 4px 10px; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  padding: 2px 6px; font-size: 14px; color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { background: var(--bg-input); color: var(--text-primary); }

/* Inputs */
.input, .textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.input-lg { padding: 14px 18px; font-size: 16px; }
.textarea { resize: vertical; min-height: 120px; }
.textarea-lg { min-height: 200px; font-size: 16px; }

.input-group {
  display: flex;
  gap: 8px;
  max-width: 650px;
  margin: 0 auto;
}
.input-group .input { flex: 1; }

/* Forms */
.analyze-form { max-width: 650px; margin: 0 auto; }
.batch-form { max-width: 650px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

/* URL Display */
.url-display {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  max-width: 650px;
  margin: 0 auto;
  text-align: left;
}
.url-label { font-size: 12px; color: var(--text-muted); display: block; }
.url-text { font-size: 14px; color: var(--text-secondary); word-break: break-all; }

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--text-secondary); font-size: 15px; }

/* Error */
.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px auto;
  max-width: 650px;
  text-align: center;
}
.error p { color: var(--red); font-size: 15px; }

/* Results */
.results { margin-top: 24px; }
.section { margin-bottom: 24px; }
.section h2 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.card p { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card ul, .card ol { padding-left: 20px; margin: 8px 0; }
.card li { margin-bottom: 6px; }

/* Angle */
.angle-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.badge {
  background: var(--accent);
  color: white;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}
.badge-angle {
  background: var(--accent);
  color: white;
  text-transform: uppercase;
  font-size: 13px;
}
.confidence {
  font-size: 14px;
  color: var(--green);
  font-weight: 600;
}
.text-muted { color: var(--text-muted); font-size: 13px; }

/* Hooks */
.hook-list { list-style: decimal; padding-left: 24px; }
.hook-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  gap: 10px;
  font-size: 14px;
}

/* Tabs */
.tabs { display: flex; gap: 2px; margin-bottom: 10px; }
.tab {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  border-radius: var(--radius);
}
.tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.tab-content.hidden { display: none; }

/* Variants */
.variant {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.variant-label {
  font-size: 12px;
  color: var(--accent-hover);
  margin-bottom: 6px;
  font-weight: 600;
}
.variant p { font-size: 13px; margin-bottom: 4px; }

/* Copy row */
.copy-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.sms-pitch {
  background: var(--bg-input);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* Blockers */
.blocker { margin-bottom: 10px; }
.blocker:last-child { margin-bottom: 0; }

/* Batch */
.batch-list { display: flex; flex-direction: column; gap: 10px; }
.batch-table { width: 100%; border-collapse: collapse; }
.batch-table th, .batch-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.batch-table th { color: var(--text-secondary); font-weight: 600; }
.batch-url { font-size: 12px; word-break: break-all; color: var(--accent-hover); }
.error-list { padding-left: 20px; margin-top: 10px; }
.error-list li { color: var(--red); font-size: 13px; margin-bottom: 4px; }

/* Colors */
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-red { color: var(--red); }

/* Footer */
.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.footer a { color: var(--text-muted); }

/* Utility */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 600px) {
  #app { padding: 10px 12px 30px; }
  .hero h1 { font-size: 22px; }
  .input-group { flex-direction: column; }
  .batch-table { font-size: 11px; }
}
