/* ============================================
   meos.blog — Sohbet Widget'ı
   Floating chat bubble + panel
   ============================================ */

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  font-family: 'Inter', -apple-system, sans-serif;
}

/* ---- Chat Bubble ---- */
.chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #FF6B9D);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.chat-bubble.hidden { transform: scale(0); opacity: 0; pointer-events: none; }

/* ---- Chat Panel ---- */
.chat-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  height: 520px;
  background: var(--bg-primary, #07070d);
  border: 1px solid var(--border, rgba(42,42,62,0.6));
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.chat-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ---- Header ---- */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, rgba(42,42,62,0.6));
  background: var(--bg-card, rgba(18,18,30,0.85));
}

.chat-header strong { font-size: 14px; color: var(--text-primary, #f0f0f5); }

.chat-online {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--success, #00D4AA);
  margin-top: 2px;
}

.chat-online .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success, #00D4AA);
  animation: pulse-dot 2s ease-out infinite;
}

/* ---- Messages ---- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 4px; }

.chat-welcome {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary, #8b8ba7);
}

.chat-welcome i { font-size: 48px; color: var(--accent, #8B5CF6); margin-bottom: 12px; display: block; }
.chat-welcome p { font-size: 14px; line-height: 1.5; }

/* ---- Message Bubble ---- */
.chat-msg {
  background: var(--bg-card, rgba(18,18,30,0.85));
  border: 1px solid var(--border, rgba(42,42,62,0.6));
  border-radius: 12px;
  padding: 10px 14px;
  animation: msgIn 0.3s ease;
}

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

.chat-msg strong {
  font-size: 12px;
  color: var(--accent-light, #A78BFA);
  margin-right: 8px;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-tertiary, #5c5c7a);
}

.chat-del-btn {
  float:right;background:none;border:none;color:var(--text-tertiary);
  cursor:pointer;font-size:10px;padding:2px;opacity:0;transition:opacity 0.2s;
}
.chat-msg:hover .chat-del-btn { opacity:1; }
.chat-del-btn:hover { color:#FF6B9D; }

.chat-msg p {
  font-size: 13px;
  color: var(--text-secondary, #8b8ba7);
  margin-top: 4px;
  line-height: 1.5;
  word-wrap: break-word;
}

/* ---- Input ---- */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border, rgba(42,42,62,0.6));
  background: var(--bg-card, rgba(18,18,30,0.85));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-input-area input[type="text"] {
  background: var(--bg-secondary, #0d0d1a);
  border: 1px solid var(--border, rgba(42,42,62,0.6));
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary, #f0f0f5);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-area input[type="text"]:focus {
  border-color: var(--accent, #8B5CF6);
}

#chatNickname {
  width: 100px;
  font-size: 12px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-row input { flex: 1; }

.chat-input-row button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--cta, #FF6B9D);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-input-row button:hover { opacity: 0.9; }
.chat-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .chat-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    z-index: 9999;
  }
  .chat-bubble { bottom: 20px; right: 20px; z-index: 9998; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
