/* ═══════════════════════════════════════════════════════════
   ECHO – Shared Dark UI System
   Gemeinsame Tokens, Bottom-Nav, Page-Header und Cards
   für alle User-seitigen Seiten (außer index.html)
═══════════════════════════════════════════════════════════ */

/* ── Design-Tokens ──────────────────────────────────────── */
:root {
  --ec-bg:        #08080f;
  --ec-surface:   rgba(255,255,255,0.045);
  --ec-surface2:  rgba(255,255,255,0.07);
  --ec-brd:       rgba(255,255,255,0.08);
  --ec-brd2:      rgba(255,255,255,0.13);
  --ec-accent:    #c084fc;
  --ec-accent2:   #a855f7;
  --ec-accent-g:  linear-gradient(135deg,#7c3aed,#a855f7 55%,#c084fc);
  --ec-glow:      rgba(192,132,252,0.38);
  --ec-txt:       #f3f0ff;
  --ec-mute:      rgba(255,255,255,0.42);
  --ec-mute2:     rgba(255,255,255,0.25);
  --ec-nav-h:     68px;
  --ec-hd-h:      160px;
  --ec-r:         18px;
  --ec-r-sm:      12px;
  --ec-r-lg:      24px;
}

/* ── Basis ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.ec-page {
  min-height: 100dvh;
  background: var(--ec-bg);
  color: var(--ec-txt);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--ec-nav-h);
}

/* ── Hintergrund-Atmosphäre ─────────────────────────────── */
.ec-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 12% 8%,  rgba(120,40,220,0.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 88% 90%,  rgba(192,60,80,0.08)  0%, transparent 52%);
  pointer-events: none;
}
.ec-page > * { position: relative; z-index: 1; }

/* ══ TOP-HEADER ═════════════════════════════════════════ */
.ec-hd {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--ec-hd-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px;
  background: rgba(8,8,15,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ec-brd);
}

.ec-hd-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  /* fallback for text logos */
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #fff;
  text-transform: uppercase;
  user-select: none;
}
.ec-hd-logo img {
  width: 240px;
  height: 160px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter:
    drop-shadow(0 0 14px rgba(243,178,149,0.28))
    drop-shadow(0 0 28px rgba(169,120,255,0.16));
}
.ec-hd-logo span { color: var(--ec-accent); font-size: 0.82em; }

.ec-hd-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ec-hd-r {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Coins-Badge */
.ec-coins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(192,132,252,0.11));
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}
.ec-coins:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(192,132,252,0.18));
  border-color: rgba(192,132,252,0.34);
  box-shadow: 0 0 20px rgba(192,132,252,0.20), inset 0 1px 0 rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.ec-coins svg { flex-shrink: 0; }
.ec-coins-spark {
  color: var(--ec-accent);
  text-shadow: 0 0 12px var(--ec-glow);
}
.ec-coins-plus {
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(192,132,252,0.18);
  color: #fff;
  font-size: 0.82rem;
  line-height: 1;
}

/* Avatar-Button */
.ec-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(192,132,252,0.32);
  cursor: pointer;
  background: none;
  padding: 0;
  transition: border-color 0.18s, box-shadow 0.18s;
  flex-shrink: 0;
}
.ec-av:hover {
  border-color: var(--ec-accent);
  box-shadow: 0 0 12px rgba(192,132,252,0.28);
}
.ec-av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ec-user-area {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.ec-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px 2px 2px;
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.66);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.ec-user-trigger:hover,
.ec-user-trigger[aria-expanded="true"] {
  background: rgba(255,255,255,0.09);
  border-color: rgba(192,132,252,0.28);
  box-shadow: 0 0 18px rgba(192,132,252,0.18);
  transform: translateY(-1px);
}
.ec-user-trigger .ec-av {
  width: 32px;
  height: 32px;
  border-width: 1px;
  box-shadow: 0 0 14px rgba(192,132,252,0.18);
}
.ec-user-caret {
  font-size: 0.52rem;
  color: rgba(255,255,255,0.58);
  transform: translateY(1px);
  transition: transform 0.18s, color 0.18s;
}
.ec-user-trigger[aria-expanded="true"] .ec-user-caret {
  transform: rotate(180deg) translateY(-1px);
  color: var(--ec-accent);
}
.ec-user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(230px, calc(100vw - 26px));
  z-index: 310;
  padding: 8px;
  border-radius: 18px;
  background: rgba(12,10,20,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 70px rgba(0,0,0,0.46), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.ec-user-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ec-user-menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 650;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ec-user-menu a:hover {
  background: rgba(192,132,252,0.10);
  color: #fff;
  transform: translateX(2px);
}
.ec-menu-sep {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 5px 4px;
}
.ec-logout-item {
  color: rgba(255, 95, 95, 0.84) !important;
  gap: 9px !important;
}
.ec-logout-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.ec-logout-item:hover {
  background: rgba(255, 80, 80, 0.10) !important;
  color: rgb(255, 90, 90) !important;
  transform: translateX(2px);
}

/* Zurück-Chevron */
.ec-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ec-surface);
  border: 1px solid var(--ec-brd);
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ec-back:hover { background: var(--ec-surface2); color: #fff; }
.ec-back svg { width: 16px; height: 16px; }

/* ══ BOTTOM-NAV ═════════════════════════════════════════ */
.ec-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--ec-nav-h);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: linear-gradient(180deg, rgba(12,10,21,0.72), rgba(6,6,14,0.96));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255,255,255,0.07);
  z-index: 200;
  padding: 0 clamp(14px, 5vw, 48px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.ec-ni {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 3px 5px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  user-select: none;
}
.ec-ni svg {
  width: 22px; height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ec-ni span {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1;
}
.ec-ni:hover { color: rgba(255,255,255,0.62); }
.ec-ni-alert {
  color: rgba(255,255,255,0.82);
}
.ec-ni-alert svg {
  filter: drop-shadow(0 0 8px rgba(239,68,68,0.42));
}

/* Aktiver Tab */
.ec-ni-on {
  color: #fff !important;
}
.ec-ni-on svg {
  filter: drop-shadow(0 0 5px rgba(192,132,252,0.5));
}
.ec-ni-on::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--ec-accent);
  box-shadow: 0 -1px 8px var(--ec-glow);
}

/* Unread-Badge */
.ec-badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 22px);
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid rgba(6,6,14,0.97);
  box-shadow: 0 0 12px rgba(239,68,68,0.52);
}

.ec-service-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.28s;
}
.ec-service-overlay.is-open {
  background: rgba(0,0,0,0.54);
  pointer-events: auto;
}
.ec-service-panel {
  position: fixed;
  left: auto;
  right: clamp(12px, 5vw, 48px);
  bottom: calc(var(--ec-nav-h) + 12px);
  z-index: 195;
  width: min(220px, calc(100vw - 24px));
  margin: 0;
  border-radius: 22px;
  background: rgba(12,10,20,0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 -18px 70px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  padding: 10px;
  transform: translateY(calc(100% + var(--ec-nav-h) + 28px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.34s cubic-bezier(0.32,0.72,0,1);
}
.ec-service-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ec-service-handle {
  width: 34px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,0.18);
  margin: 0 auto 12px;
}
.ec-service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
}
.ec-service-head span {
  font-size: 0.70rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.36);
}
.ec-service-head button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.62);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.ec-service-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ec-service-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 13px;
  color: rgba(255,255,255,0.76);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 650;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ec-service-links a:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  transform: translateX(2px);
}

@media (max-width: 600px) {
  :root { --ec-hd-h: 120px; }
  .ec-hd-logo img { width: 180px; height: 120px; }
}
@media (max-width: 420px) {
  :root { --ec-hd-h: 100px; }
  .ec-hd { padding: 0 12px; }
  .ec-hd-logo img { width: 150px; height: 100px; }
  .ec-hd-r { gap: 6px; }
  .ec-user-area { gap: 6px; }
  .ec-coins { padding: 6px 9px; font-size: 0.78rem; }
  .ec-user-trigger { padding-right: 5px; }
  .ec-user-trigger .ec-av { width: 30px; height: 30px; }
}

/* ══ SEITENINHALT ════════════════════════════════════════ */
.ec-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 18px 16px;
}
@media (min-width: 700px) {
  .ec-content { padding: 32px 32px 20px; }
}

/* ── Seitentitel ──────────────────────────────────────── */
.ec-page-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.ec-page-sub {
  font-size: 0.88rem;
  color: var(--ec-mute);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ── Cards / Listen-Einträge ─────────────────────────── */
.ec-card {
  background: var(--ec-surface);
  border: 1px solid var(--ec-brd);
  border-radius: var(--ec-r);
  padding: 16px;
  transition: all 0.2s;
}
.ec-card:hover {
  background: var(--ec-surface2);
  border-color: rgba(192,132,252,0.2);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3), 0 0 0 1px rgba(192,132,252,0.08);
}

/* ── Trennlinie ─────────────────────────────────────── */
.ec-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ec-brd) 30%, var(--ec-brd) 70%, transparent);
  margin: 20px 0;
}

/* ── Buttons ─────────────────────────────────────────── */
.ec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  white-space: nowrap;
}
.ec-btn-primary {
  background: var(--ec-accent-g);
  color: #fff;
  box-shadow: 0 4px 16px rgba(192,132,252,0.28);
}
.ec-btn-primary:hover {
  box-shadow: 0 6px 24px rgba(192,132,252,0.42);
  transform: translateY(-1px);
}
.ec-btn-ghost {
  background: var(--ec-surface);
  border: 1px solid var(--ec-brd2);
  color: rgba(255,255,255,0.72);
}
.ec-btn-ghost:hover {
  background: var(--ec-surface2);
  color: #fff;
}

/* ── Form-Elemente ──────────────────────────────────── */
.ec-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--ec-brd2);
  border-radius: var(--ec-r-sm);
  padding: 11px 14px;
  color: var(--ec-txt);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ec-input:focus {
  border-color: rgba(192,132,252,0.45);
  box-shadow: 0 0 0 3px rgba(192,132,252,0.08);
}
.ec-input::placeholder { color: var(--ec-mute2); }

.ec-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.52);
  margin-bottom: 5px;
}
.ec-field { margin-bottom: 14px; }

/* ── Leer-Zustand ────────────────────────────────────── */
.ec-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ec-mute);
  font-size: 0.9rem;
}
.ec-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.4;
}

/* ── Responsive Helpers ──────────────────────────────── */
@media (max-width: 480px) {
  .ec-content { padding: 16px 14px 12px; }
  .ec-service-panel {
    right: 12px;
    width: min(220px, calc(100vw - 24px));
  }
}
