/* ==========================================
   CHAT FENSTER
   ========================================== */

/* Chat Toggle Button */
.chat-toggle-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  border: 2px solid var(--color-accent-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(184, 134, 79, 0.5);
  transition: box-shadow 0.3s ease, background 0.3s ease;
  z-index: 999;
}

.chat-toggle-btn:hover {
  box-shadow: 0 6px 30px rgba(184, 134, 79, 0.8);
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
}

.chat-icon {
  color: var(--color-text-light);
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  border: 2px solid var(--color-bg-primary);
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 400px;
  height: 600px;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  border: 1px solid rgba(184, 134, 79, 0.4);
  border-radius: 20px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(184, 134, 79, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: none;
  flex-direction: column;
  z-index: 998;
  overflow: hidden;
  -webkit-backdrop-filter: blur(10px);

  backdrop-filter: blur(10px);
}

.chat-window.active {
  display: flex;
  animation: chatSlideIn 0.3s ease-out;
}

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

/* Chat Popup Mode (vergrößert, zentriert) */
.chat-window.popup-mode {
  bottom: 50%;
  right: 50%;
  transform: translate(50%, 50%);
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  max-height: 900px;
  animation: chatPopupIn 0.3s ease-out;
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 1fr 320px;
  grid-template-columns: 1fr 320px;
  -ms-grid-rows: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  border-radius: 24px;
  box-shadow: 
    0 30px 90px rgba(0, 0, 0, 0.9),
    0 0 120px rgba(184, 134, 79, 0.2);
  z-index: 1101;
}
.chat-window.popup-mode > *:nth-child(1) {
  -ms-grid-row: 1;
  -ms-grid-column: 1;
}
.chat-window.popup-mode > *:nth-child(2) {
  -ms-grid-row: 1;
  -ms-grid-column: 2;
}
.chat-window.popup-mode > *:nth-child(3) {
  -ms-grid-row: 2;
  -ms-grid-column: 1;
}
.chat-window.popup-mode > *:nth-child(4) {
  -ms-grid-row: 2;
  -ms-grid-column: 2;
}
.chat-window.popup-mode > *:nth-child(5) {
  -ms-grid-row: 3;
  -ms-grid-column: 1;
}
.chat-window.popup-mode > *:nth-child(6) {
  -ms-grid-row: 3;
  -ms-grid-column: 2;
}

@keyframes chatPopupIn {
  from {
    opacity: 0;
    transform: translate(50%, 50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(50%, 50%) scale(1);
  }
}

/* Overlay für Popup-Modus */
.chat-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1100;
  animation: fadeIn 0.3s ease-out;
  pointer-events: auto;
}

.chat-window.popup-mode {
  pointer-events: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Anpassungen im Popup-Modus */
.chat-window.popup-mode .chat-header {
  grid-column: 1 / -1;
  -ms-grid-row: 1;
  grid-row: 1;
}

.chat-window.popup-mode .chat-title {
  font-size: 1.2rem;
}

.chat-window.popup-mode .chat-messages {
  padding: 1rem 1.5rem;
  -ms-grid-column: 1;
  grid-column: 1;
  -ms-grid-row: 2;
  grid-row: 2;
}

.chat-window.popup-mode .chat-message {
  padding: 0.8rem 1rem;
}

/* Chat Input im Popup-Modus */
.chat-window.popup-mode .chat-input-area {
  padding: 0;
  -ms-grid-column: 1;
  grid-column: 1;
  -ms-grid-row: 3;
  grid-row: 3;
}

.chat-window.popup-mode .chat-input {
  min-height: 60px;
  max-height: 120px;
  resize: vertical;
  border-radius: 0;
  padding: 0.8rem 3.5rem 0.8rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-window.popup-mode .chat-send-btn {
  width: 32px;
  height: 32px;
  right: 10px;
  top: auto;
  bottom: 10px;
  transform: none;
}

.chat-window.popup-mode .chat-send-btn svg {
  width: 16px;
  height: 16px;
}

/* Online Users Sidebar im Popup-Modus */
.chat-online-users {
  display: none;
  -ms-grid-column: 2;
  grid-column: 2;
  -ms-grid-row: 2;
  -ms-grid-row-span: 2;
  grid-row: 2 / 4;
  background: rgba(13, 13, 26, 0.6);
  border-left: 1px solid rgba(184, 134, 79, 0.3);
  padding: 1.5rem 1.2rem 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-backdrop-filter: blur(5px);

  backdrop-filter: blur(5px);
  flex-direction: column;
}

.chat-online-users::-webkit-scrollbar {
  width: 8px;
}

.chat-online-users::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.chat-online-users::-webkit-scrollbar-thumb {
  background: rgba(184, 134, 79, 0.4);
  border-radius: 4px;
}

.chat-online-users::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 134, 79, 0.6);
}

.chat-window.popup-mode .chat-online-users {
  display: flex;
}

.chat-window.popup-mode .chat-offline-users {
  display: block;
}

.chat-online-users-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--color-accent-hover);
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(184, 134, 79, 0.3);
  text-align: center;
  letter-spacing: 0.5px;
  cursor: pointer;
  -webkit-user-select: none;

  -moz-user-select: none;

  -ms-user-select: none;

  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.chat-online-users-title:hover {
  color: #d4a76a;
}

.chat-section-toggle {
  font-family: monospace;
  font-size: 1.2rem;
  margin-right: 0.5rem;
  width: 20px;
  display: inline-block;
  text-align: center;
}

.chat-online-users-count {
  font-size: 0.75rem;
  color: var(--color-accent);
  opacity: 0.8;
  margin-left: 0.4rem;
}

.chat-online-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.chat-online-list.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
}

.chat-online-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.chat-online-user.online-user-clickable {
  cursor: pointer;
}

.chat-online-user.online-user-clickable:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(184, 134, 79, 0.5);
  transform: translateX(3px);
}

.chat-online-user:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(184, 134, 79, 0.3);
}

.chat-online-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a1a2e;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(184, 134, 79, 0.3);
}

.chat-online-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid var(--color-bg-primary);
}

.chat-online-status.afk {
  background: #f1c40f;
}

.chat-offline-status {
  background: #95a5a6 !important;
}

.chat-online-info {
  flex: 1;
  min-width: 0;
}

.chat-online-name {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-online-role {
  font-size: 0.7rem;
  color: var(--color-accent);
  opacity: 0.8;
}

.chat-online-empty {
  text-align: center;
  color: var(--color-text-primary);
  opacity: 0.6;
  font-size: 0.8rem;
  padding: 1rem;
  font-style: italic;
}

/* Nachrichten-Icon bei Online-Usern */
.chat-online-message-icon {
  font-size: 0.9rem;
  opacity: 0.5;
  transition: all 0.2s ease;
  margin-left: auto;
}

.chat-online-user.online-user-clickable:hover .chat-online-message-icon {
  opacity: 1;
  transform: scale(1.2);
}

/* Offline Users Section */
.chat-offline-users {
  display: block;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(184, 134, 79, 0.2);
}

.chat-offline-users-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: rgba(184, 134, 79, 0.7);
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(184, 134, 79, 0.2);
  text-align: center;
  letter-spacing: 0.5px;
  cursor: pointer;
  -webkit-user-select: none;

  -moz-user-select: none;

  -ms-user-select: none;

  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.chat-offline-users-title:hover {
  color: var(--color-accent);
}

.chat-offline-users-count {
  font-size: 0.75rem;
  color: rgba(184, 134, 79, 0.6);
  opacity: 0.8;
  margin-left: 0.4rem;
}

.chat-offline-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.chat-offline-list.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
}

/* Offline Avatar Styling */
.chat-online-avatar.offline-avatar {
  background: linear-gradient(135deg, rgba(184, 134, 79, 0.4) 0%, rgba(184, 134, 79, 0.2) 100%);
  opacity: 0.7;
}

.chat-offline-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #666;
  border: 2px solid var(--color-bg-primary);
}

.chat-online-user.offline {
  opacity: 0.8;
}

.chat-online-user.offline:hover {
  opacity: 1;
}

.chat-header {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1a2e 100%);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(184, 134, 79, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent) 50%, transparent);
  opacity: 0.4;
}

.chat-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--color-accent-hover);
  margin: 0;
  letter-spacing: 0.5px;
}

.chat-header-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-status-dropdown {
  background: rgba(184, 134, 79, 0.1);
  border: 1px solid rgba(184, 134, 79, 0.3);
  color: var(--color-accent);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: none;
}

.chat-window.popup-mode .chat-status-dropdown {
  display: block;
}

.chat-status-dropdown:hover {
  background: rgba(184, 134, 79, 0.2);
  border-color: var(--color-accent);
}

.chat-status-dropdown:focus {
  outline: none;
  border-color: var(--color-accent-hover);
  box-shadow: 0 0 0 2px rgba(184, 134, 79, 0.2);
}

.chat-maximize-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.chat-maximize-btn:hover {
  color: var(--color-accent-hover);
  background: rgba(184, 134, 79, 0.2);
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-close-btn:hover {
  color: var(--color-accent-hover);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 1.2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
  background-clip: padding-box;
}

.chat-message {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  max-width: 90%;
  position: relative;
  transition: all 0.2s ease;
}

.chat-message:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(184, 134, 79, 0.2);
  transform: translateX(2px);
}

.chat-message-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.3rem;
  gap: 0.3rem;
  justify-content: space-between;
}

.chat-username {
  font-weight: 600;
  color: var(--color-accent-hover);
  font-size: 0.8rem;
}

/* Klickbare Benutzernamen für Privatnachrichten */
.chat-username.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px dotted transparent;
}

.chat-username.clickable:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  text-shadow: 0 0 8px rgba(184, 134, 79, 0.3);
}

.chat-time {
  font-size: 0.7rem;
  color: var(--color-accent);
  opacity: 0.6;
  white-space: nowrap;
  margin-left: auto;
}

.chat-time-separator {
  font-size: 0.7rem;
  color: var(--color-accent);
  opacity: 0.4;
  margin: 0 0.5rem;
}

/* Chat Lösch-Button - nur im Popup-Modus sichtbar */
.chat-delete-btn {
  background: none;
  border: none;
  color: rgba(231, 76, 60, 0.5);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.3rem;
  width: 18px;
  height: 18px;
  display: none; /* Standardmäßig versteckt */
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0;
}

/* Im Popup-Modus anzeigen */
.chat-popup .chat-delete-btn {
  display: flex;
}

.chat-popup .chat-message:hover .chat-delete-btn {
  opacity: 1;
}

.chat-delete-btn:hover {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

/* Chat Edit Button - außerhalb rechts */
.chat-edit-btn {
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(184, 134, 79, 0.3);
  color: rgba(184, 134, 79, 0.7);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0;
  position: absolute;
  right: -32px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-message:hover .chat-edit-btn,
.chat-message.touched .chat-edit-btn {
  opacity: 1;
}

.chat-edit-btn:hover {
  background: rgba(184, 134, 79, 0.3);
  color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(184, 134, 79, 0.4);
}

/* Chat Edit Interface */
.chat-edit-input {
  width: 100%;
  min-height: 60px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(184, 134, 79, 0.3);
  border-radius: 8px;
  color: var(--color-text-light);
  font-size: 0.85rem;
  padding: 8px;
  font-family: inherit;
  resize: vertical;
  margin-top: 4px;
}

.chat-edit-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(184, 134, 79, 0.1);
}

.chat-edit-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chat-edit-buttons button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-edit-buttons .save-btn {
  background: var(--color-accent);
  color: var(--color-text-light);
}

.chat-edit-buttons .save-btn:hover {
  background: var(--color-accent-hover);
}

.chat-edit-buttons .cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-light);
}

.chat-edit-buttons .cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Edited Label */
.chat-edited {
  font-size: 0.75rem;
  color: rgba(184, 134, 79, 0.6);
  font-style: italic;
  margin-left: 4px;
}

.chat-text {
  color: var(--color-text-light);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  word-wrap: break-word;
}

/* Chat Input Area */
.chat-input-area {
  border-top: none;
  padding: 0;
  background: transparent;
}

.chat-login-prompt {
  text-align: center;
  padding: 0.5rem;
}

.chat-login-text {
  color: var(--color-text-light);
  font-size: 0.8rem;
  line-height: 1.6;
  opacity: 0.9;
}

.chat-login-link {
  color: var(--color-accent-hover);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.chat-login-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Chat Input Form */
.chat-form {
  margin: 0;
}

.chat-input-wrapper {
  display: flex;
  position: relative;
  width: 100%;
  align-items: center;
}

.chat-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(184, 134, 79, 0.3);
  border-radius: 0;
  padding: 0.85rem 3.5rem 0.85rem 1.1rem;
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
  resize: none;
  min-height: 50px;
  max-height: 100px;
  line-height: 1.5;
  overflow-y: auto;
  box-shadow: none;
}

.chat-input::-moz-placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input:-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input::-ms-input-placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-input:focus {
  border-color: var(--color-accent);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 2px rgba(184, 134, 79, 0.2);
}

.chat-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(184, 134, 79, 0.3);
}

.chat-send-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 16px rgba(184, 134, 79, 0.5);
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, #f4c430 100%);
}

.chat-send-btn svg {
  color: #1a1a2e;
  width: 16px;
  height: 16px;
}

/* Chat Role Badges */
.chat-role-badge {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  margin-left: 0.4rem;
  font-weight: 600;
  text-transform: uppercase;
}

.chat-role-badge.admin {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.chat-role-badge.moderator {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

/* Chat Message Styles for Roles */
.chat-message.admin {
  border-left-color: #3498db;
  background: rgba(52, 152, 219, 0.05);
}

.chat-message.moderator {
  border-left-color: #3498db;
  background: rgba(52, 152, 219, 0.08);
}

/* Chat Loading State */
.chat-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--color-accent);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Chat Error */
.chat-error {
  background: rgba(231, 76, 60, 0.2);
  border-left: 3px solid #e74c3c;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  color: #e74c3c;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Chat Empty State */
.chat-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--color-accent);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.chat-empty svg {
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

/* Chat Mobile Responsive */

/* Tablet */
@media (max-width: 768px) {
  .chat-toggle-btn {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
  
  .chat-toggle-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .chat-window {
    width: 300px;
    height: 380px;
    bottom: 1rem;
    right: 0.8rem;
  }
  
  .chat-window.popup-mode {
    /* Zentrierung korrigieren für mobile */
    bottom: auto;
    right: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 500px;
    height: 60vh;
    max-height: 450px;
    -ms-grid-columns: 1fr;
    grid-template-columns: 1fr;
    -ms-grid-rows: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    border-radius: 12px;
    animation: chatPopupInMobile 0.3s ease-out;
  }
  
  .chat-window.popup-mode > *:nth-child(1) {
    -ms-grid-row: 1;
    -ms-grid-column: 1;
  }
  
  .chat-window.popup-mode > *:nth-child(2) {
    -ms-grid-row: 2;
    -ms-grid-column: 1;
  }
  
  .chat-window.popup-mode > *:nth-child(3) {
    -ms-grid-row: 3;
    -ms-grid-column: 1;
  }
  
  @keyframes chatPopupInMobile {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.9);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
  
  /* Sidebar im Popup ausblenden auf Tablet */
  .chat-window.popup-mode .chat-sidebar,
  .chat-window.popup-mode .chat-online-users {
    display: none !important;
  }
  
  .chat-header {
    padding: 0.5rem 0.8rem;
  }
  
  .chat-title {
    font-size: 0.85rem;
  }
  
  .chat-close-btn {
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
  }
  
  .chat-maximize-btn svg {
    width: 14px;
    height: 14px;
  }
  
  .chat-messages {
    padding: 0.5rem;
    gap: 0.4rem;
  }
  
  .chat-message {
    padding: 0.4rem 0.6rem;
    border-radius: 6px 6px 6px 2px;
  }
  
  .chat-username {
    font-size: 0.7rem;
  }
  
  .chat-time {
    font-size: 0.6rem;
  }
  
  .chat-text {
    font-size: 0.75rem;
    line-height: 1.3;
  }
  
  .chat-input-area {
    padding: 0.5rem;
  }
  
  .chat-input {
    padding: 0.4rem 2.2rem 0.4rem 0.7rem;
    font-size: 0.75rem;
    min-height: 30px;
    border-radius: 15px;
  }
  
  .chat-send-btn {
    width: 22px;
    height: 22px;
  }
  
  .chat-send-btn svg {
    width: 11px;
    height: 11px;
  }
  
  .chat-login-text {
    font-size: 0.65rem;
  }
  
  .chat-role-badge {
    font-size: 0.5rem;
    padding: 0.05rem 0.3rem;
  }
}

/* Smartphones */
@media (max-width: 576px) {
  .chat-toggle-btn {
    bottom: 0.8rem;
    right: 0.8rem;
    width: 40px;
    height: 40px;
  }
  
  .chat-toggle-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .chat-badge {
    width: 16px;
    height: 16px;
    font-size: 0.55rem;
    top: -2px;
    right: -2px;
  }
  
  .chat-window {
    bottom: 0;
    right: 0;
    left: auto;
    width: 280px;
    height: 350px;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
  }
  
  .chat-window.popup-mode {
    /* Zentrierung korrigieren für Smartphone */
    bottom: auto;
    right: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95vw;
    max-width: 380px;
    height: 55vh;
    max-height: 400px;
    border-radius: 12px;
    -ms-grid-columns: 1fr;
    grid-template-columns: 1fr;
  }
  
  .chat-header {
    padding: 0.4rem 0.6rem;
  }
  
  .chat-title {
    font-size: 0.75rem;
  }
  
  .chat-close-btn {
    width: 22px;
    height: 22px;
    font-size: 1rem;
  }
  
  .chat-maximize-btn {
    padding: 0.2rem;
  }
  
  .chat-maximize-btn svg {
    width: 12px;
    height: 12px;
  }
  
  .chat-messages {
    padding: 0.4rem;
    gap: 0.3rem;
  }
  
  .chat-message {
    padding: 0.35rem 0.5rem;
    max-width: 90%;
  }
  
  .chat-username {
    font-size: 0.65rem;
  }
  
  .chat-time {
    font-size: 0.55rem;
  }
  
  .chat-text {
    font-size: 0.7rem;
    line-height: 1.25;
  }
  
  .chat-input-area {
    padding: 0.4rem;
  }
  
  .chat-input {
    padding: 0.35rem 2rem 0.35rem 0.6rem;
    font-size: 0.7rem;
    min-height: 28px;
    border-radius: 14px;
  }
  
  .chat-send-btn {
    width: 20px;
    height: 20px;
  }
  
  .chat-send-btn svg {
    width: 10px;
    height: 10px;
  }
  
  .chat-login-text {
    font-size: 0.6rem;
  }
  
  .chat-role-badge {
    font-size: 0.45rem;
  }
  
  .chat-empty {
    font-size: 0.7rem;
    padding: 0.5rem;
  }
  
  .chat-empty svg {
    width: 24px;
    height: 24px;
  }
}

/* Sehr kleine Smartphones */
@media (max-width: 380px) {
  .chat-toggle-btn {
    bottom: 0.6rem;
    right: 0.6rem;
    width: 36px;
    height: 36px;
  }
  
  .chat-toggle-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .chat-badge {
    width: 14px;
    height: 14px;
    font-size: 0.5rem;
  }
  
  .chat-window {
    width: 260px;
    height: 320px;
  }
  
  .chat-window.popup-mode {
    /* Zentrierung für kleine Smartphones */
    height: 50vh;
    max-height: 350px;
    width: 95vw;
    max-width: 340px;
  }
  
  .chat-header {
    padding: 0.3rem 0.5rem;
  }
  
  .chat-title {
    font-size: 0.7rem;
  }
  
  .chat-close-btn {
    width: 20px;
    height: 20px;
    font-size: 0.9rem;
  }
  
  .chat-messages {
    padding: 0.3rem;
  }
  
  .chat-message {
    padding: 0.3rem 0.4rem;
  }
  
  .chat-username {
    font-size: 0.6rem;
  }
  
  .chat-time {
    font-size: 0.5rem;
  }
  
  .chat-text {
    font-size: 0.65rem;
  }
  
  .chat-input-area {
    padding: 0.3rem;
  }
  
  .chat-input {
    padding: 0.3rem 1.8rem 0.3rem 0.5rem;
    font-size: 0.65rem;
    min-height: 26px;
  }
  
  .chat-send-btn {
    width: 18px;
    height: 18px;
  }
  
  .chat-send-btn svg {
    width: 9px;
    height: 9px;
  }
}

.hero-slogan {
  font-size: var(--font-size-2xl);
  color: var(--color-accent-hover);
  margin-bottom: var(--spacing-sm);
  font-style: italic;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.9), 2px 2px 6px rgba(0, 0, 0, 0.8);
  letter-spacing: 1px;
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 1px 1px 4px rgba(0, 0, 0, 0.8);
  opacity: 0.9;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.cta-button {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  background: transparent;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--font-size-base);
  border-radius: 50px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  z-index: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(74, 158, 255, 0.2);
  transition: var(--transition-slow);
  transform: translate(-50%, -50%);
  z-index: -1;
}

.cta-button:hover::before {
  width: 300px;
  height: 300px;
}

.cta-button:hover {
  border-color: var(--color-accent-hover);
  color: var(--color-accent-hover);
  box-shadow: 0 0 30px rgba(74, 158, 255, 0.6);
  transform: translateY(-3px);
}

/* ==========================================
   WICHTIG: Diese Regel MUSS nach allen Media Queries kommen
   ========================================== */
/* Chat-Button ausblenden - überschreibt alle anderen Regeln */
.chat-toggle-btn.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ==========================================
   USER PROFIL PANEL
   ========================================== */

/* User Profil Panel - kompakt, slide von rechts neben der Liste */
.chat-user-profile {
  position: absolute;
  top: 0;
  right: -60%;
  width: 60%;
  height: 100%;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  border-left: 1px solid rgba(184, 134, 79, 0.4);
  z-index: 1000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.chat-user-profile.active {
  right: 0;
}

/* Profil Header */
.chat-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(184, 134, 79, 0.3);
}

.chat-profile-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--color-accent-hover);
  margin: 0;
  letter-spacing: 0.5px;
}

.chat-profile-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-primary);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.chat-profile-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-accent-hover);
}

/* Profil Content */
.chat-profile-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-profile-content::-webkit-scrollbar {
  width: 8px;
}

.chat-profile-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.chat-profile-content::-webkit-scrollbar-thumb {
  background: rgba(184, 134, 79, 0.4);
  border-radius: 4px;
}

/* Avatar Section */
.chat-profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(184, 134, 79, 0.2);
}

.chat-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 2rem;
  color: #1a1a2e;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(184, 134, 79, 0.4);
  position: relative;
}

.chat-profile-avatar img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  border-radius: 50%;
}

.chat-profile-avatar .chat-online-status {
  width: 16px;
  height: 16px;
  border: 3px solid #1a1a2e;
  bottom: 3px;
  right: 3px;
}

.chat-profile-username {
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin: 0 0 0.4rem 0;
  font-weight: 600;
}

.chat-profile-role {
  font-size: 0.8rem;
  color: var(--color-accent);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* Info Items */
.chat-profile-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-profile-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-profile-info-item svg {
  color: var(--color-accent);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.chat-profile-info-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.chat-profile-info-label {
  font-size: 0.75rem;
  color: var(--color-text-primary);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-profile-info-value {
  font-size: 0.95rem;
  color: var(--color-text-light);
  font-weight: 500;
}

/* Message Button */
.chat-profile-message-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
  border: none;
  border-radius: 12px;
  color: #1a1a2e;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(184, 134, 79, 0.3);
  margin-top: auto;
}

.chat-profile-message-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(184, 134, 79, 0.5);
}

.chat-profile-message-btn svg {
  color: #1a1a2e;
}

/* Responsive für Popup Mode */
.chat-window.popup-mode .chat-user-profile {
  width: 340px;
  right: -340px;
  border-left: 1px solid rgba(184, 134, 79, 0.4);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.chat-window.popup-mode .chat-user-profile.active {
  right: 320px;
}
