/* ═══════════════════════════════════════════
   Exotic Pet Expos Community — app.css
   Stormy Morning Theme + Light Mode Toggle
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=DM+Serif+Display&display=swap');

/* ── STORMY DARK (default) ── */
:root {
  --bg:        #1c2128;
  --bg2:       #242b34;
  --surface:   #2d3748;
  --surface2:  #374151;
  --line:      rgba(148,163,184,.12);
  --line2:     rgba(148,163,184,.22);
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --subtle:    #64748b;
  --brand:     #f59e0b;
  --brand-dim: rgba(245,158,11,.15);
  --accent:    #60a5fa;
  --accent-dim:rgba(96,165,250,.12);
  --ok:        #34d399;
  --ok-dim:    rgba(52,211,153,.12);
  --danger:    #f87171;
  --warn:      #f59e0b;
  --shadow:    0 4px 20px rgba(0,0,0,.35);
  --radius:    12px;
  --radius2:   16px;
  --max:       1100px;
  --font:      'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-head: 'DM Serif Display', Georgia, serif;
}

/* ── LIGHT MODE ── */
body.light {
  --bg:        #f1f5f9;
  --bg2:       #e8eef5;
  --surface:   #ffffff;
  --surface2:  #f1f5f9;
  --line:      rgba(0,0,0,.08);
  --line2:     rgba(0,0,0,.15);
  --text:      #1e293b;
  --muted:     #64748b;
  --subtle:    #94a3b8;
  --brand:     #d97706;
  --brand-dim: rgba(217,119,6,.1);
  --accent:    #2563eb;
  --accent-dim:rgba(37,99,235,.1);
  --ok:        #059669;
  --ok-dim:    rgba(5,150,105,.1);
  --danger:    #dc2626;
  --warn:      #d97706;
  --shadow:    0 2px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
a { color: inherit; text-decoration: none; }

/* ── BASE ── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background .25s, color .25s;
}
body:not(.light) {
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -5%, rgba(96,165,250,.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 90% 5%,  rgba(245,158,11,.05) 0%, transparent 50%);
}

/* ── LAYOUT ── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 24px 18px; }

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(28,33,40,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background .25s;
  position: relative;
}
body.light .topbar { background: rgba(255,255,255,.92); }
body:not(.light) .topbar::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,158,11,.2), transparent);
}
.nav {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 18px;
  max-width: var(--max); margin: 0 auto;
}
.brand {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--brand);
  display: flex; align-items: center; gap: 8px;
  margin-right: 6px;
  white-space: nowrap;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-dim);
}
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; }
.right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface2); color: var(--text); }

/* ── PILLS ── */
.pill {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font);
}
.pill:hover { background: var(--surface2); color: var(--text); }
.pill.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #1c1007;
  font-weight: 800;
  box-shadow: 0 2px 8px var(--brand-dim);
}
.pill.primary:hover { opacity: .9; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: background .25s, border-color .25s;
}
body.light .card { box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.04); }

/* ── TYPOGRAPHY ── */
h1, h2, h3 { margin: 0 0 10px; font-family: var(--font-head); font-weight: 400; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.kicker {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--brand); margin-bottom: 4px;
  font-family: var(--font);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }

/* ── GRID ── */
.grid { display: grid; gap: 14px; }
.grid.cols3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media(max-width:980px){ .grid.cols3{ grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:640px){ .grid.cols3,.grid.cols2{ grid-template-columns: 1fr; } }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; }

/* ── BADGES ── */
.badge {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--line2);
  background: var(--surface2);
  font-weight: 700; font-size: 11px; color: var(--muted);
}
.badge.ok     { border-color: rgba(52,211,153,.3);  background: var(--ok-dim);           color: var(--ok); }
.badge.warn   { border-color: rgba(245,158,11,.3);  background: var(--brand-dim);        color: var(--warn); }
.badge.danger { border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.1);    color: var(--danger); }

/* ── INPUTS ── */
.input, textarea, select {
  width: 100%;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s;
  margin-bottom: 12px;
}
.input:focus, textarea:focus, select:focus { border-color: var(--brand); background: var(--surface); }
body.light .input, body.light textarea, body.light select { background: #fff; border-color: rgba(0,0,0,.15); }
textarea { min-height: 100px; resize: vertical; }

/* ── BUTTONS ── */
.btn {
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid var(--line2);
  background: var(--surface2);
  color: var(--text);
  font-weight: 700; font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
  transition: .15s;
}
.btn:hover { background: var(--surface); }
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #1c1007;
  font-weight: 800;
  box-shadow: 0 2px 8px var(--brand-dim);
}
.btn.primary:hover { opacity: .9; }
.btn.danger { border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.1); color: var(--danger); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── MARKET ── */
.market { display: grid; grid-template-columns: 270px 1fr; gap: 14px; }
@media(max-width:920px){ .market{ grid-template-columns: 1fr; } }
.filters .small { font-size: 12px; }
.listing-card { overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.listing-card .img {
  height: 160px; background: var(--bg2);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--subtle);
}
.listing-card .body { padding: 14px; }
.price { font-size: 16px; font-weight: 800; color: var(--ok); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ── AUCTIONS ── */
.auction-grid { display: grid; grid-template-columns: 1fr 340px; gap: 14px; }
@media(max-width:920px){ .auction-grid{ grid-template-columns: 1fr; } }
.bigimg {
  height: 320px; border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  color: var(--subtle); overflow: hidden;
}

/* ── GROUPS / FORUM ── */
.composer { display: flex; flex-direction: column; gap: 10px; }
.post { padding: 14px; }
.post .head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.post .who { font-weight: 700; }
.comment { padding: 10px; border-top: 1px solid var(--line); }

/* ── FOOTER ── */
.footer {
  color: var(--muted); padding: 22px 18px;
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: 32px; font-size: 13px;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--brand); }
