/* ------------------------------
   Delco Locals — styles.css
   Mobile-first, modern UI
---------------------------------*/

/* Theme tokens */
:root {
  --bg: #0f172a;           /* slate-900 */
  --surface: #111827;      /* gray-900 */
  --overlay: #0b1220e6;    /* translucent */
  --border: #263248;       /* slate-700 */
  --text: #e5e7eb;         /* gray-200 */
  --muted: #9ca3af;        /* gray-400 */
  --accent: #38bdf8;       /* sky-400 */
  --accent-2: #22d3ee;     /* cyan-400 */
  --brand: #f59e0b;        /* amber-500 */
  --green: #10b981;        /* emerald-500 */
  --blue: #3b82f6;         /* blue-500 */
  --danger: #ef4444;       /* red-500 */

  --card: #0b1220;         /* deep navy */
  --shadow: 0 8px 24px rgba(0,0,0,.35);

  --radius: 16px;
  --radius-sm: 12px;

  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

html[data-theme="light"] {
  --bg: #f8fafc;           /* slate-50 */
  --surface: #ffffff;
  --overlay: #ffffffee;
  --border: #e5e7eb;       /* gray-200 */
  --text: #0f172a;         /* slate-900 */
  --muted: #64748b;        /* slate-500 */
  --accent: #0284c7;       /* sky-700 */
  --accent-2: #0891b2;     /* cyan-700 */
  --brand: #b45309;        /* amber-700 */
  --green: #16a34a;        /* green-600 */
  --blue: #2563eb;         /* blue-600 */
  --card: #ffffff;
  --shadow: 0 6px 20px rgba(2, 6, 23, .1);
}

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(56,189,248,.08), transparent 50%),
              radial-gradient(800px 400px at 110% -20%, rgba(34,211,238,.08), transparent 40%),
              var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }

/* Layout helpers */
.container { width: min(1120px, 92%); margin-inline: auto; }
.hide { display: none !important; }
.hide-sm { display:none; }
@media (min-width: 720px) { .hide-sm { display: initial; } }

/* Typography */
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.15; margin: 0 0 8px; }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin: 0; }
h3 { font-size: 1.05rem; margin: 0; }
.page-title { margin: 28px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.mb-8 { margin-bottom: 8px; }
.mt-12 { margin-top: 12px; }
.full-w { width: 100%; }

/* Nav */
.nav { position: sticky; top: 0; backdrop-filter: blur(10px); background: var(--overlay); border-bottom: 1px solid var(--border); z-index: 30; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.brand { font-weight: 800; letter-spacing: .2px; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.brand__accent { color: var(--brand); }
.nav__links { display: none; gap: 14px; }
.nav__links a, .mobile-menu a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; }
.nav__links a:hover, .mobile-menu a:hover { color: var(--text); background: color-mix(in oklab, var(--border) 35%, transparent); }
.nav__links .is-active { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.mobile-menu-btn { display: inline-flex; }
.mobile-menu { display: none; flex-direction: column; gap: 6px; padding: 10px 4%; border-bottom: 1px solid var(--border); background: var(--overlay); }
@media (min-width: 900px) {
  .nav__links { display: flex; }
  .mobile-menu-btn, .mobile-menu { display: none !important; }
}

/* Buttons */
.btn { --bgc: var(--accent); --txt: #0b1020; border: 0; padding: 12px 16px; border-radius: 12px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); background: var(--bgc); color: var(--txt); }
.btn:hover { filter: brightness(1.05); }
.btn--primary { --bgc: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%); }
.btn--outline { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn--ghost { background: transparent; color: var(--muted); border: 1px dashed var(--border); box-shadow: none; }
.btn--small { padding: 8px 12px; border-radius: 10px; font-weight: 600; }
/* NEW: danger button */
.btn--danger { --bgc: var(--danger); --txt: #ffffff; }

/* Inputs */
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid color-mix(in oklab, var(--accent) 40%, transparent); border-color: var(--accent); }
.input-wrap { position: relative; }
.input-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: .7; }

/* Chips */
.chip { padding: 8px 12px; border: 1px solid var(--border); border-radius: 18px; cursor: pointer; color: var(--muted); background: transparent; }
.chip.is-active { color: var(--text); border-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); }

/* Segmented control */
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.segmented__btn { border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.segmented__btn.is-active { color: var(--text); background: color-mix(in oklab, var(--accent) 12%, transparent); }

/* Cards + grid */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.grid--tiles { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Listing tiles */
.tile { padding: 14px; border-radius: var(--radius); background: var(--surface); border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.tile:hover { transform: translateY(-2px); }
.tile__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.badge { font-size: .78rem; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.tile__title { font-weight: 700; }
.tile__meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .92rem; }
.tile--offer { border-color: color-mix(in oklab, var(--green) 70%, transparent); }
.tile--seek  { border-color: color-mix(in oklab, var(--blue) 70%, transparent); }

/* Hero */
.hero { display: grid; gap: 18px; grid-template-columns: 1fr; padding: 28px 0 24px; }
.hero__content { display: grid; gap: 12px; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero__stats { display: grid; grid-auto-flow: column; gap: 18px; width: max-content; margin-top: 8px; }
.hero__stats div { display: grid; gap: 2px; justify-items: start; }
.hero__card-inner { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
@media (min-width: 980px) {
  .hero { grid-template-columns: 1.2fr .8fr; align-items: center; }
}

/* Filters */
.filters { margin: 14px 0 10px; display: grid; gap: 12px; }
.filters__row { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .filters__row { grid-template-columns: auto 1fr; align-items: center; }
}
.filters__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filters__meta { display: flex; justify-content: space-between; align-items: center; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 100; }
.modal { width: min(720px, 94%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.modal__body { padding: 16px; display: grid; gap: 14px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.modal__close { background: transparent; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }

/* Lister snippet */
.lister { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; color: #0a0f1f; font-weight: 800; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.2rem; }
.stars { color: gold; letter-spacing: 1px; }

/* Footer */
.footer { margin-top: 36px; border-top: 1px solid var(--border); background: var(--overlay); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }

/* Utility */
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.profile-row { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Switch (settings) */
.switch { position: relative; display: inline-block; width: 54px; height: 32px; }
.switch input { display:none; }
.slider { position:absolute; cursor:pointer; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; }
.slider:before { position:absolute; content:""; height:24px; width:24px; left:4px; bottom:4px; background:white; border-radius:50%; transition:.2s; }
input:checked + .slider { background: var(--accent); }
input:checked + .slider:before { transform: translateX(22px); }

/* Auth Area mini styles */
.user-bubble { display: inline-flex; align-items:center; gap: 8px; padding: 6px 10px; border:1px solid var(--border); border-radius: 999px; background: var(--surface); }
.user-bubble .avatar { width: 28px; height: 28px; }

/* Settings layout */
.settings-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 20px; }
.settings-grid .actions { display: flex; justify-content: flex-end; }
@media (min-width: 980px) {
  .settings-grid { grid-template-columns: 1.1fr .9fr .8fr; }
}

/* Links */
a.link { color: var(--accent); text-decoration: none; }
a.link:hover { text-decoration: underline; }

/* ------------------------------
   Compact mobile scale
---------------------------------*/
@media (max-width: 480px) {
  :root { --radius: 14px; --radius-sm: 10px; }
  body { line-height: 1.45; }
  .brand { font-size: 1rem; }
  .nav__inner { padding: 8px 0; }
  .mobile-menu { padding: 8px 4%; }
  h1 { font-size: clamp(1.35rem, 7vw, 1.8rem); }
  h2 { font-size: clamp(1.0rem, 5vw, 1.2rem); }
  h3 { font-size: 0.98rem; }
  .btn { padding: 10px 12px; border-radius: 10px; }
  .btn--small { padding: 6px 10px; }
  .input, .select, .textarea { padding: 10px 12px; }
  .hero { padding: 16px 0; gap: 14px; }
  .hero__stats { grid-auto-flow: row; gap: 10px; }
  .card { padding: 14px; }
  .tile { padding: 12px; }
  .tile__meta { font-size: .88rem; }
  .grid--tiles { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .footer__inner { padding: 10px 0; }
}

/* Even narrower devices */
@media (max-width: 360px) {
  h1 { font-size: clamp(1.2rem, 7.5vw, 1.5rem); }
  .grid--tiles { grid-template-columns: 1fr; }
}
.btn--success {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.btn--success[disabled] { opacity: .85; cursor: default; }
/* Notification bell dot */
.icon-btn.bell {
  position: relative;
  font-size: 18px;
}
.icon-btn.bell .dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  background: #ef4444; /* red-500 */
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg); /* ring to separate from bg */
}
