/* ZenithMatch — design tokens & base */

:root {
  /* Surfaces */
  --bg: #0B0908;
  --bg-elev: #15110E;
  --bg-elev-2: #1E1814;
  --bg-deeper: #050403;
  --bg-card: #110E0C;

  /* Borders */
  --border: rgba(245, 235, 220, 0.06);
  --border-strong: rgba(245, 235, 220, 0.12);
  --border-bright: rgba(245, 235, 220, 0.22);

  /* Text */
  --text-primary: #F2EBE0;
  --text-secondary: #A29A8E;
  --text-tertiary: #8A8075;  /* 4.8–5.1:1 pe fundalurile închise (WCAG AA) */
  --text-quaternary: #443C34;

  /* Accent (wine — default) */
  --accent: #B23A48;
  --accent-hover: #C84456;
  --accent-soft: rgba(178, 58, 72, 0.14);
  --accent-glow: rgba(178, 58, 72, 0.42);
  --accent-text: #E89099;

  /* States */
  --success: #7BA88F;
  --online: #7BA88F;
  --warn: #D9A05B;

  /* Fonts */
  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Shadows */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 24px 60px -30px rgba(0,0,0,0.8);
  --shadow-elev: 0 30px 80px -40px rgba(0,0,0,0.9), 0 1px 0 rgba(255,255,255,0.04) inset;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Subtle grain overlay (toggleable) */
body.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Background ambient gradients */
.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(80% 60% at 20% -10%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(50% 40% at 95% 20%, rgba(217, 160, 91, 0.06), transparent 70%),
    radial-gradient(60% 50% at 50% 110%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 70%);
}

/* Typography helpers */
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.display-i { font-family: var(--font-display); font-style: italic; font-weight: 500; letter-spacing: -0.005em; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.muted { color: var(--text-secondary); }
.dim { color: var(--text-tertiary); }

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--border-bright);
  background: rgba(255,255,255,0.02);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 12px 40px -16px var(--accent-glow), 0 1px 0 rgba(255,255,255,0.1) inset;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-ghost {
  border-color: transparent;
  padding: 10px 14px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 14px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); }
.btn-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0;
}
.btn-icon:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  position: relative;
}
.card-warm {
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 8%, var(--bg-card)) 0%, var(--bg-card) 50%);
  border: 1px solid var(--border-strong);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.02);
}
.badge-accent {
  color: var(--accent-text);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.badge-vip {
  color: #E8C77A;
  border-color: rgba(217, 191, 122, 0.4);
  background: rgba(217, 191, 122, 0.08);
}
.badge-elite {
  color: #E89099;
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.badge-online::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 8px var(--online);
}

/* Dot separator */
.dot-sep::before {
  content: "·";
  margin: 0 8px;
  color: var(--text-quaternary);
}

/* Inputs */
.input {
  font-family: var(--font-body);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  transition: border 0.18s ease;
}
.input:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--accent) 60%, var(--border-strong));
}
.input::placeholder { color: var(--text-tertiary); }

/* Select elements — remove native appearance and style consistently */
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6258' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
select.input option {
  background: #15110E;
  color: var(--text-primary);
}

/* Divider */
.div-h {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
  border: none;
  margin: 24px 0;
}

/* Avatar placeholder system */
.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar svg { width: 100%; height: 100%; display: block; }

/* Photo placeholder */
.photo-placeholder {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}
.photo-placeholder svg { display: block; width: 100%; height: 100%; }

/* App shell */
.app {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}
.container-wide {
  max-width: 1480px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}
@media (max-width: 1100px) {
  .container, .container-wide { padding-left: 24px; padding-right: 24px; }
}

/* Top nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}
@media (max-width: 1180px) {
  .topnav-inner { gap: 10px; }
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.brand-logo { height: 58px; width: auto; display: block; }
@media (max-width: 900px) { .brand-logo { height: 44px; } }
.brand .z { color: var(--text-primary); font-weight: 500; }
.brand .m { color: var(--accent-text); font-style: italic; font-weight: 500; }
.brand .dot {
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 6px 4px;
  align-self: center;
  display: inline-block;
}
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 4px;
}
.nav-tab {
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--r-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  background: transparent;
  border: none;
  font-family: inherit;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .nav-tab { padding: 9px 12px; font-size: 12.5px; }
  .nav-tab .label { display: none; }
  .nav-tab.active .label { display: inline; }
}
@media (max-width: 900px) {
  .nav-tab .label { display: none; }
  .nav-tab.active .label { display: none; }
  .nav-tab { padding: 9px 11px; }
}
.nav-tab:hover { color: var(--text-primary); }
.nav-tab.active {
  background: rgba(245, 235, 220, 0.06);
  color: var(--text-primary);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 0 0 1px var(--border-strong);
}
.nav-tab .pip {
  display: inline-flex;
  min-width: 18px; height: 18px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  align-items: center; justify-content: center;
  font-family: var(--font-mono);
}

/* User chip in nav */
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: border 0.18s ease;
}
.user-chip:hover { border-color: var(--border-bright); }
.user-chip .name { font-size: 13px; line-height: 1.1; }
.user-chip .bal {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-text);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.user-chip .bal::before {
  content: "";
  width: 5px; height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
  display: inline-block;
}
@media (max-width: 1180px) {
  .user-chip { padding: 6px 6px 6px 12px; }
  .user-chip .name { font-size: 12px; }
  .user-chip .bal { font-size: 9.5px; }
}
@media (max-width: 900px) {
  .user-chip .col-text { display: none; }
}

/* Animations — keep gentle transform-only enter; opacity stays 1 so the
   element is always visible (html-to-image clones don't reset the animation
   correctly if we tie it to opacity). */
@keyframes fadeUp {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.pulse { animation: pulse 2s ease-in-out infinite; }

/* Page header */
.page-head { padding: 56px 0 28px; }
.page-head h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 56px;
  line-height: 1.05;
  margin: 8px 0 12px;
  letter-spacing: -0.015em;
}
.page-head .sub {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 540px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-bright); background-clip: padding-box; border: 3px solid transparent; }

/* Selection */
::selection { background: var(--accent-soft); color: var(--text-primary); }

/* Utility */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; margin: 0; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.center { display: flex; align-items: center; justify-content: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.grow { flex-grow: 1; }
.text-center { text-align: center; }

/* ── Layout responsive pentru grile definite inline ─────────────────────────
   Multe pagini își setează coloanele în atributul style (ex. „260px 1fr"),
   pe care un @media obișnuit nu îl poate suprascrie — de aici !important.
   .zm-stack    → o singură coloană pe telefon (sidebar deasupra conținutului)
   .zm-stack-2  → maxim 2 coloane pe telefon (galerii, statistici)            */
.zm-stack > *, .zm-stack-2 > * { min-width: 0; }
@media (max-width: 767px) {
    .zm-stack   { grid-template-columns: 1fr !important; }
    .zm-stack-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .zm-stack .sticky-sidebar, .zm-stack > [style*="sticky"] { position: static !important; }
}
@media (max-width: 767px) {
    /* Membri: 2 carduri pe rând — numele și butoanele trebuie să încapă în ~165px */
    .zm-members-grid { gap: 12px !important; }
    .zm-members-grid [style*="font-size:26px"] { font-size: 19px !important; }
}
@media (max-width: 767px) {
    .zm-card-actions { padding: 10px !important; gap: 6px !important; }
    .zm-card-actions > * { flex-shrink: 0; }
    .zm-card-actions > a.btn { flex: 1 1 0 !important; min-width: 0; padding: 10px 0 !important; }
    .zm-card-label { display: none; }
}
