/* ============================================================
   Fizzshelf visual system
   Palette: system whites/grays, near-black text, a restrained
   forest green accent for links/buttons, with light and dark
   theme surfaces driven by CSS variables.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap");

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-tertiary: #fbfbfd;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #228b22;
  --accent-hover: #2a9b2a;
  --accent-active: #1f7a1f;
  --divider: rgba(0, 0, 0, 0.08);
  --success: #1d8f3b;
  --danger: #d70015;
  --warning: #bf5700;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, 0.09), 0 2px 6px rgba(0, 0, 0, 0.06);
  --max-width: 1100px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111814;
  --bg-secondary: #1a221c;
  --bg-tertiary: #202923;
  --text: #f3f7f4;
  --text-secondary: #b3beb6;
  --text-tertiary: #87938b;
  --divider: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-card-hover: 0 16px 36px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.47059;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--divider);
}
html[data-theme="dark"] .nav { background: rgba(17, 24, 20, 0.88); }
.nav-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; height: 52px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; display: flex; align-items: center; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { font-size: 13px; color: var(--text); opacity: 0.9; }
.nav-links a:hover { opacity: 1; }
.nav-cta { display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  padding: 9px 18px; border-radius: 980px; border: 1px solid transparent;
  cursor: pointer; transition: background .15s ease, transform .1s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }
.btn-secondary { background: var(--bg-secondary); color: var(--text); }
.btn-secondary:hover { background: #ebebee; }
.btn-outline { background: transparent; color: var(--accent); border-color: rgba(34,139,34,0.4); }
.btn-outline:hover { background: rgba(34,139,34,0.08); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(215,0,21,0.3); }
.btn-danger:hover { background: rgba(215,0,21,0.06); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
html[data-theme="dark"] .btn-secondary:hover { background: #28312b; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 64px; text-align: center; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 650; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 18px; }
.hero p.lead { font-size: 19px; color: var(--text-secondary); max-width: 560px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 28px; font-weight: 650; letter-spacing: -0.015em; margin: 0; }
.section-head .sub { color: var(--text-secondary); font-size: 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  font-size: 13px; padding: 7px 14px; border-radius: 980px; background: var(--bg-secondary);
  color: var(--text); cursor: pointer; border: 1px solid transparent; transition: all .15s ease;
}
.chip.active { background: var(--text); color: #fff; }
.chip:hover:not(.active) { background: #ebebee; }
html[data-theme="dark"] .chip.active { background: var(--accent); color: #fff; }
html[data-theme="dark"] .chip:hover:not(.active) { background: #252d27; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }

.card {
  background: var(--bg-tertiary); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-card); transition: box-shadow .25s ease, transform .25s ease;
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card-thumb { aspect-ratio: 4/3; background: linear-gradient(135deg, #eef1f5, #e4e7ec); position: relative; overflow: hidden; }
html[data-theme="dark"] .card-thumb { background: linear-gradient(135deg, #1b241e, #151b17); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .placeholder-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; opacity: 0.25; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.card-meta { font-size: 12.5px; color: var(--text-tertiary); display: flex; gap: 12px; margin-top: auto; padding-top: 6px; }
.card-owner { font-size: 12.5px; color: var(--text-secondary); }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-thumb { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); aspect-ratio: 4/3; background: var(--bg-secondary); }
.thumb-gallery { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb-gallery-btn { border: 1px solid var(--divider); background: #fff; padding: 0; border-radius: 10px; width: 72px; height: 54px; overflow: hidden; cursor: pointer; }
html[data-theme="dark"] .thumb-gallery-btn { background: #151b17; }
.thumb-gallery-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-gallery-btn.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(34,139,34,0.15); }
.detail-panel { position: sticky; top: 80px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 980px; background: var(--bg-secondary); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.badge.pending { background: #fff4e5; color: var(--warning); }
.badge.approved { background: #e8f8ed; color: var(--success); }
.badge.rejected { background: #fdeaea; color: var(--danger); }
.detail-title { font-size: 32px; font-weight: 650; letter-spacing: -0.02em; margin: 14px 0 8px; }
.detail-desc { color: var(--text-secondary); font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; }
.stat-row { display: flex; gap: 20px; margin: 18px 0; font-size: 13px; color: var(--text-tertiary); }
.tutorial-videos { display: grid; gap: 12px; margin: 12px 0 18px; }
.tutorial-video-frame { border-radius: 14px; overflow: hidden; border: 1px solid var(--divider); background: var(--bg-secondary); }
.tutorial-video-frame iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.action-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.divider { height: 1px; background: var(--divider); margin: 32px 0; border: none; }

/* ---------- Forms ---------- */
.form-card { background: var(--bg-tertiary); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-card); max-width: 560px; margin: 0 auto; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-tertiary); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea, select {
  width: 100%; font-family: var(--font); font-size: 15px; padding: 11px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--divider); background: #fff;
  color: var(--text); transition: border-color .15s ease, box-shadow .15s ease;
}
html[data-theme="dark"] input[type=text], html[data-theme="dark"] input[type=email], html[data-theme="dark"] input[type=password], html[data-theme="dark"] input[type=url], html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: #141b16; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(34,139,34,0.12); outline: none; }
textarea { resize: vertical; min-height: 110px; }
.dropzone {
  border: 1.5px dashed var(--divider); border-radius: var(--radius-md); padding: 28px;
  text-align: center; color: var(--text-secondary); font-size: 13.5px; cursor: pointer; background: var(--bg-secondary);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #eef7ef; }
html[data-theme="dark"] .dropzone:hover, html[data-theme="dark"] .dropzone.drag { background: #172018; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 6px; }
.success-text { color: var(--success); font-size: 13px; margin-top: 6px; }
.scan-progress-wrap { margin-top: 10px; }
.scan-progress-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.scan-progress-bar { height: 8px; border-radius: 999px; background: #e8e8ed; overflow: hidden; }
html[data-theme="dark"] .scan-progress-bar { background: #2a332c; }
.scan-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .25s ease; }

/* ---------- Comments ---------- */
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--divider); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.comment-body { flex: 1; }
.comment-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.comment-author { font-size: 13.5px; font-weight: 600; }
.comment-time { font-size: 11.5px; color: var(--text-tertiary); }
.comment-text { font-size: 14.5px; color: var(--text); margin-top: 4px; white-space: pre-wrap; }
.comment-actions { margin-top: 6px; display: flex; gap: 12px; }
.comment-actions button { font-size: 11.5px; color: var(--text-tertiary); background: none; border: none; cursor: pointer; }
.comment-actions button:hover { color: var(--danger); }

/* ---------- Profile / store ---------- */
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 600; color: var(--text-secondary); }
.store-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--bg-tertiary); border-radius: var(--radius-md); box-shadow: var(--shadow-card); margin-bottom: 12px; }
.store-price { font-weight: 600; color: var(--accent); }

/* ---------- Moderator table ---------- */
.mod-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--divider); align-items: center; }
.mod-row-actions { display: flex; gap: 8px; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-tertiary); }
.empty-state h3 { color: var(--text); font-size: 19px; margin-bottom: 6px; }

/* ---------- Toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(29,29,31,0.92); color: #fff; padding: 12px 20px; border-radius: 980px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100; backdrop-filter: blur(10px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--divider); padding: 40px 0; margin-top: 60px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-tertiary); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 64px 0 40px; }
  .form-card { padding: 26px; }
}
