/* ═══════════════════════════════════════════════════════════
   BRITCHAT SHARED STYLES
   Used by: index.html, chat.html, admin.html
═══════════════════════════════════════════════════════════ */

:root {
  --bg:       #0a0a0f;
  --card:     #14141b;
  --card-hi:  #1e1e2a;
  --surface:  #1a1a24;
  --surface2: #23232e;
  --border:   #2a2a38;
  --border-hi:#3a3a48;
  --text:     #ffffff;
  --text2:    #b8b8c8;
  --text3:    #6e6e7e;

  --red:      #C8102E;
  --red-hi:   #e11d3d;
  --red-dim:  rgba(200,16,46,.12);
  --gold:     #e8c060;
  --green:    #22c55e;
  --amber:    #f59e0b;
  --blue:     #3b82f6;

  --shadow:   0 6px 24px rgba(0,0,0,.35);
  --shadow-hi:0 10px 40px rgba(200,16,46,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: 70px; }

h1,h2,h3,h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  letter-spacing: -.01em;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
a { color: var(--red); text-decoration: none; }

/* ─── HEADER ────────────────────────────── */
#header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}

#me-header-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--surface2); color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  border: 2px solid var(--red);
  cursor: pointer;
}
#me-header-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

#header-title {
  flex: 1; min-width: 0;
}
#header-title .brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 900;
  line-height: 1;
}
#header-title .brand .chat { color: var(--red); }
#header-title .tagline {
  font-size: 10px; color: var(--text3);
  letter-spacing: .02em; margin-top: 2px;
  text-transform: uppercase; font-weight: 600;
}

#header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); position: relative;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn .badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  padding: 0 5px; display: none;
  align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.icon-btn.has-badge .badge { display: flex; }

/* ─── BOTTOM NAV ────────────────────────── */
#nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.nav-btn {
  flex: 1; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center;
  color: var(--text3); font-size: 10px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  gap: 3px; position: relative;
  transition: color .15s;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--red); }
.nav-btn .badge {
  position: absolute; top: 4px; right: 30%;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  padding: 0 4px; display: none;
  align-items: center; justify-content: center;
}
.nav-btn.has-badge .badge { display: flex; }

/* ─── PAGES ─────────────────────────────── */
.page { display: none; padding: 16px; max-width: 900px; margin: 0 auto; }
.page.active { display: block; }
.page.full { padding: 0; max-width: none; }

/* ─── HERO SECTION (HOME PAGE) ──────────── */
.hero {
  padding: 24px 16px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(200,16,46,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(232,192,96,.08) 0%, transparent 50%);
  border-bottom: 1px solid var(--border);
  margin: 0 -16px 16px;
}
.hero h1 {
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 8px;
}
.hero h1 .red { color: var(--red); }
.hero .tagline {
  color: var(--text2);
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 16px;
}

/* Quick action buttons on home */
.hub-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}
.hub-btn {
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  transition: all .15s;
  color: var(--text);
}
.hub-btn:hover {
  background: var(--card-hi);
  border-color: var(--border-hi);
  transform: translateY(-1px);
}
.hub-btn .icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--red-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.hub-btn .info { flex: 1; min-width: 0; }
.hub-btn .name {
  font-weight: 700; font-size: 14px;
  color: var(--text);
}
.hub-btn .desc {
  font-size: 12px; color: var(--text3);
  margin-top: 2px;
}

/* ─── SECTION HEADERS ───────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 12px;
}
.section-header h2 {
  font-size: 1.35rem;
}
.section-header a {
  font-size: 13px; color: var(--red); font-weight: 600;
}

/* ─── SEARCH BAR ────────────────────────── */
.search-bar {
  display: flex; gap: 10px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px;
  align-items: center;
}
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14px;
}
.search-bar svg { color: var(--text3); width: 18px; height: 18px; }

/* ─── FILTER CHIPS ──────────────────────── */
.filter-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 8px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 50px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  white-space: nowrap; flex-shrink: 0;
  transition: all .15s;
}
.filter-chip.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ─── MEMBERS GRID ──────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  position: relative; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.card-photo {
  aspect-ratio: 3/4;
  background: var(--surface2);
  overflow: hidden; position: relative;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card-photo .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--text3);
  background: var(--surface2);
  font-weight: 800;
}
.card-online-dot {
  position: absolute; top: 8px; right: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--card);
  display: none;
}
.card-online-dot { position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--card); display: none; }
.card-online-dot.online  { background: var(--green); display: block; box-shadow: 0 0 8px rgba(34,197,94,.5); }
.card-online-dot.real    { background: var(--red);   display: block; }
.card-online-dot.demo    { background: var(--amber); display: block; }
.card-online-dot.online-demo { background: var(--green); display: block; box-shadow: 0 0 8px rgba(34,197,94,.5); }

/* Yellow demo marker - shown BESIDE the online dot for online demo users */
.card-demo-marker {
  position: absolute; top: 8px; right: 24px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  z-index: 2;
}
.card-dating-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(200,16,46,.9); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  backdrop-filter: blur(4px);
}
.card-info { padding: 10px 12px; }
.card-name {
  font-weight: 700; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-meta {
  font-size: 12px; color: var(--text3); margin-top: 2px;
}

/* ─── FEED CARDS (Just For You) ─────────── */
.feed-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  transition: border-color .15s;
}
.feed-card:hover { border-color: var(--border-hi); }
.feed-card .fc-header {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.feed-card .fc-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.feed-card .fc-tag {
  flex: 1;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 700;
  color: var(--text3);
}
.feed-card .fc-body { padding: 14px; }
.feed-card .fc-title {
  font-family: 'Playfair Display', serif;
  font-weight: 800; font-size: 1.2rem;
  margin-bottom: 6px;
  line-height: 1.2;
}
.feed-card .fc-text {
  color: var(--text2); font-size: 14px; line-height: 1.55;
}
.feed-card .fc-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--surface2);
}

/* Feed card colour variants */
.feed-card.food     .fc-icon { background: rgba(245,158,11,.15); color: var(--amber); }
.feed-card.landmark .fc-icon { background: rgba(59,130,246,.15); color: var(--blue); }
.feed-card.dino     .fc-icon { background: rgba(34,197,94,.15);  color: var(--green); }
.feed-card.quote    .fc-icon { background: rgba(232,192,96,.15); color: var(--gold); }
.feed-card.almanac  .fc-icon { background: var(--red-dim);        color: var(--red); }
.feed-card.tv       .fc-icon { background: rgba(139,92,246,.15); color: #a78bfa; }
.feed-card.fact     .fc-icon { background: rgba(34,197,94,.15);  color: var(--green); }

/* Quote card special styling */
.feed-card.quote .fc-title {
  font-style: italic;
  font-size: 1.4rem;
}
.feed-card.quote .fc-attribution {
  color: var(--gold);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
}

/* ─── EMPTY STATES ──────────────────────── */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text3);
}
.empty .icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty h3 { color: var(--text); margin-bottom: 8px; font-family: 'Playfair Display', serif; }
.empty p { font-size: 14px; max-width: 300px; margin: 0 auto; }

/* ─── BUTTONS ───────────────────────────── */
.btn-primary {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--red) 0%, #a00d24 100%);
  color: #fff; font-weight: 700; font-size: 15px;
  border-radius: 12px; letter-spacing: .02em;
  transition: transform .1s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(200,16,46,.35);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(200,16,46,.5); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  padding: 12px 20px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  font-weight: 600;
}
.btn-secondary:hover { background: var(--surface2); }

/* ─── FORMS ─────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--red);
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ─── TOAST ─────────────────────────────── */
#toast-container {
  position: fixed; top: 80px; left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border-hi);
  border-radius: 50px;
  box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600;
  max-width: 90vw;
  animation: toastIn .3s ease-out, toastOut .3s ease-in 3s forwards;
}
@keyframes toastIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateY(-20px); opacity: 0; }
}

/* ─── SPINNER ───────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── LOADING SCREEN ────────────────────── */
#loading {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}

/* ─── MODALS ────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
@media (min-width: 600px) { .modal-overlay { align-items: center; } }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%; max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn .3s ease-out;
}
@keyframes modalIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0;
  background: var(--card);
  z-index: 2;
}
.modal-title { font-size: 1.2rem; font-family: 'Playfair Display', serif; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); color: var(--text2);
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
}

/* ─── UTILITIES ─────────────────────────── */
.hidden { display: none !important; }
.text-red { color: var(--red); }
.text-center { text-align: center; }
.mb-16 { margin-bottom: 16px; }
