/* chat-widget.css - Extracted from index.php */
/* Generated: 2026-02-19 */

/* ============================================================ */
/* chat-widget (originally lines 32254-32874) */
/* ============================================================ */

/* Scroll-Sperre wenn Chat offen - OHNE position:fixed (zerstoert Scroll-Position auf iOS) */
body.chat-scroll-lock {
  overflow: hidden !important;
  touch-action: none;
  -webkit-overflow-scrolling: none;
}
body.chat-scroll-lock > :not(.chat-widget) {
  pointer-events: none;
}

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  max-height: 500px;
  /* Schicker Glasmorphismus-Effekt */
  background: rgba(20, 20, 30, 0.75);
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  display: flex;
  flex-direction: column;
  z-index: 100000;
  font-family: system-ui, -apple-system, sans-serif;
  transition: all 0.3s ease;
}

/* Minimierter Zustand - viel kompakter */
.chat-widget.minimized {
  width: auto;
  min-width: 120px;
  max-height: 42px;
  border-radius: 21px;
  bottom: 60px; /* Niedriger als 90px aber höher als die Buttons */
  right: 15px;
  /* Verhindert Textauswahl, Bild-Drag und Seiten-Scroll auf der Pille */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.chat-widget.minimized img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.chat-widget.minimized .chat-expanded-wrap {
  display: none;
}

.chat-widget.minimized .chat-header {
  border-radius: 21px;
  padding: 8px 14px;
  gap: 6px;
}

.chat-widget.minimized .chat-title {
  font-size: 13px;
}

.chat-widget.minimized .chat-deer-icon {
  width: 20px;
  height: 20px;
}

.chat-widget.minimized .chat-minimize {
  width: 20px;
  height: 20px;
  font-size: 14px;
}

/* Ungelesen-Badge */
.chat-unread-badge {
  background: #ff4081;
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.chat-header {
  padding: 12px 16px;
  /* Schicker Glas-Gradient */
  background: linear-gradient(135deg, 
    rgba(124, 92, 255, 0.25), 
    rgba(156, 122, 255, 0.15));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chat-title {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-deer-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.chat-online {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(74, 222, 128, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
}

.chat-online::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chat-minimize {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s;
}

.chat-minimize:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  max-height: 380px;
  min-height: 200px;
  position: relative;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-welcome {
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.chat-message {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s;
}

.chat-message:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(124, 92, 255, 0.2);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-username {
  font-weight: 600;
  font-size: 12px;
  color: var(--accent, #7c5cff);
}

.chat-admin-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.chat-bot-badge {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.chat-mod-badge {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.chat-member-badge {
  background: linear-gradient(135deg, #f1c40f, #f39c12);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.chat-donor-badge {
  background: linear-gradient(135deg, #00bfff, #0096c8);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.chat-message-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.chat-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

.chat-delete-btn {
  order: 999;
  margin-left: auto;
}

.chat-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.chat-ban-btn:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.4);
  color: #f97316;
}

.chat-unban-btn {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #7c5cff;
}

.chat-unban-btn:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #7c5cff;
}

.chat-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-left: auto;
}

.chat-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  word-wrap: break-word;
  line-height: 1.4;
  white-space: pre-wrap; /* Zeigt Zeilenumbrüche an */
}

.chat-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 25, 0.95);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-radius: 0 0 16px 16px;
  position: relative;
}

/* ── Guest: Auswahl (Gast / Anmelden) ── */
.chat-guest-choice {
  width: 100%;
  display: flex;
  gap: 8px;
}
.chat-choice-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
  text-align: center;
}
.chat-choice-btn.guest {
  background: rgba(255,255,255,0.06);
}
.chat-choice-btn.guest:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}
.chat-choice-btn.login {
  background: linear-gradient(135deg, rgba(124,92,255,0.5), rgba(180,40,255,0.5));
  border-color: rgba(124,92,255,0.3);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-choice-btn.login:hover {
  background: linear-gradient(135deg, rgba(124,92,255,0.7), rgba(180,40,255,0.7));
}

/* Avatar neben Chat-Input */
.chat-footer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  align-self: center;
}

#chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  padding-right: 36px; /* Platz für Emoji-Button */
  color: #fff;
  font-size: 16px; /* Mindestens 16px um Auto-Zoom auf iOS/Mobile zu verhindern */
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  resize: none;
  min-height: 38px;
  max-height: 100px;
  line-height: 1.4;
  overflow-y: auto;
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
}

#chat-emoji-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: all 0.2s;
  line-height: 1;
}

#chat-emoji-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
}

#chat-ai-btn {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: all 0.2s;
  line-height: 1;
}
#chat-ai-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
}

.chat-ai-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: rgba(15,18,30,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 4px;
  z-index: 1000;
  min-width: 180px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.chat-ai-dropdown.active { display: block; }
.chat-ai-dropdown button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}
.chat-ai-dropdown button:hover { background: rgba(167,139,250,0.15); }

/* Emoji Picker */
.chat-emoji-picker {
  display: none;
  position: absolute;
  bottom: 62px; /* Höhe des Footers */
  left: 12px;
  right: 12px;
  background: rgba(20, 20, 35, 0.98);
  border: 1px solid rgba(124, 92, 255, 0.6);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  z-index: 10; /* Relativ zum chat-widget */
  overflow: hidden;
}

.chat-emoji-picker.open {
  display: block;
  animation: emoji-picker-in 0.15s ease-out;
}

@keyframes emoji-picker-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emoji-category {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.emoji-item {
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: transparent;
}

.emoji-item:hover {
  background: rgba(124, 92, 255, 0.3);
  transform: scale(1.15);
}

.emoji-item:active {
  transform: scale(0.95);
  background: rgba(124, 92, 255, 0.5);
}

#chat-input:focus {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

#chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#chat-send {
  background: linear-gradient(135deg, #7c5cff 0%, #9c7aff 100%);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(124, 92, 255, 0.3);
  flex-shrink: 0;
}

#chat-send svg {
  transition: transform 0.2s ease;
}

#chat-send:hover:not(:disabled) {
  background: linear-gradient(135deg, #9c7aff 0%, #b89fff 100%);
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.4);
}

#chat-send:hover:not(:disabled) svg {
  transform: scale(1.1);
}

#chat-send:active:not(:disabled) {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.3);
}

#chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #555 0%, #777 100%);
  box-shadow: none;
}

#chat-send:disabled svg {
  opacity: 0.6;
}

.chat-error {
  text-align: center;
  padding: 8px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 12px;
  margin-bottom: 8px;
  animation: slideIn 0.3s ease;
}

/* Mobile Anpassung */
@media (max-width: 768px) {
  /* Chat geöffnet = Fullscreen */
  .chat-widget:not(.minimized) {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    background: rgba(15, 15, 25, 0.98) !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  
  /* Header: NUR der Header hat runde Ecken oben */
  .chat-widget:not(.minimized) .chat-header {
    border-radius: 20px 20px 0 0 !important;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(80, 60, 180, 0.4)) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    margin: 0 !important;
    border: none !important;
  }
  
  /* Chat minimiert = nur kompakter Header unten rechts */
  .chat-widget.minimized {
    bottom: 15px;
    right: 15px;
    left: auto;
    top: auto;
    width: auto;
    min-width: 110px;
    border-radius: 21px;
  }
  
  .chat-widget.minimized .chat-header {
    padding: 8px 12px;
    gap: 6px;
  }
  
  .chat-widget.minimized .chat-title {
    font-size: 12px;
  }
  
  .chat-widget.minimized .chat-deer-icon {
    width: 18px;
    height: 18px;
  }
  
  /* Button ausblenden auf Mobile - Header ist klickbar */
  .chat-minimize {
    display: none;
  }
  
  /* Chat Body nimmt vollen Raum ein */
  .chat-widget:not(.minimized) .chat-body {
    max-height: none;
    flex: 1;
  }
  
  /* MOBILE PERFORMANCE - nur Animationen aus, nicht alles */
  .chat-message {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================ */
/* Expand-Button */
/* ============================================================ */
.chat-expand-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-expand-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.chat-widget.minimized .chat-expand-btn {
  display: none;
}

/* Expand-Hint Animation */
.chat-expand-hint {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(124, 92, 255, 0.25);
  border: 1px solid rgba(124, 92, 255, 0.5);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  animation: expandHintIn 0.4s ease-out, expandHintPulse 1s 0.4s ease-in-out 2, expandHintOut 0.5s 2.8s ease-in forwards;
}
.chat-expand-hint .hint-arrow {
  font-size: 16px;
  animation: expandArrowBounce 0.6s 0.4s ease-in-out 4;
}
@keyframes expandHintIn {
  from { opacity: 0; transform: translateY(-50%) translateX(-20px); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}
@keyframes expandHintPulse {
  0%, 100% { background: rgba(124, 92, 255, 0.25); }
  50% { background: rgba(124, 92, 255, 0.4); }
}
@keyframes expandHintOut {
  from { opacity: 1; transform: translateY(-50%) translateX(0); }
  to { opacity: 0; transform: translateY(-50%) translateX(-20px); }
}
@keyframes expandArrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

/* Ablegen-Hint oben (analog zu Aufziehen links) */
.chat-close-hint {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(124, 92, 255, 0.25);
  border: 1px solid rgba(124, 92, 255, 0.5);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 99999;
  animation: closeHintIn 0.4s ease-out, expandHintPulse 1s 0.4s ease-in-out 2, closeHintOut 0.5s 2.8s ease-in forwards;
}
.chat-close-hint .hint-arrow-left {
  font-size: 14px;
  animation: closeArrowLeft 0.6s 0.4s ease-in-out infinite;
}
.chat-close-hint .hint-arrow-right {
  font-size: 14px;
  animation: closeArrowRight 0.6s 0.4s ease-in-out infinite;
}
@keyframes closeHintIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes closeHintOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
@keyframes closeArrowLeft {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(-4px); }
}
@keyframes closeArrowRight {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(4px); }
}

/* ============================================================ */
/* Expanded Wrap (normal: nur chat-main-area sichtbar) */
/* ============================================================ */
.chat-expanded-wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.chat-main-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* ============================================================ */
/* Sidebar (hidden by default) */
/* ============================================================ */
.chat-sidebar {
  display: none;
  width: 200px;
  min-width: 200px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  padding: 10px 0;
  flex-direction: column;
}
.chat-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  padding: 0 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Sidebar-Close Button: nur auf Mobile sichtbar */
.chat-sidebar-close {
  display: none;
  background: rgba(124, 92, 255, 0.3);
  border: none;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-sidebar-close:hover {
  background: rgba(124, 92, 255, 0.5);
}
@media (max-width: 768px) {
  .chat-sidebar-close { display: inline-block; }
}

/* "← Chat" Button in Sidebar wenn DM offen ist (Desktop + Mobile) */
.chat-sidebar-back-to-chat {
  background: rgba(124, 92, 255, 0.3);
  border: none;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-sidebar-back-to-chat:hover {
  background: rgba(124, 92, 255, 0.5);
}

/* Sidebar User Kontextmenü (Admin/Mod) */
.chat-sidebar-menu {
  position: fixed;
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px;
  z-index: 999999;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}
.chat-sidebar-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  white-space: nowrap;
}
.chat-sidebar-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}
.chat-sidebar-users {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px;
}
.chat-sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}
.chat-sidebar-user:hover {
  background: rgba(255, 255, 255, 0.08);
}
.chat-sidebar-user img {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-sidebar-user .sidebar-username {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-sidebar-unread {
  background: #ff4081;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: auto;
  flex-shrink: 0;
  animation: badgePulse 2s infinite;
}
.chat-sidebar-role {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1.2;
}
.chat-sidebar-role.role-admin {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}
.chat-sidebar-role.role-moderator {
  background: rgba(34, 197, 94, 0.25);
  color: #22c55e;
}
.chat-sidebar-role.role-donor,
.chat-sidebar-role.role-spender {
  background: rgba(0, 191, 255, 0.25);
  color: #00bfff;
}
.chat-sidebar-role.role-bot {
  background: rgba(167, 139, 250, 0.25);
  color: #a78bfa;
}
.chat-sidebar-role.role-member {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

/* Chat-OP Dots */
.chat-op-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 2px;
}
.chat-op-dot.op-temp {
  background: #888;
  box-shadow: 0 0 4px rgba(136, 136, 136, 0.6);
}
.chat-op-dot.op-perm {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.6);
}

/* DM Typing Indicator (Drei-Punkte-Animation) */
.chat-dm-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}
.chat-dm-typing img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.dm-typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.dm-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted, #888);
  animation: dmTypingBounce 1.4s infinite ease-in-out;
}
.dm-typing-dots span:nth-child(1) { animation-delay: 0s; }
.dm-typing-dots span:nth-child(2) { animation-delay: .2s; }
.dm-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dmTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ============================================================ */
/* Expanded State */
/* ============================================================ */
.chat-widget.expanded {
  width: 740px;
  max-height: 520px;
  bottom: 20px;
  right: 20px;
  border-radius: 16px;
}
.chat-widget.expanded .chat-sidebar {
  display: flex;
}
.chat-widget.expanded .chat-body {
  max-height: none;
  flex: 1;
}
.chat-widget.expanded .chat-expand-btn {
  color: var(--accent, #7c5cff);
}

/* ============================================================ */
/* DM Panel (Private Chat innerhalb des Widgets) */
/* ============================================================ */
.chat-dm-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
/* Chat-Widget Höhe fixieren wenn DM offen (nicht zusammenschrumpfen) */
/* NICHT wenn minimiert - sonst entsteht ein "Doppel-Pill" Effekt */
.chat-widget:not(.minimized):has(.chat-dm-panel) {
  height: 500px;
}
.chat-widget.expanded:not(.minimized):has(.chat-dm-panel) {
  height: 520px;
}
.chat-dm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(124, 92, 255, 0.1);
  flex-shrink: 0;
}
.chat-dm-header img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.chat-dm-header .dm-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex: 1;
}
.chat-dm-back {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.chat-dm-back:hover {
  background: rgba(255, 255, 255, 0.2);
}
@media (min-width: 769px) {
  .chat-dm-back { display: none; }
}
.chat-dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-dm-msg {
  max-width: 80%;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.chat-dm-msg.editing {
  max-width: 100%;
  width: 100%;
}
.chat-dm-msg.sent {
  align-self: flex-end;
  background: rgba(124, 92, 255, 0.35);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-dm-msg.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-bottom-left-radius: 4px;
}
.chat-dm-msg .dm-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}
.chat-dm-input-wrap {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  align-items: flex-end;
}
.chat-dm-input-wrap .chat-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  min-width: 0;
}
.chat-dm-input-wrap textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 34px 8px 10px;
  color: #fff;
  font-size: 16px;
  resize: none;
  min-height: 38px;
  max-height: 100px;
  font-family: inherit;
  line-height: 1.4;
  overflow-y: auto;
}
#chat-dm-emoji-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: all 0.2s;
  line-height: 1;
}
#chat-dm-emoji-btn:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.15);
}
#chat-dm-send {
  background: rgba(124, 92, 255, 0.4);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  flex-shrink: 0;
}
#chat-dm-send:hover {
  background: rgba(124, 92, 255, 0.6);
}

/* Mobile: DM-Panel fullscreen */
@media (max-width: 768px) {
  .chat-widget:not(.minimized):has(.chat-dm-panel) {
    height: 100% !important;
    max-height: 100vh !important;
    overflow: hidden;
  }
  .chat-dm-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
  }
  .chat-dm-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile: Sidebar als Overlay */
@media (max-width: 768px) {
  .chat-widget.expanded {
    width: 100%;
    max-height: 100vh;
  }
  .chat-widget.expanded .chat-expanded-wrap {
    position: relative;
  }
  .chat-widget.expanded .chat-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    z-index: 10;
    background: rgba(15, 15, 25, 0.98);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    display: flex;
  }
  .chat-widget.expanded.sidebar-open .chat-sidebar {
    transform: translateX(0);
  }
  /* Overlay-Backdrop wenn Sidebar offen */
  .chat-sidebar-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9;
  }
  .chat-widget.expanded.sidebar-open .chat-sidebar-backdrop {
    display: block;
  }
}

/* ============================================================ */
/* Reply Quote Block */
/* ============================================================ */
.chat-reply-quote {
  background: rgba(124, 92, 255, 0.1);
  border-left: 3px solid rgba(124, 92, 255, 0.6);
  border-radius: 4px;
  padding: 4px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.2s;
  max-width: 100%;
  overflow: hidden;
}
.chat-reply-quote:hover {
  background: rgba(124, 92, 255, 0.2);
}
.reply-quote-user {
  font-size: 11px;
  font-weight: 600;
  color: rgba(124, 92, 255, 0.9);
  margin-right: 6px;
}
.reply-quote-text {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline;
}

/* Reply Preview Bar (über Input) */
.chat-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(124, 92, 255, 0.1);
  border-top: 1px solid rgba(124, 92, 255, 0.3);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  gap: 8px;
}
.reply-preview-content {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.reply-preview-icon {
  color: rgba(124, 92, 255, 0.8);
  font-size: 14px;
  flex-shrink: 0;
}
.reply-preview-user {
  font-weight: 600;
  color: rgba(124, 92, 255, 0.9);
  white-space: nowrap;
  flex-shrink: 0;
}
.reply-preview-text {
  color: rgba(148, 163, 184, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-preview-close {
  background: none;
  border: none;
  color: rgba(148, 163, 184, 0.5);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.reply-preview-close:hover {
  color: #fff;
}

/* Reply Button */
.chat-reply-btn {
  font-size: 13px !important;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.chat-reply-btn:hover {
  opacity: 1;
}

/* @Mention Highlighting */
.chat-mention {
  color: rgba(124, 92, 255, 0.9);
  font-weight: 600;
  cursor: pointer;
}
.chat-mention:hover {
  text-decoration: underline;
}

/* Nachricht wo der aktuelle User erwähnt wird */
.chat-mentioned {
  background: rgba(124, 92, 255, 0.08) !important;
  border-left: 2px solid rgba(124, 92, 255, 0.5);
}

/* Flash-Animation beim Scroll zur zitierten Nachricht */
.chat-highlight-flash {
  animation: chatHighlight 1.5s ease;
}
@keyframes chatHighlight {
  0%, 100% { background: transparent; }
  30% { background: rgba(124, 92, 255, 0.2); }
}

/* @Mention Autocomplete Dropdown */
.chat-mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 8px;
  right: 8px;
  background: rgba(30, 30, 45, 0.95);
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  margin-bottom: 4px;
}
.mention-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  transition: background 0.15s;
}
.mention-item:hover,
.mention-item.selected {
  background: rgba(124, 92, 255, 0.2);
  color: #fff;
}
.mention-item:first-child {
  border-radius: 8px 8px 0 0;
}
.mention-item:last-child {
  border-radius: 0 0 8px 8px;
}
.mention-item:only-child {
  border-radius: 8px;
}

/* Mention-Badge: Pulsiert wenn User erwähnt wurde */
.chat-unread-badge.mention-badge {
  background: rgba(124, 92, 255, 0.9) !important;
  animation: mentionPulse 1.5s ease-in-out infinite;
}
@keyframes mentionPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(124, 92, 255, 0); }
}
