/* ═══════════════════════════════════════════════════════════
   💬 CHAT — Shared styles for modal & standalone page
   ═══════════════════════════════════════════════════════════ */

/* ── Improved search bar (pill style) ── */
.chat-search-bar {
  display: flex;
  align-items: center;
  background: #f0f2f5;
  border-radius: 24px;
  padding: 0 14px;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.chat-search-bar:focus-within {
  background: #fff;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}

.chat-search-icon {
  color: #adb5bd;
  font-size: 0.82rem;
  flex-shrink: 0;
  margin-right: 8px;
}

.chat-search-input {
  border: none !important;
  background: transparent !important;
  padding: 8px 0 !important;
  font-size: 0.85rem;
  box-shadow: none !important;
}

.chat-search-input::placeholder {
  color: #adb5bd;
}

body.dark-mode .chat-search-bar {
  background: #2a2a3e;
}
body.dark-mode .chat-search-bar:focus-within {
  background: #303048;
  border-color: #667eea;
}
body.dark-mode .chat-search-input {
  color: #e8e8f0 !important;
}
body.dark-mode .chat-search-input::placeholder {
  color: #8e8ea0;
}

/* ── Virtual keyboard button (unified) ── */
.chat-kb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f0f2f5;
  color: #6c757d;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.chat-kb-btn:hover {
  background: #e8eaf0;
  color: #667eea;
}

.chat-kb-btn.active {
  background: rgba(102,126,234,0.12);
  color: #667eea;
  border-color: #667eea;
}

body.dark-mode .chat-kb-btn {
  background: #2a2a3e;
  border-color: rgba(255,255,255,0.08);
  color: #adb5bd;
}
body.dark-mode .chat-kb-btn:hover {
  background: #303048;
  color: #667eea;
}

/* ── Virtual keyboard popup ── */
.chat-kb-popup {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  padding: 12px;
  min-width: 200px;
  animation: kbFadeIn 0.2s ease;
}

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

.chat-kb-popup-header {
  text-align: center;
  margin-bottom: 8px;
  color: #adb5bd;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.chat-kb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.chat-kb-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  background: #f8f9fa;
  color: #1a1a2e;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.chat-kb-key:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: transparent;
  transform: scale(1.05);
}

.chat-kb-key:active {
  transform: scale(0.95);
}

body.dark-mode .chat-kb-popup {
  background: hsl(240, 10%, 18%);
  border-color: rgba(255,255,255,0.08);
}

body.dark-mode .chat-kb-key {
  background: #2a2a3e;
  color: #e8e8f0;
  border-color: rgba(255,255,255,0.06);
}

body.dark-mode .chat-kb-key:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

body.dark-mode .chat-kb-popup-header {
  color: #8e8ea0;
}

/* ── MAJ (Shift) button ── */
.chat-kb-maj {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  background: #f8f9fa;
  color: #1a1a2e;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.chat-kb-maj:hover {
  background: #e8eaf0;
  border-color: #667eea;
  color: #667eea;
}

.chat-kb-maj.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

.chat-kb-maj.active:hover {
  transform: scale(1.05);
}

body.dark-mode .chat-kb-maj {
  background: #2a2a3e;
  color: #e8e8f0;
  border-color: rgba(255,255,255,0.06);
}

body.dark-mode .chat-kb-maj:hover {
  background: #303048;
  color: #667eea;
}

body.dark-mode .chat-kb-maj.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
