/* =====================================================
   CHAT — Style inspiré WoW (panel large, lignes denses)
   ===================================================== */

.chat-widget {
  position: fixed;
  bottom: 12px;
  right: 12px;
  width: 480px;
  height: 320px;
  background: linear-gradient(180deg, rgba(8,12,20,0.92) 0%, rgba(14,18,28,0.92) 100%);
  border: 1px solid rgba(201, 149, 42, 0.45);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7),
              inset 0 1px 0 rgba(255,255,255,0.04);
  display: none;
  flex-direction: column;
  z-index: 50000;
  color: #e9e6dc;
  font-family: 'Friz Quadrata', 'Trajan Pro', 'Georgia', 'Times New Roman', serif;
  font-size: 12px;
  line-height: 1.25;
  transition: height 0.2s ease;
}

.chat-widget.ready { display: flex; }

.chat-widget.minimized {
  height: 32px;
  width: 220px;
}
.chat-widget.minimized .chat-body { display: none; }

/* ── Header WoW : barre dorée ── */
.chat-header {
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(201,149,42,0.22), rgba(120,80,18,0.18));
  border-bottom: 1px solid rgba(201,149,42,0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 5px 5px 0 0;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.chat-header:hover { background: linear-gradient(180deg, rgba(201,149,42,0.32), rgba(120,80,18,0.25)); }

.chat-header-title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #FFD27A;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}
.chat-header-title.blink { animation: chatBlink 0.9s ease-in-out infinite; }

@keyframes chatBlink {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

.chat-minimize {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(201,149,42,0.4);
  color: #FFD27A;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.chat-minimize:hover { background: rgba(201,149,42,0.25); }
.chat-widget.minimized .chat-minimize { display: none; }

/* ── Body ── */
.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  padding: 6px 10px 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,149,42,0.45) rgba(0,0,0,0.2);
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(201,149,42,0.45); border-radius: 3px; }

/* Message : ligne dense (style WoW chat) */
.chat-msg {
  margin: 0 0 1px 0;
  padding: 0;
  line-height: 1.25;
  word-wrap: break-word;
  font-size: 12px;
  color: #e9e6dc;
}

.chat-pseudo {
  font-weight: 700;
  margin-right: 3px;
  cursor: pointer;
}
.chat-pseudo:hover { text-decoration: underline; }

.chat-text { color: #e9e6dc; }

.chat-empty {
  text-align: center;
  padding: 30px 10px;
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  font-style: italic;
}

/* Tag de coordonnées cliquable */
.chat-coord-tag {
  display: inline-block;
  padding: 0 5px;
  margin: 0 1px;
  background: rgba(102,126,234,0.18);
  border: 1px solid rgba(102,126,234,0.5);
  border-radius: 3px;
  color: #9DB6FF;
  font-weight: 600;
  cursor: pointer;
  font-size: 11px;
  text-decoration: none;
  transition: all 0.12s ease;
}
.chat-coord-tag:hover {
  background: rgba(102,126,234,0.35);
  color: #fff;
  text-decoration: none;
}

/* Mention pseudo (@user) */
.chat-mention {
  color: #FFD27A;
  font-weight: 600;
  cursor: pointer;
}
.chat-mention:hover { text-decoration: underline; }

/* ── Input ── */
.chat-input-container {
  padding: 6px 8px;
  border-top: 1px solid rgba(201,149,42,0.4);
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
}

.chat-input {
  flex: 1;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(201,149,42,0.35);
  padding: 5px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.chat-input::placeholder { color: rgba(255,255,255,0.35); }
.chat-input:focus {
  border-color: rgba(201,149,42,0.7);
  background: rgba(0,0,0,0.55);
}

.chat-send-btn {
  background: rgba(201,149,42,0.25);
  border: 1px solid rgba(201,149,42,0.55);
  color: #FFD27A;
  width: 32px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.chat-send-btn:hover { background: rgba(201,149,42,0.4); }

/* Responsive */
@media (max-width: 768px) {
  .chat-widget {
    width: calc(100% - 24px);
    max-width: 480px;
    height: 280px;
    bottom: 8px;
    right: 12px;
  }
}
