/*
 * static/css/overrides.css
 *
 * Bootstrap token overrides — MUST load after Bootstrap CDN in base.html.
 * Uses Bootstrap 5's own --bs-* CSS custom properties so all button states
 * (hover, active, focus, disabled) pick up the correct colours automatically.
 */

/* ── Primary button: terracotta accent instead of Bootstrap blue ────────── */
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-focus-shadow-rgb: 196, 105, 58;   /* accent RGB */
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
}

/* ── Links: accent colour instead of Bootstrap blue ─────────────────────── */
:root {
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 196, 105, 58;
  --bs-link-hover-color: var(--accent-hover);
}

/* ── Focus ring: terracotta-tinted instead of blue ──────────────────────── */
:root {
  --bs-focus-ring-color: rgba(196, 105, 58, 0.25);
}

/* ── Form controls: override focus border and shadow ────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.25rem rgba(196, 105, 58, 0.25);
}

/* ── Nav tabs: warm theme, no Bootstrap blue ────────────────────────────── */
.nav-tabs {
  --bs-nav-tabs-border-color: var(--border);
  --bs-nav-tabs-link-hover-border-color: var(--border) var(--border) transparent;
  --bs-nav-tabs-link-active-color: var(--ink);
  --bs-nav-tabs-link-active-bg: var(--surface-raised);
  --bs-nav-tabs-link-active-border-color: var(--border) var(--border) var(--surface-raised);
}
.nav-tabs .nav-link { color: var(--ink-muted); }
.nav-tabs .nav-link:hover { color: var(--accent); }
.nav-tabs .nav-link.active { color: var(--ink); }

/* ══════════════════════════════════════════════════════════════════
   Import Recipe Modal — v2, elevated design
   ══════════════════════════════════════════════════════════════════ */

/* ── Dialog sizing ─────────────────────────────────────────────────── */
.import-modal-dialog {
  max-width: 580px;
}

/* ── Modal shell ───────────────────────────────────────────────────── */
.import-modal {
  background: var(--surface-raised);
  border-radius: 18px;
  border: 1px solid var(--border);
  /* Terracotta stripe at the very top — the single most effective premium signal */
  border-top: 3px solid var(--accent);
  overflow: hidden;
  box-shadow:
    0 32px 80px rgba(58, 47, 35, 0.18),
    0 8px 24px rgba(58, 47, 35, 0.08),
    0 2px 6px rgba(58, 47, 35, 0.05);
}

/* ── Header — warm gradient, not flat sunken ────────────────────────── */
.import-modal__header {
  padding: 30px 36px 26px;
  background: linear-gradient(150deg, var(--accent-soft) 0%, #fff8f3 55%, var(--surface-raised) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Eyebrow: real pill chip, not plain text */
.import-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(196, 105, 58, 0.10);
  border: 1px solid rgba(196, 105, 58, 0.28);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* Title: big, tight, heavy */
.import-modal__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.import-modal__subtitle {
  font-size: 14.5px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.55;
  padding-right: 40px; /* clear of close button */
}

/* Close button: sits inside the warm gradient area.
   Use background-color (not background shorthand) so Bootstrap's
   btn-close SVG background-image is not overwritten. */
.import-modal__close {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(58, 47, 35, 0.07);
  opacity: 0.7;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.import-modal__close:hover {
  background-color: rgba(58, 47, 35, 0.14);
  opacity: 1;
}

/* ── Segmented tabs — accent color when active ─────────────────────── */
.import-modal__tabs {
  padding: 14px 36px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}

.import-tab-group {
  display: flex;
  background: var(--surface-sunken);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
}

.import-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.import-tab:hover {
  color: var(--accent);
}

/* Active: white card + accent text + shadow — clearly distinct from inactive */
.import-tab--active {
  background: var(--surface-raised);
  color: var(--accent);
  font-weight: 700;
  box-shadow:
    0 2px 8px rgba(58, 47, 35, 0.10),
    0 0 0 1px var(--border);
}

/* ── Panel body ────────────────────────────────────────────────────── */
.import-modal__body {
  padding: 26px 36px 0;
}

/* ── URL input — tall, generously rounded ──────────────────────────── */
.import-url-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-sunken);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0 20px;
  height: 56px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.import-url-field:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(196, 105, 58, 0.12);
}

.import-url-field__icon {
  font-size: 18px;
  flex-shrink: 0;
  opacity: 0.45;
}

.import-url-field__input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
  min-width: 0;
}

.import-url-field__input::placeholder {
  color: var(--ink-subtle);
  font-size: 14px;
}

/* ── Supported-sites chips ─────────────────────────────────────────── */
.import-sites {
  margin-top: 20px;
}

.import-sites__label {
  font-size: 11px;
  color: var(--ink-subtle);
  margin: 0 0 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.import-sites__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* White background so chips stand out from the surface-raised body */
.import-chip {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--surface-raised);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(58, 47, 35, 0.06);
}

.import-chip--accent {
  border-color: rgba(196, 105, 58, 0.4);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
  box-shadow: none;
}

/* ── Dropzone — personality: radial warmth + springy icon ──────────── */
.import-dropzone {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 230px;
  border: 2px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--surface-sunken);
  cursor: pointer;
  padding: 40px 24px;
  text-align: center;
  transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  outline: none;
}

/* Radial warm glow — gives the dropzone depth without being gaudy */
.import-dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 38%, rgba(196, 105, 58, 0.07) 0%, transparent 68%);
  pointer-events: none;
}

.import-dropzone:hover,
.import-dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(196, 105, 58, 0.10);
}

/* Has-file: solid border, gradient fill */
.import-dropzone--has-file {
  border-style: solid;
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--surface-raised) 100%);
}

/* Icon: springy cubic-bezier bounce on hover */
.import-dropzone__icon {
  font-size: 44px;
  line-height: 1;
  position: relative;
  z-index: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.import-dropzone:hover .import-dropzone__icon,
.import-dropzone:focus-visible .import-dropzone__icon {
  transform: scale(1.18) translateY(-6px);
}

.import-dropzone__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  position: relative;
  z-index: 1;
}

.import-dropzone__hint {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
  position: relative;
  z-index: 1;
}

.import-browse-btn {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  padding: 8px 24px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.import-browse-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* ── Error banner ──────────────────────────────────────────────────── */
.import-error {
  margin-top: 12px;
  font-size: 13px;
  color: var(--error);
  background: var(--error-soft);
  border: 1px solid rgba(167, 58, 42, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.import-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 36px 30px;
  margin-top: 28px;
}

.import-cancel {
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: color 0.15s ease;
}
.import-cancel:hover { color: var(--ink); }

/* CTA: bigger padding, tighter radius, heavier weight */
.import-cta {
  padding: 10px 28px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 10px;
  letter-spacing: 0.01em;
}
