/* ══════════════════════════════════════════════════════════
   FachTap · User-Dropdown (Klick auf eigenen Namen im authButton)
   Zeigt: XP · Level · Fortschritt · Badge · Einstellungen · Abmelden
   ══════════════════════════════════════════════════════════ */

/* Container muss position:relative sein damit Dropdown absolut positioniert */
#authButtonContainer {
  position: relative;
}

/* Wenn User eingeloggt ist → Name statt Icon → mehr padding */
#authButton.is-logged-in {
  padding: 0 14px;
  min-width: unset !important;
  width: auto !important;
  max-width: 180px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px !important;
}
#authButton.is-logged-in::after {
  content: '▾';
  margin-left: 6px;
  opacity: 0.6;
  font-size: 10px;
  transition: transform 0.2s ease;
}
#authButton.is-open::after { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 9999;
  width: 288px;
  max-width: calc(100vw - 28px);
  background: linear-gradient(180deg, #16130a 0%, #0d0b06 100%);
  border: 1px solid rgba(212, 160, 23, 0.28);
  border-radius: 16px;
  box-shadow:
    0 24px 60px -10px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  padding: 16px 14px 8px;
  color: #f5e6b8;
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  transform-origin: top right;
  transform: scale(0.96) translateY(-4px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.user-dropdown[hidden] { display: none; }
.user-dropdown.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* ── Header-Zone (Name + Level-Chip + Fortschritt) ─── */
.user-dd__head {
  padding: 2px 6px 12px;
}
.user-dd__name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  color: #f9ecc3;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dd__level-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.user-dd__level-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(212,160,23,0.18), rgba(212,160,23,0.06));
  border: 1px solid rgba(212, 160, 23, 0.4);
  font-family: 'Cormorant Garamond', Georgia, serif;
}
.user-dd__level-num {
  font-weight: 500;
  font-size: 16px;
  color: #f5e6b8;
  line-height: 1;
}
.user-dd__level-lbl {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245, 230, 184, 0.5);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}
.user-dd__xp {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #D4A017;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}
.user-dd__progress {
  height: 3px;
  background: rgba(245, 230, 184, 0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.user-dd__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8a6800, #D4A017 55%, #f5e6b8);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(.4,.0,.2,1);
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.45);
}
.user-dd__progress-note {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  color: rgba(245, 230, 184, 0.5);
  letter-spacing: 0.2px;
}

/* ── Badge-Karte (falls Kunde eins hat) ─── */
.user-dd__badge {
  margin-top: 12px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(212, 160, 23, 0.06);
  border: 1px solid rgba(212, 160, 23, 0.2);
}
.user-dd__badge[hidden] { display: none; }
.user-dd__badge-icon {
  color: #D4A017;
  font-size: 16px;
  line-height: 1;
  padding-top: 1px;
  text-shadow: 0 0 8px rgba(212, 160, 23, 0.5);
}
.user-dd__badge-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  font-weight: 500;
  color: #f9ecc3;
  line-height: 1.15;
  margin-bottom: 2px;
}
.user-dd__badge-hint {
  font-size: 10.5px;
  color: rgba(245, 230, 184, 0.55);
  line-height: 1.35;
}

/* ── Trennlinie ─── */
.user-dd__divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 160, 23, 0.2), transparent);
  margin: 8px 0 6px;
}

/* ── Menu-Items ─── */
.user-dd__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  color: rgba(245, 230, 184, 0.86);
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.user-dd__item:hover,
.user-dd__item:focus-visible {
  background: rgba(212, 160, 23, 0.08);
  color: #f5e6b8;
  outline: none;
}
.user-dd__item:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.45);
}
.user-dd__item-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(212, 160, 23, 0.08);
  color: #D4A017;
  flex-shrink: 0;
}
.user-dd__item--danger { color: rgba(245, 230, 184, 0.7); }
.user-dd__item--danger:hover {
  background: rgba(220, 90, 90, 0.1);
  color: #f0b8b8;
}
.user-dd__item--danger:hover .user-dd__item-icon {
  background: rgba(220, 90, 90, 0.12);
  color: #e8a0a0;
}

/* ══════════════════════════════════════════════════════════
   FAVORIT-BUTTON (Herz im Top-Right-Bereich)
   Matcht #shareBtn/#qrBtn: 40×40 Kreis, dunkler BG, gold-getönter Border.
   Default: dezent (halbtransparentes Gold — wirkt "grau"). Klick: voll-gold + gefüllt.
   ══════════════════════════════════════════════════════════ */
#favoriteBtn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 8, 4, 0.72);
  border: 1px solid rgba(212, 160, 23, 0.22);
  color: rgba(212, 160, 23, 0.5);       /* dezentes Gold = wirkt grau */
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: background 0.2s ease, color 0.25s ease, transform 0.2s ease;
}
#favoriteBtn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  transition: fill 0.25s ease;
}
#favoriteBtn:hover {
  background: rgba(212, 160, 23, 0.18);
  transform: scale(1.08);
  color: goldenrod;
}
#favoriteBtn.is-favorited {
  color: goldenrod;
}
#favoriteBtn.is-favorited svg {
  fill: currentColor;
  animation: fav-pop 0.35s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes fav-pop {
  0%   { transform: scale(0.85); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
#favoriteBtn.is-just-toggled::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(212, 160, 23, 0.35);
  animation: fav-ring 0.6s ease-out;
  pointer-events: none;
}
@keyframes fav-ring {
  0%   { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   FAVORITEN-SEKTION IM DROPDOWN
   ══════════════════════════════════════════════════════════ */
.user-dd__favorites {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 160, 23, 0.1);
}
.user-dd__favorites[hidden] { display: none; }
.user-dd__favorites-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245, 230, 184, 0.5);
  margin: 0 0 8px 6px;
  display: flex; align-items: center; gap: 6px;
}
.user-dd__favorites-title::before {
  content: '♥';
  color: #e74c6f;
  font-style: normal;
  font-size: 13px;
}
.user-dd__favorites-list {
  display: grid; gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  padding: 0 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,160,23,0.25) transparent;
}
.user-dd__favorites-list::-webkit-scrollbar { width: 4px; }
.user-dd__favorites-list::-webkit-scrollbar-thumb {
  background: rgba(212, 160, 23, 0.25);
  border-radius: 2px;
}
.user-dd__fav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(245, 230, 184, 0.82);
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  font-size: 12.5px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.user-dd__fav-item:hover {
  background: rgba(212, 160, 23, 0.08);
  color: #f5e6b8;
}
.user-dd__fav-item-heart {
  color: #e74c6f;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}
.user-dd__fav-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.user-dd__fav-item-arrow {
  color: rgba(245, 230, 184, 0.35);
  font-size: 10px;
  transition: transform 0.15s ease, color 0.15s ease;
}
.user-dd__fav-item:hover .user-dd__fav-item-arrow {
  color: #D4A017;
  transform: translateX(2px);
}
.user-dd__fav-empty {
  padding: 12px 10px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: rgba(245, 230, 184, 0.4);
  text-align: center;
}

/* Mobile: leicht enger */
@media (max-width: 480px) {
  .user-dropdown { width: 268px; padding: 14px 12px 6px; }
  .user-dd__name { font-size: 18px; }
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .user-dropdown { transition: opacity 0.01ms; }
  .user-dd__progress-fill { transition: none; }
}

/* ── Referral-Übersicht im Dropdown (nur wenn User bereits geteilt hat) ── */
.user-dd__referrals {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(212,160,23,0.08), rgba(20,18,12,0.35));
  border: 1px solid rgba(212,160,23,0.22);
  border-radius: 10px;
  color: rgba(245,230,184,0.9);
}
.user-dd__ref-icon {
  font-size: 1.1rem;
  color: #daa520;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(212,160,23,0.3));
}
.user-dd__ref-body { flex: 1; min-width: 0; }
.user-dd__ref-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  color: rgba(245,230,184,0.92);
  line-height: 1.25;
}
.user-dd__ref-title strong {
  color: #daa520;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
.user-dd__ref-meta {
  font-size: 10.5px;
  color: rgba(245,230,184,0.55);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

/* ── Stempel-Übersicht im Dropdown (Bridge zu mein-konto) ── */
.user-dd__stempel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(212,160,23,0.10), rgba(20,18,12,0.4));
  border: 1px solid rgba(212,160,23,0.28);
  border-radius: 10px;
  color: rgba(245,230,184,0.9);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.user-dd__stempel:hover {
  background: linear-gradient(135deg, rgba(212,160,23,0.18), rgba(20,18,12,0.5));
  border-color: rgba(212,160,23,0.5);
  transform: translateY(-1px);
}
.user-dd__stempel-ico {
  font-size: 1.15rem;
  filter: drop-shadow(0 2px 4px rgba(212,160,23,0.35));
  flex-shrink: 0;
}
.user-dd__stempel-body { flex: 1; min-width: 0; }
.user-dd__stempel-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  color: rgba(245,230,184,0.92);
  line-height: 1.2;
}
.user-dd__stempel-title strong {
  color: #daa520;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}
.user-dd__stempel-meta {
  font-size: 10.5px;
  color: rgba(245,230,184,0.55);
  margin-top: 2px;
  letter-spacing: 0.03em;
}
.user-dd__stempel-arrow {
  color: #daa520;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  transition: transform 160ms ease;
}
.user-dd__stempel:hover .user-dd__stempel-arrow { transform: translateX(3px); }
