/* ─────────────────────────────────────────────────────────────────
   CodeBundler — Phase 3 styles
   ───────────────────────────────────────────────────────────────── */

:root {
  --bg:          #0d1117;
  --bg-elev:     #161b22;
  --bg-elev-2:   #1c2230;
  --border:      #2d333b;
  --border-hi:   #3d444d;
  --text:        #e6edf3;
  --text-dim:    #8b949e;
  --accent:      #4f8cff;
  --accent-hi:   #6ea1ff;
  --success:     #3fb950;
  --danger:      #f85149;
  --warning:     #d29922;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 6px 24px rgba(0, 0, 0, 0.35);
  --font-mono:   ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(circle at 20% 0%, rgba(79, 140, 255, 0.08), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(79, 140, 255, 0.06), transparent 40%);
  background-attachment: fixed;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}

/* Hero */
.hero { text-align: center; margin-bottom: 32px; }
.hero h1 {
  font-size: 2rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.hero .logo { display: inline-block; margin-right: 6px; }
.tagline { color: var(--text-dim); margin: 0; font-size: 0.95rem; }

/* Card */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card.hidden { display: none; }

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.tab {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--bg-elev-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-hi);
}

/* Panels */
.panel.hidden { display: none; }

/* Dropzone */
.dropzone {
  display: block;
  border: 2px dashed var(--border-hi);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
  background: rgba(255, 255, 255, 0.01);
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.06);
}
.dropzone.dragover { transform: scale(1.005); }

.dz-inner { pointer-events: none; }
.dz-icon { font-size: 2.2rem; margin-bottom: 8px; }
.dz-title { font-weight: 600; margin-bottom: 4px; }
.dz-sub { color: var(--text-dim); font-size: 0.85rem; }

/* Options */
.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}
@media (min-width: 540px) {
  .options { grid-template-columns: 1fr 1fr 1fr; }
}

.opt { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.opt-label {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
}
.opt select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}
.opt select:focus { border-color: var(--accent); }

.opt.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  user-select: none;
  padding: 9px 0;
}
.opt.checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.opt.checkbox code {
  background: var(--bg-elev-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-hi);
}

/* Selection info */
.selection-info {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(79, 140, 255, 0.08);
  border: 1px solid rgba(79, 140, 255, 0.25);
  font-size: 0.9rem;
  color: var(--text);
}
.selection-info.hidden { display: none; }
.selection-info strong { color: var(--accent-hi); }

/* Progress */
.progress {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress.hidden { display: none; }
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  transition: width 0.15s ease-out;
}
.progress-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 44px;
  text-align: right;
}

/* Status */
.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}
.status.hidden { display: none; }
.status.info {
  background: rgba(79, 140, 255, 0.08);
  border: 1px solid rgba(79, 140, 255, 0.25);
  color: var(--text);
}
.status.success {
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: #a9e8af;
}
.status.error {
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: #ffbdb8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 20px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.05s, opacity 0.15s, border-color 0.15s;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover:not(:disabled):not(.disabled) { background: var(--accent-hi); }
.btn.primary:active:not(:disabled):not(.disabled) { transform: translateY(1px); }
.btn:disabled,
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}
.btn.ghost:hover {
  color: var(--text);
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, 0.02);
}

/* Limits */
.limits {
  margin: 16px 0 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.limits strong { color: var(--text); }

/* Result card */
.result-card { animation: fadeIn 0.25s ease-out; }

.result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.result-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.35);
  flex-shrink: 0;
}
.result-text { flex: 1; min-width: 0; }
.result-title {
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 600;
}
.result-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  word-break: break-word;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.stat-label {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-bottom: 4px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* Phase 3 — deletion notice */
.deletion-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.35);
  animation: fadeIn 0.3s ease-out;
}
.deletion-notice.hidden { display: none; }

.dn-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.dn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dn-text strong {
  color: #a9e8af;
  font-size: 0.95rem;
}
.dn-text span {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.4;
}

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

/* Footer */
.foot {
  text-align: center;
  margin-top: 32px;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.foot p { margin: 0; }
.foot code {
  background: var(--bg-elev-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-hi);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}