
/* override.css — kocmoc UI polish & layout tweaks */

/* Keep primary color consistent with palette */
:root {
  --primary: #7C3AED;
}

/* ===== Base buttons ===== */
button,
.btn,
.button {
  background: linear-gradient(135deg, #7C3AED, #8B5CF6) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.2s ease,
    opacity 0.2s ease !important;
  border-width: 0 !important;
}

button i,
.btn i {
  font-size: 14px;
}

button:hover,
.btn:hover,
.button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.4) !important;
}

button:active,
.btn:active,
.button:active {
  transform: translateY(0) !important;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3) !important;
}

button:disabled,
.btn:disabled,
.button:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* Ghost / icon buttons (like switch account, small icons) */
.icon-btn,
.switch-account-btn,
.mobile-header-btn,
.chat-header-btn {
  background: rgba(124, 58, 237, 0.08) !important;
  border-radius: 999px !important;
  padding: 8px 10px !important;
  box-shadow: none !important;
  border: 1px solid rgba(124, 58, 237, 0.16) !important;
  color: #4c1d95 !important;
}

.icon-btn:hover,
.switch-account-btn:hover,
.mobile-header-btn:hover,
.chat-header-btn:hover {
  background: rgba(124, 58, 237, 0.15) !important;
  transform: translateY(-1px) !important;
}

/* Auth tabs & main action */
.auth-tab {
  background: transparent !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  color: var(--light-text) !important;
}

.auth-tab.active {
  background: rgba(124, 58, 237, 0.08) !important;
  color: #4c1d95 !important;
}

/* Primary CTA on auth screen */
.auth-submit-btn,
#loginSubmitBtn,
#registerSubmitBtn {
  width: 100%;
  justify-content: center;
}

/* ===== Message input bar ===== */
.message-input-container {
  background: #f9fafb;
  border-radius: 16px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin: 8px 16px 16px;
}
.message-input-container.dragover {
  border-color: rgba(124,58,237,0.45);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.12);
}

.message-input-wrapper {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
}

.message-input {
  border-radius: 12px;
  border: none;
  background: transparent;
  padding: 10px 0;
  resize: none;
}

/* Emoji / attach / mic / send buttons */
.emoji-btn,
.attachment-btn,
.send-btn,
.voice-message-btn {
  font-size: 18px;
  cursor: pointer;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: transparent;
  color: var(--primary-color);
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.emoji-btn:hover,
.attachment-btn:hover {
  background: rgba(148, 163, 184, 0.16);
  transform: translateY(-1px);
}

.send-btn {
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.45);
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.55);
}

.send-btn:disabled {
  background: rgba(148, 163, 184, 0.6);
  box-shadow: none;
}

/* Mic button idle state */
.voice-message-btn {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  color: #4b5563;
}

.voice-message-btn:hover {
  background: rgba(248, 250, 252, 1);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.35);
}

/* Mic button while recording */
.voice-message-btn.recording {
  background: #fee2e2;
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.45);
  animation: pulse 1.1s ease-in-out infinite;
}

/* Hide "dot" pseudo-element from base CSS so иконка не дублируется */
.voice-message-btn.recording::before {
  content: '';
}

/* Emoji panel */
.emoji-panel {
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  border-radius: 18px;
}

/* ===== Chat list & layout polish ===== */
.chat-item {
  border-radius: 16px;
  padding: 12px 12px;
  margin-bottom: 6px;
}

.chat-item:hover {
  transform: translateY(-1px);
}

.chat-item.active {
  background: rgba(124, 58, 237, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.18);
}

.chat-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

/* Chat header actions */
.chat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-actions button {
  background: rgba(248, 250, 252, 1) !important;
  color: #4b5563 !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  border: 1px solid rgba(148, 163, 184, 0.6) !important;
}

.chat-actions button:hover {
  background: rgba(209, 213, 219, 0.45) !important;
}

/* Message bubbles spacing tweak */
.message {
  margin-bottom: 6px;
}

/* ===== Voice recorder bar ===== */
.voice-recorder {
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(18px);
}

.voice-recorder-content {
  border-radius: 20px;
  padding: 14px 18px;
}

.voice-recorder-actions button {
  min-width: 120px;
}

/* Cancel / send buttons in recorder */
.voice-recorder-cancel {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(148, 163, 184, 0.7) !important;
  box-shadow: none !important;
}

.voice-recorder-cancel:hover {
  background: rgba(31, 41, 55, 1) !important;
}

.voice-recorder-send {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.55) !important;
}

/* ===== Mobile bottom nav ===== */
.mobile-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 -8px 25px rgba(15, 23, 42, 0.16);
}

.mobile-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 10px;
}

.mobile-nav-item {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  border-radius: 999px;
  margin: 0 4px;
  color: #6b7280;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mobile-nav-item.active {
  background: rgba(124, 58, 237, 0.12);
  color: #4c1d95;
  transform: translateY(-1px);
}

/* Profile / settings skeleton */
.profile-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.profile-skeleton .skeleton {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.15), rgba(226, 232, 240, 0.35), rgba(148, 163, 184, 0.15));
}

/* Glass + neon touches on modals/mobile */
.modal .modal-content,
.feature-modal .feature-modal-content {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

body.neon-on .modal .modal-content,
body.neon-on .feature-modal .feature-modal-content {
  background: radial-gradient(circle at 20% 20%, rgba(124,58,237,0.18), rgba(15,23,42,0.9));
  border: 1px solid rgba(139,92,246,0.5);
  box-shadow: 0 18px 45px rgba(139,92,246,0.35);
}

.mobile-header,
.mobile-footer {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

body.neon-on .mobile-header,
body.neon-on .mobile-footer {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(59,130,246,0.15));
  box-shadow: 0 10px 26px rgba(124,58,237,0.35);
}

/* ===== Inputs & focus ===== */
input,
textarea,
select {
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 8px 10px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(124, 58, 237, 0.4);
  outline-offset: 1px;
  border-color: rgba(124, 58, 237, 0.7);
}

/* Quick-login card slight polish */
.quick-login-container {
  backdrop-filter: blur(18px);
}

/* Small utility: hide scrollbar for textarea in most browsers */
.message-input::-webkit-scrollbar {
  display: none;
}
.message-input {
  -ms-overflow-style: none;
  scrollbar-width: none;
}


/* Remove legacy pseudo-element icons to avoid "двойных" эмодзи и значков */
.emoji-btn::before,
.emoji-btn::after,
.attachment-btn::before,
.attachment-btn::after,
.voice-message-btn::before,
.voice-message-btn::after,
.send-btn::before,
.send-btn::after {
  content: none !important;
}

/* На всякий случай убираем спец‑эмодзи "in-progress" */
.emoji-btn.in-progress::before,
.emoji-btn.in-progress::after {
  content: none !important;
}


/* --- Message reactions bar & context menu (Telegram-like, in Kocmoc palette) --- */

.message-content {
  position: relative;
}

.message-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
}

.message-reactions-bar {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.message:hover .message-reactions-bar,
.message.my-message:hover .message-reactions-bar,
.message:focus-within .message-reactions-bar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.message-reaction-btn {
  border: none;
  background: rgba(15, 23, 42, 0.88);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.75);
}

.message-reaction-btn.active {
  background: radial-gradient(circle at 30% 0, #f97316, #7C3AED);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.7);
}

.message-pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.12);
  color: #4c1d95;
  margin-bottom: 6px;
}

.message-pinned-badge i {
  font-size: 12px;
}

/* Контекстное меню сообщения */

.message-context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 210px;
  max-width: 240px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  transform: scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.message-context-menu.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.message-context-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.message-context-item:hover {
  background: rgba(55, 65, 81, 0.8);
}

/* Чуть больше “захвата” для свайпов на мобильных */
@media (max-width: 768px) {
  .message {
    touch-action: pan-y;
  }
}


/* === Neon Glow mode === */
.neon-on .sidebar,
.neon-on .chat-header,
.neon-on .message-input-container {
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.45);
  border-color: rgba(196, 181, 253, 0.6);
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(59,130,246,0.12));
  backdrop-filter: blur(12px);
}

.neon-on .btn,
.neon-on .button,
.neon-on .chat-action-btn,
.neon-on .mobile-nav-item i {
  text-shadow: 0 0 8px rgba(196, 181, 253, 0.9);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.7);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.neon-on .chat-item.active {
  box-shadow: 0 0 18px rgba(124, 58, 237, 0.7);
}

body.neon-on {
  background: radial-gradient(circle at 10% 20%, rgba(124,58,237,0.22), transparent 30%),
              radial-gradient(circle at 80% 0%, rgba(59,130,246,0.18), transparent 30%),
              #0b1021;
  animation: neonPulse 10s ease-in-out infinite alternate;
}

@keyframes neonPulse {
  from { filter: drop-shadow(0 0 12px rgba(124,58,237,0.45)); }
  to   { filter: drop-shadow(0 0 18px rgba(59,130,246,0.55)); }
}

/* Neon toggle */
.neon-toggle-btn {
  margin-left: auto;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(196, 181, 253, 0.5);
  color: #7C3AED;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.neon-toggle-btn i {
  font-size: 14px;
}

.neon-toggle-btn.active {
  background: radial-gradient(circle at top, #A855F7, #4F46E5);
  color: #fff;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.9);
}

.neon-toggle-btn:hover {
  transform: translateY(-1px);
}

/* === Skeletons === */

.skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(226, 232, 240, 0.35), rgba(148, 163, 184, 0.18));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s linear infinite;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  flex-shrink: 0;
}

.skeleton-line {
  height: 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.skeleton-line.short {
  width: 40%;
}

.skeleton-line.medium {
  width: 70%;
}

.skeleton-line.long {
  width: 90%;
}

.skeleton-chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.skeleton-message {
  max-width: 70%;
  padding: 10px 12px;
  border-radius: 16px;
  align-self: flex-start;
  margin-bottom: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* === Stories strip & viewer === */

.stories-strip-wrapper {
  padding: 8px 12px 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.stories-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stories-strip::-webkit-scrollbar {
  height: 4px;
}

.stories-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
}

.story-avatar {
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
}

.story-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-ring-unseen {
  background: linear-gradient(135deg, #ff6ad5, #ffc46a);
  box-shadow: 0 0 8px rgba(255, 106, 213, 0.7);
}

.story-ring-seen {
  background: rgba(148, 163, 184, 0.35);
}

.story-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.story-username {
  margin-top: 4px;
  font-size: 11px;
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

/* Viewer */

.stories-viewer.hidden {
  display: none;
}

.stories-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stories-viewer-backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(18px);
  background: radial-gradient(circle at top, rgba(143, 0, 255, 0.35), transparent),
              radial-gradient(circle at bottom, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.95));
}

.stories-viewer-inner {
  position: relative;
  width: min(480px, 100% - 24px);
  height: min(720px, 100% - 80px);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(15, 15, 30, 0.9);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
}

.stories-viewer-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
  z-index: 2;
}

.stories-viewer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.stories-viewer-username {
  flex: 1;
  font-weight: 600;
  color: #E5E7EB;
}

.stories-viewer-close {
  border: none;
  background: transparent;
  color: #E5E7EB;
  font-size: 22px;
  cursor: pointer;
}

.stories-viewer-progress {
  height: 3px;
  margin: 0 12px 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.stories-viewer-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff6ad5, #ffc46a);
  transition: width linear;
}

.stories-viewer-body {
  position: relative;
  flex: 1;
  margin: 0 10px 10px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.9));
}

.stories-viewer-media {
  max-width: 100%;
  max-height: 100%;
  display: none;
}

.stories-viewer-text {
  padding: 16px;
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  text-align: center;
  display: none;
  color: #F9FAFB;
}

/* Зоны кликов */

.stories-viewer-zones {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}

.stories-viewer-zone {
  flex: 1;
  pointer-events: auto;
}

.stories-viewer-zone-left {
  cursor: w-resize;
}

.stories-viewer-zone-right {
  cursor: e-resize;
}

/* === Mobile sidebar overlay === */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 25;
}

.sidebar.active ~ .sidebar-overlay,
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

body.no-scroll {
  overflow: hidden;
}

@media (min-width: 1024px) {
  .sidebar-overlay {
    display: none;
  }
}


.chat-last-message.typing-indicator {
  font-style: italic;
  opacity: 0.8;
}


/* Global search modal */
#globalSearchModal.hidden {
  display: none;
}

#globalSearchModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#globalSearchModal .modal {
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  overflow: hidden;
  background: var(--panel-bg, rgba(20, 20, 40, 0.96));
  backdrop-filter: blur(24px);
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(120, 80, 255, 0.4);
  display: flex;
  flex-direction: column;
}

#globalSearchModal .modal-body {
  padding: 16px;
  overflow-y: auto;
}

.global-search-results {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.global-search-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s ease;
}

.global-search-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.global-search-item-chat {
  font-size: 13px;
  opacity: 0.7;
}

.global-search-item-snippet {
  font-size: 14px;
  margin-top: 4px;
}

.global-search-item-meta {
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.6;
}

/* Channels modal */
.channels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 10px 24px rgba(15,23,42,0.12);
  border: 1px solid rgba(148,163,184,0.3);
}

.channel-card-title {
  font-weight: 700;
  font-size: 14px;
}

.channel-card-meta {
  font-size: 12px;
  opacity: 0.7;
}

.channel-card-desc {
  font-size: 13px;
  opacity: 0.85;
}

.channel-chat-panel {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 12px 30px rgba(15,23,42,0.12);
  border: 1px solid rgba(148,163,184,0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.channel-chat-title {
  font-weight: 700;
}

.channel-messages {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}

.channel-message {
  padding: 10px;
  border-radius: 12px;
  background: rgba(148,163,184,0.12);
}

.channel-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.channel-message-author {
  font-weight: 600;
}

.channel-message-time {
  font-size: 11px;
  opacity: 0.65;
}

.channel-message-body {
  margin-top: 6px;
  font-size: 14px;
}

.channel-message-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.channel-message-input textarea {
  flex: 1;
  resize: none;
}

.channel-message-input .btn {
  width: 44px;
  height: 44px;
  padding: 0;
}

/* Call overlay */
.call-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px;
  pointer-events: none;
  z-index: 5000;
  background: radial-gradient(circle at 10% 20%, rgba(124,58,237,0.15), transparent 30%),
              radial-gradient(circle at 80% 10%, rgba(59,130,246,0.12), transparent 30%),
              rgba(4, 6, 15, 0.55);
}

.call-overlay.hidden {
  display: none;
}

.call-overlay:not(.hidden) {
  display: flex;
}

.call-window {
  position: relative;
  width: min(520px, 95vw);
  min-width: 320px;
  min-height: 260px;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(15,23,42,0.86));
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 18px;
  padding: 12px;
  color: #e5e7eb;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.45), 0 0 20px rgba(124,58,237,0.35);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  resize: both;
}

.call-window.minimized {
  height: auto;
  overflow: hidden;
  transform: translateY(6px) scale(0.96);
  box-shadow: 0 10px 24px rgba(15,23,42,0.3);
}

.call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.call-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.call-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-timer {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(124,58,237,0.35);
}

.call-header-actions {
  display: flex;
  gap: 6px;
}

.call-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.call-video-stack {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.call-video-stack video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f172a;
}

.call-video-stack .self-preview {
  position: absolute;
  width: 140px;
  height: 100px;
  bottom: 10px;
  right: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.call-status {
  font-size: 12px;
  text-align: left;
  opacity: 0.8;
}

.call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.call-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

.call-participant-chip {
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(124,58,237,0.25);
}

.call-control {
  border: 1px solid rgba(124,58,237,0.35);
  background: rgba(124,58,237,0.12);
  color: #f8fafc;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 24px rgba(124,58,237,0.25);
}

.call-control:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(124,58,237,0.35);
}

.call-control.danger {
  border-color: rgba(248,113,113,0.8);
  background: rgba(248,113,113,0.12);
  color: #fecdd3;
  box-shadow: 0 10px 22px rgba(248,113,113,0.2);
}

.call-control.ghost {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: #e5e7eb;
  box-shadow: none;
}

.call-control.primary {
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  border-color: rgba(124,58,237,0.55);
  color: #fff;
  box-shadow: 0 12px 26px rgba(124,58,237,0.4);
}

.call-control.active {
  background: radial-gradient(circle at 20% 20%, rgba(124,58,237,0.35), rgba(15,23,42,0.9));
  border-color: rgba(124,58,237,0.7);
  box-shadow: 0 0 18px rgba(124,58,237,0.5);
}

.incoming-call-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5200;
  display: none;
}

.incoming-call-toast.visible {
  display: block;
}

.call-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(15,23,42,0.82));
  border: 1px solid rgba(124,58,237,0.35);
  box-shadow: 0 14px 30px rgba(15,23,42,0.35);
  backdrop-filter: blur(14px);
}

.call-toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(124,58,237,0.12);
  display: grid;
  place-items: center;
  color: #c4b5fd;
}

.call-toast-title {
  font-weight: 700;
}

.call-toast-meta {
  font-size: 12px;
  opacity: 0.75;
}

.call-toast-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unselectable {
  user-select: none;
}

/* Admin charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.charts-grid canvas {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* Voice player bar */
.voice-player-bar {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  background: rgba(15, 15, 35, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  gap: 6px;
}

.voice-player-bar.hidden {
  display: none;
}

.voice-player-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-player-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-player-title {
  font-size: 13px;
  opacity: 0.85;
}

.voice-player-time {
  font-size: 11px;
  opacity: 0.6;
}

.voice-player-progress-wrap input[type='range'] {
  width: 100%;
}

#voicePlayerWaveform {
  width: 100%;
}



/* Inline voice waveform glassy bar */
.message-voice-waveform {
  position: relative;
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.message-voice-waveform::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.6), rgba(56, 189, 248, 0.7));
  opacity: 0.35;
  mix-blend-mode: screen;
}

.message-voice-progress {
  position: relative;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a855f7, #22d3ee);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.85);
  transition: width 0.08s linear;
}

body.neon-on .message-voice-waveform {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 18px rgba(129, 140, 248, 0.4);
}

body.neon-on .message-voice-progress {
  box-shadow: 0 0 26px rgba(45, 212, 191, 0.9);
}

/* E2E lock accent on voice bubble */
.message-voice-lock i {
  color: #22d3ee;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.9);
}



/* === Extra small devices (e.g. iPhone SE, small Android) === */
@media (max-width: 360px) {
  .app-container {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    width: 260px !important;
  }

  .chat-header-title {
    font-size: 14px !important;
  }

  .chat-header-subtitle {
    font-size: 11px !important;
  }

  .message-bubble {
    max-width: 88vw !important;
    font-size: 13px !important;
    padding: 6px 9px !important;
  }

  .message-meta {
    font-size: 10px !important;
  }

  .input-area textarea,
  .input-area input[type="text"] {
    font-size: 13px !important;
  }

  .stories-strip {
    gap: 8px !important;
  }

  .stories-strip .story-avatar {
    width: 44px !important;
    height: 44px !important;
  }

  .sidebar-chat-item-title {
    font-size: 13px !important;
  }

  .sidebar-chat-item-last {
    font-size: 11px !important;
  }

  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    bottom: 0 !important;
    top: auto !important;
  }
}

/* Slightly larger small phones */
@media (max-width: 414px) {
  .chat-header {
    padding-inline: 8px !important;
  }
  .input-area {
    padding-inline: 8px !important;
  }
}


/* Settings: devices & sessions */
.devices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
}

body.dark .device-row {
  background: rgba(15, 23, 42, 0.7);
}

.device-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.device-title i {
  opacity: 0.8;
}

.device-meta {
  font-size: 11px;
  opacity: 0.7;
}

.device-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.device-actions .btn.btn-small {
  padding: 4px 10px !important;
  font-size: 11px !important;
}

/* Sticker picker */
.sticker-btn {
  background: rgba(124, 58, 237, 0.08) !important;
  border: 1px solid rgba(124, 58, 237, 0.18) !important;
  border-radius: 12px !important;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.sticker-panel {
  position: absolute;
  bottom: 64px;
  left: 12px;
  width: 240px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.75);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  z-index: 1200;
}

.sticker-panel.hidden {
  display: none;
}

.sticker-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sticker-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.35);
}

.sticker-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.message-sticker img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
}


/* E2E conflict modal styling */
.e2e-modal .modal-content.glass-panel {
  background: rgba(15,23,42,0.94);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  border: 1px solid rgba(139,92,246,0.6);
  box-shadow: 0 0 24px rgba(139,92,246,0.35);
}

body.light .e2e-modal .modal-content.glass-panel {
  background: rgba(248,250,252,0.98);
  border-color: rgba(139,92,246,0.5);
}

.e2e-conflict-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.e2e-conflict-column {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15,23,42,0.7);
}
body.light .e2e-conflict-column {
  background: rgba(148,163,184,0.18);
}

.e2e-conflict-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: 0.8;
  margin-bottom: 4px;
}

.e2e-key-list,
.e2e-device-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  opacity: 0.9;
  word-break: break-all;
}

.e2e-key-list li,
.e2e-device-list li {
  padding: 2px 0;
  border-bottom: 1px dashed rgba(148,163,184,0.35);
}
.e2e-key-list li:last-child,
.e2e-device-list li:last-child {
  border-bottom: none;
}

.e2e-trusted-devices {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15,23,42,0.6);
}
body.light .e2e-trusted-devices {
  background: rgba(148,163,184,0.14);
}

.neon-btn {
  box-shadow: 0 0 14px rgba(139,92,246,0.7);
}

/* Demo panel (liquid glass, kocmoc palette) */
.demo-panel {
  position: fixed;
  bottom: 88px;
  right: 16px;
  width: min(340px, 90vw);
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(124,58,237,0.16), rgba(15,23,42,0.9));
  border: 1px solid rgba(124,58,237,0.35);
  box-shadow: 0 16px 40px rgba(15,23,42,0.42), 0 0 22px rgba(124,58,237,0.4);
  color: #e5e7eb;
  backdrop-filter: blur(18px);
  z-index: 3800;
}

.demo-panel.hidden {
  display: none;
}

.demo-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.demo-panel-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(124,58,237,0.16);
  border: 1px solid rgba(124,58,237,0.35);
  color: #c4b5fd;
}

.demo-panel-close {
  border: none;
  background: rgba(255,255,255,0.06);
  color: #e5e7eb;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
}

.demo-panel h3 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.demo-panel p {
  margin: 0 0 10px;
  font-size: 13px;
  opacity: 0.82;
}

.demo-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-chip {
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(124,58,237,0.25);
}

.demo-panel-toggle {
  position: fixed;
  bottom: 28px;
  right: 16px;
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid rgba(124,58,237,0.45);
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  color: #fff;
  box-shadow: 0 12px 30px rgba(124,58,237,0.45);
  cursor: pointer;
  z-index: 3800;
}

.demo-panel-toggle:hover {
  transform: translateY(-1px);
}
