/* Snipsum App — app.css
   Mobile-first. Dark navy + electric teal.
   Font: Syne (headings) + DM Sans (body) via Google Fonts
*/

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

:root {
  --navy:    #0A1628;
  --navy-2:  #0D1F3C;
  --navy-3:  #112347;
  --teal:    #0D9488;
  --teal-l:  #14B8A6;
  --teal-gl: rgba(13,148,136,.12);
  --white:   #FFFFFF;
  --grey:    #94A3B8;
  --grey-l:  #CBD5E1;
  --text:    #E2E8F0;
  --card:    rgba(255,255,255,.04);
  --border:  rgba(255,255,255,.08);
  --danger:  #EF4444;
  --warn:    #F59E0B;
  --success: #10B981;
  --radius:  12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-l); }
a:hover { color: var(--white); }

/* ── Top bar ──────────────────────────────────────────────────── */
.topbar {
  background: rgba(10,22,40,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  padding: .8rem 1rem;
  display: flex; align-items: center; gap: .75rem;
}
.topbar-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.1rem;
  color: var(--white); text-decoration: none;
  display: flex; align-items: center; gap: .4rem;
  flex-shrink: 0;
}
.topbar-logo .bolt {
  background: var(--teal); color: #fff;
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}
.topbar-search {
  flex: 1;
  display: flex; align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .45rem .75rem;
  gap: .5rem;
  max-width: 480px;
}
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: .9rem; font-family: inherit;
  min-width: 0;
}
.topbar-search input::placeholder { color: var(--grey); }
.topbar-search svg { color: var(--grey); flex-shrink: 0; }

.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* ── Save counter badge ───────────────────────────────────────── */
.save-badge {
  display: flex; align-items: center; gap: .3rem;
  font-size: .8rem; color: var(--grey);
  background: var(--card);
  border: 1px solid var(--border);
  padding: .3rem .65rem; border-radius: 100px;
  white-space: nowrap;
}
.save-badge.warning { color: var(--warn); border-color: rgba(245,158,11,.3); }
.save-badge.danger  { color: var(--danger); border-color: rgba(239,68,68,.3); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .2s; white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-l); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: var(--card); color: var(--grey);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--white); background: rgba(255,255,255,.08); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.2); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1rem; border-radius: 14px; }

/* ── Main layout ─────────────────────────────────────────────── */
.container { max-width: 680px; margin: 0 auto; padding: 1.25rem 1rem; }
.container-wide { max-width: 900px; margin: 0 auto; padding: 1.25rem 1rem; }

/* ── Banner / nudge ──────────────────────────────────────────── */
.banner {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.banner-warn  { background: rgba(245,158,11,.08); color: var(--warn); border-color: rgba(245,158,11,.2); }
.banner-error { background: rgba(239,68,68,.08); color: var(--danger); border-color: rgba(239,68,68,.2); }
.banner a { color: inherit; font-weight: 700; }

/* ── Snap card ───────────────────────────────────────────────── */
.snap-list { display: flex; flex-direction: column; gap: .75rem; }

.snap-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
  animation: fadeUp .3s ease both;
}
.snap-card:hover { border-color: rgba(13,148,136,.3); }

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

.snap-card-body { padding: 1rem; }

.snap-meta {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .5rem; flex-wrap: wrap;
}
.snap-source {
  font-size: .75rem; font-weight: 600;
  color: var(--teal-l); text-transform: uppercase; letter-spacing: .04em;
}
.snap-date { font-size: .75rem; color: var(--grey); }

.snap-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem; font-weight: 700;
  color: var(--white); line-height: 1.3;
  margin-bottom: .5rem;
  text-decoration: none; display: block;
}
.snap-title:hover { color: var(--teal-l); }

.snap-summary { font-size: .875rem; color: var(--grey-l); line-height: 1.6; }

.snap-tags {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin-top: .75rem;
}
.snap-tag {
  background: var(--teal-gl);
  border: 1px solid rgba(13,148,136,.2);
  color: var(--teal-l);
  font-size: .72rem; font-weight: 500;
  padding: .2rem .55rem; border-radius: 100px;
  cursor: pointer; transition: background .15s;
}
.snap-tag:hover { background: rgba(13,148,136,.25); }

.snap-actions {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.snap-link { font-size: .8rem; color: var(--grey); text-decoration: none; }
.snap-link:hover { color: var(--teal-l); }
.snap-delete {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--grey); font-size: .8rem; padding: .2rem .4rem;
  border-radius: 6px; transition: all .15s;
  font-family: inherit;
}
.snap-delete:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--grey);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 {
  font-family: 'Syne', sans-serif;
  color: var(--white); font-size: 1.1rem; margin-bottom: .5rem;
}
.empty-state p { font-size: .9rem; max-width: 320px; margin: 0 auto 1.5rem; }

/* ── Processing / spinner ────────────────────────────────────── */
.processing {
  display: flex; flex-direction: column; align-items: center;
  padding: 3rem 1rem; gap: 1rem; text-align: center;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing h3 {
  font-family: 'Syne', sans-serif;
  color: var(--white); font-size: 1.1rem;
}
.processing p { font-size: .875rem; color: var(--grey); }

/* ── Auth page ───────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at center top, rgba(13,148,136,.1) 0%, transparent 60%),
              var(--navy);
}
.auth-card {
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%; max-width: 400px;
}
.auth-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.5rem;
  color: var(--white); text-align: center;
  margin-bottom: .5rem;
}
.auth-tagline {
  text-align: center; color: var(--grey);
  font-size: .875rem; margin-bottom: 2rem;
}
.auth-form-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--white); margin-bottom: 1.25rem;
}

/* ── Form elements ───────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--grey); margin-bottom: .4rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.input {
  width: 100%; padding: .75rem 1rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: .95rem; font-family: inherit;
  transition: border-color .2s;
  outline: none;
}
.input:focus { border-color: var(--teal); }
.input::placeholder { color: var(--grey); }

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius); padding: .85rem 1rem;
  font-size: .875rem; margin-bottom: 1rem;
}
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6EE7B7; }
.alert-error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #FCA5A5; }
.alert-warn    { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #FCD34D; }

/* ── Upgrade page ────────────────────────────────────────────── */
.upgrade-page {
  min-height: 100vh; padding: 2rem 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(13,148,136,.08) 0%, transparent 60%), var(--navy);
}
.upgrade-card {
  background: var(--navy-2);
  border: 1px solid var(--teal);
  border-radius: 20px; padding: 2.5rem;
  max-width: 440px; width: 100%; text-align: center;
}
.upgrade-icon { font-size: 3rem; margin-bottom: 1rem; }
.upgrade-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem; font-weight: 800;
  color: var(--white); margin-bottom: .75rem; line-height: 1.2;
}
.upgrade-card p { color: var(--grey); font-size: .95rem; margin-bottom: 1.5rem; }
.upgrade-price {
  font-family: 'Syne', sans-serif;
  font-size: 2.5rem; font-weight: 800; color: var(--white);
  margin-bottom: .25rem;
}
.upgrade-period { font-size: .9rem; color: var(--grey); margin-bottom: 1.75rem; }
.upgrade-features { list-style: none; text-align: left; margin-bottom: 1.75rem; }
.upgrade-features li {
  display: flex; align-items: center; gap: .6rem;
  font-size: .9rem; color: var(--grey-l); padding: .4rem 0;
  border-bottom: 1px solid var(--border);
}
.upgrade-features li:last-child { border: none; }
.upgrade-features li::before { content: '✓'; color: var(--teal-l); font-weight: 700; }

/* ── Share page ──────────────────────────────────────────────── */
.share-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1rem; text-align: center;
}
.share-result {
  background: var(--navy-2);
  border: 1px solid rgba(13,148,136,.3);
  border-radius: 16px; padding: 1.5rem;
  max-width: 480px; width: 100%;
  text-align: left; margin-bottom: 1rem;
}
.share-result-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem; font-weight: 700; color: var(--white);
  margin-bottom: .5rem;
}
.share-result-summary { font-size: .875rem; color: var(--grey-l); line-height: 1.6; }

/* ── Skeleton loader ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, rgba(255,255,255,.07) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .topbar { padding: .7rem .75rem; gap: .5rem; }
  .save-badge span:not(.count) { display: none; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .upgrade-card { padding: 1.75rem 1.25rem; }
}

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

/* ── Filter bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.filter-tag {
  background: var(--card); border: 1px solid var(--border);
  color: var(--grey); font-size: .8rem;
  padding: .25rem .65rem; border-radius: 100px;
  cursor: pointer; transition: all .15s;
}
.filter-tag:hover, .filter-tag.active {
  background: var(--teal-gl);
  border-color: rgba(13,148,136,.3);
  color: var(--teal-l);
}

/* ── Stats row ───────────────────────────────────────────────── */
.stats-row {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1rem;
  flex: 1; min-width: 80px;
}
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem; font-weight: 800; color: var(--white);
  line-height: 1;
}
.stat-label { font-size: .75rem; color: var(--grey); margin-top: .2rem; }
