/*
  SmartScan — Design v2
  Minimalist, precise. Loaded after style.css.
  ─────────────────────────────────────────────
*/

/* ═══════════════════════════════════════════
   1. Token refinements
   ═══════════════════════════════════════════ */

:root {
  --bg:          #f4f6fb;
  --bg-card:     #ffffff;
  --bg-alt:      #eef0f8;
  --bg-input:    #eef0f8;
  --bg-hover:    #e4e8f4;
  --border:      #dde1f0;
  --text:        #0f172a;
  --text-muted:  #60708a;
  --text-dim:    #96a3ba;
  --radius:      10px;
  --radius-sm:   7px;
  --shadow-card: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
  --shadow:      0 2px 12px rgba(15,23,42,.08);
  /* keep accent teal */
}

[data-theme="dark"] {
  --bg:          #0c0e14;
  --bg-card:     #121520;
  --bg-alt:      #181c28;
  --bg-input:    #1b1f2e;
  --bg-hover:    #222840;
  --border:      #1e2436;
  --text:        #e4e7f2;
  --text-muted:  #7a8aa8;
  --text-dim:    #48566a;
  --shadow-card: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.32);
}


/* ═══════════════════════════════════════════
   2. Header — cleaner, less noise
   ═══════════════════════════════════════════ */

.header {
  background: rgba(244,246,251,.97);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

[data-theme="dark"] .header {
  background: rgba(12,14,20,.97);
}

.header-inner {
  padding: 13px 20px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.55px;
}

/* Accent dot after logo — subtle personality */
.logo-text::after {
  content: ".";
  color: var(--accent);
  font-weight: 900;
}


/* ═══════════════════════════════════════════
   3. Hero — stronger hierarchy, no bg wash
   ═══════════════════════════════════════════ */

/* Remove the generic radial gradient overlay */
.hero-section::before { display: none; }

.hero-section {
  padding: 40px 0 28px;
  gap: 52px;
  align-items: flex-start;
}

.hero-title {
  font-size: clamp(28px, 5.2vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-accent {
  background: linear-gradient(120deg, var(--accent) 20%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-muted);
  max-width: 520px;
}


/* ═══════════════════════════════════════════
   4. Demo window — polished chrome
   ═══════════════════════════════════════════ */

.demo-window {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.03),
    0 8px 32px rgba(15,23,42,.12),
    0 2px 6px rgba(15,23,42,.06);
  overflow: hidden;
}

[data-theme="dark"] .demo-window {
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04),
    0 8px 32px rgba(0,0,0,.4);
}

.demo-chrome {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  padding: 10px 14px;
}

/* demo dots: keep existing macOS colors (#ff5f56 / #febc2e / #28c840) */


/* ═══════════════════════════════════════════
   5. Card — less shadow, cleaner
   ═══════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}


/* ═══════════════════════════════════════════
   6. URL input — prominent, clean
   ═══════════════════════════════════════════ */

.url-input {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text);
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}

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

[data-theme="dark"] .url-input {
  background: var(--bg-input);
  border-color: var(--border);
}


/* ═══════════════════════════════════════════
   7. Extract button — flat, confident
      No pulsing. No gradients. Just teal.
   ═══════════════════════════════════════════ */

.btn-extract-main {
  background: var(--accent);
  background-image: none;
  animation: none !important;
  box-shadow: 0 2px 8px rgba(13,148,136,.22);
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-top: 12px;
  transition: background .15s, box-shadow .15s, transform .12s;
}

.btn-extract-main:hover {
  background: var(--accent-hover);
  background-image: none;
  box-shadow: 0 4px 18px rgba(13,148,136,.32);
  transform: translateY(-1px);
  filter: none;
  animation: none !important;
}

.btn-extract-main:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(13,148,136,.2);
}

.btn-extract-main .btn-extract-arrow {
  font-size: 16px;
  line-height: 1;
}


/* ═══════════════════════════════════════════
   8. Primary button — flat, no gradient
   ═══════════════════════════════════════════ */

.btn-primary {
  background: var(--accent);
  box-shadow: none;
  border: none;
  letter-spacing: -.01em;
}

.btn-primary:hover {
  background: var(--accent-hover);
  filter: none;
  box-shadow: 0 3px 12px rgba(13,148,136,.28);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  filter: none;
  box-shadow: none;
  background: var(--accent-hover);
}

[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 3px 12px rgba(20,184,166,.28);
}

.btn-outline {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: var(--text);
  border-color: var(--text-dim);
  background: var(--bg-hover);
}


/* ═══════════════════════════════════════════
   9. Target pills — less round, more precise
   ═══════════════════════════════════════════ */

.target-item {
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 5px 11px 5px 8px;
  transition: border-color .12s, background .12s, color .12s;
}

.target-item:hover {
  border-color: var(--text-dim);
  background: var(--bg-alt);
  color: var(--text);
}

.target-item:has(input:checked) {
  border-color: var(--accent);
  background: rgba(13,148,136,.07);
  color: var(--text);
}

[data-theme="dark"] .target-item { background: var(--bg-input); }
[data-theme="dark"] .target-item:hover { background: var(--bg-hover); }


/* ═══════════════════════════════════════════
   10. Example URL chips
   ═══════════════════════════════════════════ */

.example-url-btn {
  border-radius: 5px;
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 3px 9px;
  transition: border-color .12s, color .12s;
}

.example-url-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}


/* ═══════════════════════════════════════════
   11. Form input
   ═══════════════════════════════════════════ */

.form-input {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

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

[data-theme="dark"] .form-input {
  background: var(--bg-input);
}


/* ═══════════════════════════════════════════
   12. Progress — refined
   ═══════════════════════════════════════════ */

.progress-card {
  border-color: rgba(13,148,136,.3);
}

[data-theme="dark"] .progress-card {
  border-color: rgba(20,184,166,.25);
}

.progress-bar {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
}

.progress-fill {
  background: var(--accent);
  border-radius: 3px;
  transition: width .4s ease;
}

.progress-fill.running {
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    #5ec4d4 45%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  animation: progressShimmer 1.5s linear infinite;
}

.progress-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.progress-pct {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}

/* Stage steps — less rounded, cleaner */
.stage-step {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  letter-spacing: .025em;
  transition: all .25s ease;
}

.stage-step--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: none;
}

.stage-step--active::before {
  width: 5px;
  height: 5px;
  margin-right: 4px;
}

.stage-step--done {
  background: transparent;
  color: var(--success);
  border-color: rgba(23,163,74,.25);
}

[data-theme="dark"] .stage-step--done {
  border-color: rgba(46,204,113,.25);
}

.stage-arrow {
  color: var(--border);
  font-size: 11px;
}

.stage-arrow--flow {
  color: rgba(13,148,136,.5);
}


/* ═══════════════════════════════════════════
   13. Results / Summary items
   ═══════════════════════════════════════════ */

.results-card {
  border-color: rgba(23,163,74,.25);
}

[data-theme="dark"] .results-card {
  border-color: rgba(46,204,113,.2);
}

.results-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.summary-item {
  border-radius: 7px;
  padding: 8px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.summary-count {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.summary-label {
  font-size: 12.5px;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════
   14. Dashboard table
   ═══════════════════════════════════════════ */

.jobs-table th {
  font-size: 10.5px;
  letter-spacing: .055em;
  color: var(--text-dim);
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.jobs-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

[data-theme="dark"] .jobs-table td {
  border-bottom: 1px solid var(--border);
}

.jobs-table tbody tr {
  transition: background .1s;
}

.jobs-table tbody tr:hover td {
  background: var(--bg-hover);
}

.jobs-table tr:last-child td { border-bottom: none; }

/* Status badges */
.status-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}

.status-ok {
  background: rgba(23,163,74,.1);
  color: var(--success);
}

.status-err {
  background: rgba(200,40,26,.1);
  color: var(--error);
}

.status-run {
  background: rgba(13,148,136,.1);
  color: var(--accent);
  animation: none;
}

.status-cancelled {
  background: var(--bg-alt);
  color: var(--text-dim);
}

[data-theme="dark"] .status-ok  { background: rgba(46,204,113,.12); }
[data-theme="dark"] .status-err { background: rgba(231,76,60,.12); }
[data-theme="dark"] .status-run { background: rgba(20,184,166,.12); }

/* Skeleton: shimmer instead of pulse */
.skeleton-cell {
  background: linear-gradient(
    90deg,
    var(--bg-alt)   25%,
    var(--bg-hover) 50%,
    var(--bg-alt)   75%
  );
  background-size: 400px 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 3px;
}


/* ═══════════════════════════════════════════
   15. Profile sections
   ═══════════════════════════════════════════ */

/* Consistent section spacing */
#plan-card,
section.card { margin-bottom: 0; }

/* Usage bar */
.plan-progress-fill {
  height: 5px;
  border-radius: 3px;
}


/* ═══════════════════════════════════════════
   16. Radio / checkbox items
   ═══════════════════════════════════════════ */

.radio-item {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color .15s;
}

.radio-item:has(input:checked) {
  border-color: var(--accent);
  background: rgba(13,148,136,.05);
}

[data-theme="dark"] .radio-item { background: var(--bg-input); }

.checkbox-item {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

[data-theme="dark"] .checkbox-item { background: var(--bg-input); }


/* ═══════════════════════════════════════════
   17. Advanced settings toggle
   ═══════════════════════════════════════════ */

.advanced-toggle {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.advanced-toggle summary {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.advanced-toggle[open] summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}


/* ═══════════════════════════════════════════
   18. Social proof strip
   ═══════════════════════════════════════════ */

.sp-num {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.sp-label {
  font-size: 12.5px;
}

.sp-pill {
  border-radius: 5px;
  font-size: 11.5px;
}


/* ═══════════════════════════════════════════
   19. How-it-works steps
   ═══════════════════════════════════════════ */

.hiw-step {
  transition: border-color .15s, box-shadow .15s;
}

.hiw-step:hover {
  border-color: rgba(13,148,136,.25);
  box-shadow: 0 4px 20px rgba(13,148,136,.07);
}

.hiw-step-title {
  letter-spacing: -.02em;
}


/* ═══════════════════════════════════════════
   20. Scan header card
   ═══════════════════════════════════════════ */

.scan-header-card {
  padding: 16px 22px;
}

.scan-url {
  font-size: 14px;
  font-weight: 500;
}

.scan-url-label {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-dim);
}


/* ═══════════════════════════════════════════
   21. Section title
   ═══════════════════════════════════════════ */

.section-title {
  letter-spacing: -.025em;
}


/* ═══════════════════════════════════════════
   22. History header (dashboard)
   ═══════════════════════════════════════════ */

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}


/* ═══════════════════════════════════════════
   23. Scrollbar — subtle
   ═══════════════════════════════════════════ */

::-webkit-scrollbar          { width: 5px; height: 5px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }


/* ═══════════════════════════════════════════
   24. Focus rings — clean & consistent
   ═══════════════════════════════════════════ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ═══════════════════════════════════════════
   25. Lock badge
   ═══════════════════════════════════════════ */

.lock-badge {
  border-radius: 4px;
  font-size: 9.5px;
  letter-spacing: .03em;
}


/* ═══════════════════════════════════════════
   26. Targets grid separator labels
   ═══════════════════════════════════════════ */

.targets-grid-sep {
  font-size: 9.5px;
  letter-spacing: .08em;
  margin: 8px 0 2px;
}


/* ═══════════════════════════════════════════
   27. Copy button in preview panels
   ═══════════════════════════════════════════ */

.copy-btn {
  border-radius: 4px;
  font-size: 10.5px;
}


/* ═══════════════════════════════════════════
   28. Preview panel title
   ═══════════════════════════════════════════ */

.preview-panel-title {
  font-size: 12px;
  letter-spacing: .01em;
}


/* ═══════════════════════════════════════════
   29. Schedules card
   ═══════════════════════════════════════════ */

.schedules-summary {
  padding: 14px 20px;
}

/* ═══════════════════════════════════════════
   30. Error card
   ═══════════════════════════════════════════ */

.error-card {
  border-color: rgba(200,40,26,.3);
}

[data-theme="dark"] .error-card {
  border-color: rgba(231,76,60,.25);
}


/* ═══════════════════════════════════════════
   31. Mobile tweaks
   ═══════════════════════════════════════════ */

@media (max-width: 720px) {
  .hero-section {
    flex-direction: column;
    gap: 28px;
    padding: 28px 0 20px;
    align-items: flex-start;
  }

  .hero-title {
    font-size: clamp(26px, 7.5vw, 36px);
    letter-spacing: -.03em;
  }

  .card { padding: 18px; }

  .btn-extract-main {
    padding: 13px 20px;
    font-size: 14px;
  }
}
