/* Metin2 Chat Paneli ve Preview için gerekli CSS */
#metin2ChatPanel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 60px;
  margin: 0 auto;
  width: 98vw;
  max-width: 700px;
  min-width: 260px;
  height: 140px;
  background: rgba(24,24,24,0.85);
  border: 2.5px solid #bfa76a;
  border-radius: 10px;
  box-shadow: 0 4px 32px #000b, 0 0 0 2px #bfa76a44;
  z-index: 1200;
  display: none;
  flex-direction: column;
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s, height 0.2s;
  resize: none;
  user-select: none;
}
#metin2ChatDragHandle {
  width: 100%;
  height: 12px;
  cursor: ns-resize;
  background: linear-gradient(90deg, #bfa76a33 0%, #fff0 100%);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#metin2ChatDragHandle:after {
  content: '';
  display: block;
  width: 38px;
  height: 4px;
  background: #bfa76a99;
  border-radius: 2px;
  margin: 0 auto;
}
#metin2ChatMessages {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 10px 14px 2px 14px;
  font-size: 1em;
  line-height: 1.45;
  color: #fff;
  background: transparent;
  border-bottom: 1.5px solid #bfa76a44;
}
.metin2-chat-row {
  margin-bottom: 2px;
  font-size: 1em;
  white-space: pre-line;
  word-break: break-word;
  padding: 2px 0;
  border-radius: 3px;
  transition: background 0.2s;
  line-height: 1.3; /* Satır yüksekliği eklendi */
  word-spacing: 0.5px; /* Kelime aralığı eklendi */
  display: flex;
  align-items: center;
}


.metin2-chat-row:hover {
  background: rgba(191,167,106,0.08);
}
.metin2-chat-nick {
  color: #ffd700;
  font-weight: bold;
  margin-right: 4px;
  text-shadow: 0 1px 2px #000a;
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
}
#metin2ChatForm {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 10px;
  background: transparent;
  border-top: 1.5px solid #bfa76a;
}
#metin2ChatInput {
  flex: 1 1 0;
  background: #181818;
  color: #ffd700;
  border: 1.5px solid #bfa76a;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1em;
  outline: none;
  box-shadow: 0 1px 6px #0004 inset;
  transition: border 0.2s, box-shadow 0.2s;
}
#metin2ChatInput:focus {
  border-color: #ffd700;
  box-shadow: 0 0 8px #ffd70055;
}
#metin2ChatSendBtn {
  padding: 6px 16px;
  font-weight: 600;
  background: #bfa76a;
  color: #232323;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#metin2ChatSendBtn:hover {
  background: #ffd700;
}
#metin2ChatPreview {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 80px;
  margin: 0 auto;
  width: 98vw;
  max-width: 700px;
  min-width: 260px;
  background: rgba(24,24,24,0.85);
  border: 2px solid #bfa76a;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.9em;
  text-align: left; /* left olarak değiştirildi */
  z-index: 1199;
  display: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px #0008;
  transition: opacity 0.35s;
  opacity: 0;
}
#metin2ChatPreview.show {
  opacity: 0.92;
}
#metin2ChatPreview .metin2-chat-nick {
  color: #ffd700;
  font-weight: bold;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
}

/* Preview mesajları için sol hizalama */
.metin2-chat-preview-row {
  text-align: left !important;
  margin-bottom: 4px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.metin2-chat-preview-row:last-child {
  margin-bottom: 0;
}

/* Preview'da admin elementleri için stiller */
.metin2-chat-preview-row .admin-crown {
  font-size: 1em;
  margin-right: 3px;
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
}

.metin2-chat-preview-row .admin-badge {
  font-size: 0.85em;
  padding: 1px 6px;
  margin-right: 5px;
  min-width: 45px;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffe066;
  color: #23272b;
  font-weight: 700;
  border-radius: 5px;
  box-shadow: 0 1px 3px #ffe06644;
  border: 1px solid #ffe066;
  vertical-align: baseline;
}

.metin2-chat-preview-row .admin-nick-simple {
  font-size: 0.95em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  color: #00bcd4;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 2px #0002;
  margin-right: 2px;
  vertical-align: baseline;
}

.metin2-chat-preview-row .chat-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: calc(100% - 200px);
  display: inline-flex;
  align-items: center;
  word-break: break-word;
  flex: 1;
  vertical-align: baseline;
}

/* Sabit Chat Paneli için ek stiller */
.fixed-chat-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  max-width: 90vw;
  background: rgba(24, 24, 24, 0.95);
  border: 2px solid #bfa76a;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.fixed-chat-panel.minimized {
  height: 50px;
}

.fixed-chat-panel.minimized .chat-content {
  display: none;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #bfa76a, #8b7355);
  color: #232323;
  font-weight: 600;
}

.chat-title {
  display: flex;
  align-items: center;
  font-size: 1.1em;
}

.chat-controls {
  display: flex;
  gap: 6px;
}

.chat-controls .btn {
  padding: 4px 8px;
  font-size: 0.9em;
  border-width: 1px;
}

.chat-content {
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  max-height: 250px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(24, 24, 24, 0.8);
}

.chat-welcome {
  text-align: center;
  color: #bfa76a;
  padding: 20px 0;
}

.chat-welcome i {
  font-size: 2em;
  margin-bottom: 10px;
  display: block;
}

.chat-welcome p {
  margin: 8px 0;
  font-weight: 600;
}

.chat-welcome small {
  color: #888;
  font-size: 0.9em;
}

.chat-input-area {
  padding: 12px 16px;
  background: rgba(24, 24, 24, 0.9);
  border-top: 1px solid rgba(191, 167, 106, 0.3);
}

.chat-input-area .form-control {
  background: #181818;
  border: 1px solid #bfa76a;
  color: #ffd700;
  border-radius: 6px 0 0 6px;
}

.chat-input-area .form-control:focus {
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.chat-input-area .btn {
  border-radius: 0 6px 6px 0;
  border: 1px solid #bfa76a;
  background: #bfa76a;
  color: #232323;
  font-weight: 600;
}

.chat-input-area .btn:hover {
  background: #ffd700;
  border-color: #ffd700;
}

.chat-preview {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: rgba(24, 24, 24, 0.95);
  border: 1px solid #bfa76a;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  max-width: 300px;
  font-size: 0.9em;
  color: #fff;
  backdrop-filter: blur(10px);
}

.preview-content {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-message {
  margin-bottom: 8px;
  padding: 6px 8px;
  background: rgba(191, 167, 106, 0.1);
  border-radius: 6px;
  border-left: 3px solid #bfa76a;
}

.chat-message .nick {
  color: #ffd700;
  font-weight: 600;
  margin-right: 6px;
}

.chat-message .message {
  color: #fff;
}

.chat-message.admin .nick {
  color: #ff6b6b;
}

.chat-message.mention {
  background: rgba(255, 107, 107, 0.2);
  border-left-color: #ff6b6b;
  animation: none; /* Anasayfada taşmayı önlemek için animasyon kapatıldı */
}

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

/* Responsive Chat */
@media (max-width: 768px) {
  .fixed-chat-panel {
    bottom: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }
  
  .chat-content {
    max-height: 300px;
  }
  
  .chat-messages {
    max-height: 200px;
  }
  
  /* Admin elementleri için responsive boyutlar */
  .admin-crown {
    font-size: 0.9em !important; /* Daha da küçük */
    margin-right: 2px !important;
  }
  
  .admin-badge {
    font-size: 0.8em !important; /* Daha da küçük */
    padding: 1px 4px !important;
    margin-right: 4px !important;
    min-width: 40px !important;
  }
  
  .admin-nick-simple {
    font-size: 0.9em !important; /* Daha da küçük */
    max-width: 100px !important;
  }
  
  .username {
    max-width: 100px !important;
  }
  
  .chat-text {
    max-width: calc(100% - 180px) !important; /* Daha az alan */
  }
  
  .admin-message .chat-text {
    max-width: calc(100% - 180px) !important; /* Daha az alan */
  }
}

/* Daha küçük ekranlar için ek düzenlemeler */
@media (max-width: 480px) {
  .admin-crown {
    font-size: 0.85em !important; /* En küçük boyut */
    margin-right: 1px !important;
  }
  
  .admin-badge {
    font-size: 0.75em !important; /* En küçük boyut */
    padding: 1px 3px !important;
    margin-right: 3px !important;
    min-width: 35px !important;
  }
  
  .admin-nick-simple {
    font-size: 0.85em !important; /* En küçük boyut */
    max-width: 80px !important;
  }
  
  .username {
    max-width: 80px !important;
  }
  
  .chat-text {
    max-width: calc(100% - 160px) !important; /* En az alan */
  }
  
  .admin-message .chat-text {
    max-width: calc(100% - 160px) !important; /* En az alan */
  }
  
  /* Chat mesajları için daha kompakt görünüm */
  .metin2-chat-row {
    padding: 1px 0 !important;
    margin-bottom: 1px !important;
    line-height: 1.2 !important;
  }
}

/* Chat paneli responsive ayarları */
@media (max-width: 99vw) { 
  .inline-chat-panel { max-width: 99vw; min-width: 0; }
}
@media (max-width: 144px) { 
  .inline-chat-panel { width: 99vw; left: 0; right: 0; min-width: 0; }
}

/* Inline Chat Paneli Stilleri (Sayfa içinde sabit) */
.inline-chat-panel {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(24, 24, 24, 0.95);
  border: 2px solid #bfa76a;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
}

.inline-chat-panel.minimized {
  height: 50px;
}

.inline-chat-panel.minimized .chat-content {
  display: none;
}

.inline-chat-panel .chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #bfa76a, #8b7355);
  color: #232323;
  font-weight: 600;
}

.inline-chat-panel .chat-title {
  display: flex;
  align-items: center;
  font-size: 1.1em;
}

.inline-chat-panel .chat-controls {
  display: flex;
  gap: 0;
}

.inline-chat-panel .chat-controls .btn {
  padding: 4px 8px;
  font-size: 0.9em;
  border-width: 1px;
  transition: all 0.3s ease;
}

.inline-chat-panel .chat-controls .btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.inline-chat-panel .chat-content {
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.inline-chat-panel .chat-messages {
  flex: 1;
  max-height: 250px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(24, 24, 24, 0.8);
}

.inline-chat-panel .chat-welcome {
  text-align: center;
  color: #bfa76a;
  padding: 20px 0;
}

.inline-chat-panel .chat-welcome i {
  font-size: 2em;
  margin-bottom: 10px;
  display: block;
}

.inline-chat-panel .chat-welcome p {
  margin: 8px 0;
  font-weight: 600;
}

.inline-chat-panel .chat-welcome small {
  color: #888;
  font-size: 0.9em;
}

.inline-chat-panel .chat-input-area {
  padding: 12px 16px;
  background: rgba(24, 24, 24, 0.9);
  border-top: 1px solid rgba(191, 167, 106, 0.3);
}

.inline-chat-panel .chat-input-area .form-control {
  background: #181818;
  border: 1px solid #bfa76a;
  color: #ffd700;
  border-radius: 6px 0 0 6px;
  word-wrap: break-word;
  white-space: normal;
  resize: vertical;
  min-height: 38px;
}

.inline-chat-panel .chat-input-area .form-control:focus {
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.inline-chat-panel .chat-input-area .btn {
  border-radius: 0 6px 6px 0;
  border: 1px solid #bfa76a;
  background: #bfa76a;
  color: #232323;
  font-weight: 600;
}

.inline-chat-panel .chat-input-area .btn:hover {
  background: #ffd700;
  border-color: #ffd700;
}

.inline-chat-panel .chat-preview {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: rgba(24, 24, 24, 0.95);
  border: 1px solid #bfa76a;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  max-width: 300px;
  font-size: 0.9em;
  color: #fff;
  backdrop-filter: blur(10px);
  text-align: left; /* left olarak değiştirildi */
}

.inline-chat-panel .preview-content {
  white-space: normal;
  overflow: hidden;
  word-wrap: break-word;
  text-align: left; /* left olarak değiştirildi */
}

/* Inline chat preview'da admin elementleri için stiller */
.inline-chat-panel .preview-content .admin-crown {
  font-size: 1em;
  margin-right: 3px;
  display: inline-block;
  vertical-align: middle;
}

.inline-chat-panel .preview-content .admin-badge {
  font-size: 0.85em;
  padding: 1px 6px;
  margin-right: 5px;
  min-width: 45px;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
  background: #ffe066;
  color: #23272b;
  font-weight: 700;
  border-radius: 5px;
  box-shadow: 0 1px 3px #ffe06644;
  border: 1px solid #ffe066;
}

.inline-chat-panel .preview-content .admin-nick-simple {
  font-size: 0.95em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  color: #00bcd4;
  font-weight: 700;
  letter-spacing: 0.1px;
  text-shadow: 0 1px 2px #0002;
  margin-right: 2px;
}

.inline-chat-panel .preview-content .chat-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: calc(100% - 200px);
  display: inline-block;
  vertical-align: top;
  word-break: break-word;
}

.inline-chat-panel .chat-message {
  margin-bottom: 8px;
  padding: 6px 8px;
  background: rgba(191, 167, 106, 0.1);
  border-radius: 6px;
  border-left: 3px solid #bfa76a;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.inline-chat-panel .chat-message .nick {
  color: #ffd700;
  font-weight: 600;
  margin-right: 6px;
  max-width: 120px; /* Maximum genişlik */
  overflow: hidden; /* Taşan kısmı gizle */
  text-overflow: ellipsis; /* Taşan kısım için ... */
  white-space: nowrap; /* Tek satırda kal */
  display: inline-flex; /* Flexbox olarak davran */
  align-items: center;
  flex-shrink: 0; /* Küçülmeyi engelle */
}

.inline-chat-panel .chat-message .message {
  color: #fff;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1; /* Kalan alanı kapla */
  display: inline-flex;
  align-items: center;
}

.inline-chat-panel .chat-message.admin .nick {
  color: #ff6b6b;
}

.inline-chat-panel .chat-message.mention {
  background: rgba(255, 107, 107, 0.2);
  border-left-color: #ff6b6b;
  animation: none; /* Anasayfada taşmayı önlemek için animasyon kapatıldı */
}

/* Responsive Inline Chat */


@media (max-width: 768px) {
  .inline-chat-panel {
    margin: 0 10px;
    max-width: none;
  }
  
  .inline-chat-panel .chat-content {
    max-height: 300px;
  }
  
  .inline-chat-panel .chat-messages {
    max-height: 200px;
  }
} 

/* Chat text için taşma kontrolü */
.chat-text {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  display: inline-block;
  vertical-align: top;
  word-break: break-word;
}

/* Admin mesajları için ek düzenlemeler */
.admin-message .chat-text {
  max-width: calc(100% - 200px); /* Admin elementleri için alan bırak */
}

/* Username için de taşma kontrolü */
.username {
  color: #ffd700;
  font-weight: bold;
  margin-right: 4px;
  text-shadow: 0 1px 2px #000a;
  max-width: 120px; /* Maximum genişlik */
  overflow: hidden; /* Taşan kısmı gizle */
  text-overflow: ellipsis; /* Taşan kısım için ... */
  white-space: nowrap; /* Tek satırda kal */
  display: inline-block; /* Block element olarak davran */
} 