/* ============================================================
   Search.TheFinanceStory — Base & Global Styles
   base.css
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}
ul, ol { list-style: none; }

/* ── Lucide icons ── */
[data-lucide] { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ── Typography ── */
h1, h2 {
  font-family: 'DM Serif Display', sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h3, h4, h5 {
  font-family: 'DM Sans', sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.text-brand   { color: var(--brand); }
.text-muted   { color: var(--ink-muted); }
.text-soft    { color: var(--ink-soft); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }

/* ── Section helpers ── */
.section { padding: 80px 48px; }
.section-inner { max-width: 1160px; margin: 0 auto; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 14px;
}
.section-label::before {
  content: '';
  width: 22px; height: 2px;
  background: var(--brand);
  border-radius: 1px;
  flex-shrink: 0;
}

.section-title {
  font-family: 'DM Serif Display', sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.section-title em {
  font-style: italic;
  color: var(--brand);
}

.section-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 560px;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge [data-lucide] { width: 10px; height: 10px; }
.badge-brand   { background: var(--brand-pale);    color: var(--brand);   border: 1px solid var(--brand-mid); }
.badge-success { background: var(--success-pale);  color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-pale);  color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger  { background: var(--danger-pale);   color: var(--danger);  border: 1px solid var(--danger-border); }
.badge-ink     { background: var(--cream);         color: var(--ink-soft);border: 1px solid var(--border); }

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 5px 11px;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: default;
  transition: all 0.18s;
}
.tag:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-pale);
}

/* ── Skill tags row ── */
.tags-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--r-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn [data-lucide] { width: 15px; height: 15px; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-light);
  box-shadow: var(--shadow-brand);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--border-dark);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-pale);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn-outline:hover {
  background: var(--brand);
  color: #fff;
}

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

.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 14px 28px; font-size: 16px; border-radius: var(--r-md); }
.btn-xl  { padding: 16px 32px; font-size: 16px; border-radius: var(--r-md); }
.btn-full { width: 100%; }

/* ── Icon button ── */
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
}
.icon-btn:hover, .icon-btn.active {
  border-color: var(--brand);
  background: var(--brand-pale);
}
.icon-btn [data-lucide] { width: 16px; height: 16px; color: var(--ink-muted); }
.icon-btn.active [data-lucide] { color: var(--brand); }

/* ── Form elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.form-label .opt {
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-muted);
}
.form-hint {
  font-size: 11px;
  color: var(--ink-muted);
}
.form-input, .form-select, .form-textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  width: 100%;
  transition: all 0.18s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(1,115,242,.08);
}
.form-textarea { min-height: 90px; resize: vertical; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--paper);
}
.upload-zone:hover { border-color: var(--brand); background: var(--brand-pale); }
.upload-zone.filled { border-color: var(--success); background: var(--success-pale); border-style: solid; }
.upload-zone [data-lucide] { width: 26px; height: 26px; color: var(--ink-muted); margin: 0 auto 8px; }
.upload-zone.filled [data-lucide] { color: var(--success); }
.upload-zone-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.upload-zone-sub { font-size: 11px; color: var(--ink-muted); }

/* ── Stat cards — strip accent ── */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  border-left: 3px solid var(--brand);
  position: relative;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: -1px; right: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-pale) 0%, transparent 100%);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.stat-label { font-size: 12px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.stat-value {
  font-family: 'DM Serif Display', sans-serif;
  font-size: 28px; font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.stat-value .accent { color: var(--brand); }
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-change [data-lucide] { width: 12px; height: 12px; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state [data-lucide] { width: 40px; height: 40px; color: var(--ink-muted); margin: 0 auto 14px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-state-sub { font-size: 14px; color: var(--ink-muted); }

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.font-display { font-family: 'DM Serif Display', sans-serif; }

/* ── Responsive helpers ── */
@media (max-width: 768px) {
  .section { padding: 60px 20px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ── 404 / Error pages ── */
.bg-auth {
  align-items: center;
  background-color: rgba(var(--primary-color-rgb, 60,101,245),.1);
  display: flex;
  min-height: 100vh;
  padding: 40px 0;
}

/* ── Toast notifications ── */
#alert-container {
  position: fixed;
  right: 5px;
  top: 100px;
  z-index: 9999999;
}
.toast-notification .toast {
  position: relative;
  height: 100%;
  padding: 15px 20px;
  background-color: #ffffff;
  border-radius: 7px;
  display: grid !important;
  grid-template-columns: 1.3fr 6fr 0.5fr;
  box-shadow: 0 15px 30px #656262;
  animation-delay: 1ms;
  animation-duration: 1ms;
  animation-name: fadeIn;
}
.toast-notification .toast.error {
  background-color: rgb(234, 205, 205);
  border-left: 3px solid #ff355b;
}
.toast-notification .toast.success {
  background-color: #cff6cf;
  border-left: 3px solid #47D764;
}
.toast-notification .toast:not(:last-child) {
  margin-bottom: 20px;
}
.toast-notification .outer-container,
.toast-notification .inner-container {
  align-self: center;
}
.toast-notification .outer-container {
  font-size: 35px;
}
.toast-notification .success {
  color: #47D764;
}
.toast-notification .success svg {
  color: #47D764;
}
.toast-notification .error {
  color: #ff355b;
}
.toast-notification .error svg {
  color: #ff355b;
}
.toast-notification .inner-container p:first-child {
  color: #101020;
  font-weight: 600;
  font-size: 16px;
}
.toast-notification .inner-container p:last-child {
  font-size: 12px;
  font-weight: 400;
  color: #383737;
}
.toast-notification .close-toast {
  position: absolute;
  background-color: transparent;
  font-size: 20px;
  color: #656565;
  top: 5px;
  right: 10px;
  cursor: pointer;
  text-decoration: none;
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
