/* ==========================================================================
   SokolChat Ultra-Modern Design System
   Inspired by Apple Human Interface Guidelines, VisionOS & Glassmorphism
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* Color Palette - Dark Theme (Default) */
  --bg-canvas: #07090e;
  --bg-canvas-rgb: 7, 9, 14;
  --bg-mesh-1: rgba(0, 240, 255, 0.08);
  --bg-mesh-2: rgba(168, 85, 247, 0.07);
  --bg-mesh-3: rgba(16, 185, 129, 0.05);
  
  /* Glass Surfaces */
  --glass-surface: rgba(15, 20, 32, 0.65);
  --glass-surface-elevated: rgba(20, 27, 44, 0.75);
  --glass-surface-subtle: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(0, 240, 255, 0.3);
  --glass-border-focus: rgba(0, 240, 255, 0.5);
  
  /* Accent Colors */
  --accent-cyan: #00f0ff;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  
  /* Text Colors */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;

  /* Header Gradient */
  --header-grad-start: rgba(7, 9, 14, 0.95);
  --header-grad-mid: rgba(7, 9, 14, 0.55);
  --header-grad-end: rgba(7, 9, 14, 0);

  /* Message Bubbles */
  --msg-bubble-in-bg: rgba(22, 28, 44, 0.75);
  --msg-bubble-in-border: rgba(255, 255, 255, 0.08);
  --msg-bubble-in-text: #f3f4f6;
  --msg-bubble-out-bg: linear-gradient(135deg, rgba(0, 190, 255, 0.28) 0%, rgba(0, 130, 240, 0.22) 100%);
  --msg-bubble-out-border: rgba(0, 240, 255, 0.3);
  --msg-bubble-out-text: #ffffff;

  /* Shadows */
  --shadow-sm: 0 2px 8px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.45);
  --shadow-glass: 0 20px 50px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  --shadow-glow-cyan: 0 0 25px rgba(0, 240, 255, 0.25);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-canvas: #f1f5f9;
  --bg-canvas-rgb: 241, 245, 249;
  --bg-mesh-1: rgba(0, 180, 255, 0.15);
  --bg-mesh-2: rgba(168, 85, 247, 0.12);
  --bg-mesh-3: rgba(16, 185, 129, 0.1);
  
  --glass-surface: rgba(255, 255, 255, 0.72);
  --glass-surface-elevated: rgba(255, 255, 255, 0.9);
  --glass-surface-subtle: rgba(0, 0, 0, 0.04);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 160, 220, 0.4);
  --glass-border-focus: rgba(0, 160, 220, 0.6);
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  --header-grad-start: rgba(241, 245, 249, 0.95);
  --header-grad-mid: rgba(241, 245, 249, 0.55);
  --header-grad-end: rgba(241, 245, 249, 0);

  --msg-bubble-in-bg: rgba(255, 255, 255, 0.88);
  --msg-bubble-in-border: rgba(0, 0, 0, 0.08);
  --msg-bubble-in-text: #0f172a;
  --msg-bubble-out-bg: linear-gradient(135deg, rgba(0, 170, 240, 0.22) 0%, rgba(0, 200, 255, 0.14) 100%);
  --msg-bubble-out-border: rgba(0, 170, 240, 0.35);
  --msg-bubble-out-text: #0f172a;

  --shadow-sm: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.12);
  --shadow-glass: 0 20px 50px 0 rgba(0, 0, 0, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

/* System Auto Theme (matches prefers-color-scheme) */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg-canvas: #f1f5f9;
    --bg-canvas-rgb: 241, 245, 249;
    --bg-mesh-1: rgba(0, 180, 255, 0.15);
    --bg-mesh-2: rgba(168, 85, 247, 0.12);
    --bg-mesh-3: rgba(16, 185, 129, 0.1);
    
    --glass-surface: rgba(255, 255, 255, 0.72);
    --glass-surface-elevated: rgba(255, 255, 255, 0.9);
    --glass-surface-subtle: rgba(0, 0, 0, 0.04);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-hover: rgba(0, 160, 220, 0.4);
    --glass-border-focus: rgba(0, 160, 220, 0.6);
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-subtle: #94a3b8;

    --header-grad-start: rgba(241, 245, 249, 0.95);
    --header-grad-mid: rgba(241, 245, 249, 0.55);
    --header-grad-end: rgba(241, 245, 249, 0);

    --msg-bubble-in-bg: rgba(255, 255, 255, 0.88);
    --msg-bubble-in-border: rgba(0, 0, 0, 0.08);
    --msg-bubble-in-text: #0f172a;
    --msg-bubble-out-bg: linear-gradient(135deg, rgba(0, 170, 240, 0.22) 0%, rgba(0, 200, 255, 0.14) 100%);
    --msg-bubble-out-border: rgba(0, 170, 240, 0.35);
    --msg-bubble-out-text: #0f172a;

    --shadow-sm: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.12);
    --shadow-glass: 0 20px 50px 0 rgba(0, 0, 0, 0.08), inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
  }
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-canvas);
  color: #f3f4f6;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient Background Light Mesh */
.ambient-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-blob-1 {
  position: absolute;
  top: -15%;
  left: 10%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--bg-mesh-1) 0%, rgba(0, 240, 255, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
  animation: floatSlow 20s infinite alternate ease-in-out;
}

.ambient-blob-2 {
  position: absolute;
  bottom: -20%;
  right: 5%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, var(--bg-mesh-2) 0%, rgba(168, 85, 247, 0) 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: floatSlow 25s infinite alternate-reverse ease-in-out;
}

.ambient-blob-3 {
  position: absolute;
  top: 40%;
  right: 35%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--bg-mesh-3) 0%, rgba(16, 185, 129, 0) 70%);
  border-radius: 50%;
  filter: blur(70px);
  animation: floatSlow 18s infinite alternate ease-in-out;
}

@keyframes floatSlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Glass Surfaces */
.glass-panel {
  background: var(--glass-surface);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

.glass-card {
  background: var(--glass-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card-elevated {
  background: var(--glass-surface-elevated);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
}

.glass-card-subtle {
  background: var(--glass-surface-subtle);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-input {
  background: rgba(13, 18, 29, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #fff;
}

.glass-input:focus {
  outline: none;
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background: rgba(16, 23, 38, 0.85);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
}

/* Glass Header & Floating Tab Bar */
.glass-header {
  background: var(--glass-surface-elevated);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}

/* Gradient Blur Chat Header */
.chat-header-gradient {
  background: linear-gradient(to bottom, var(--header-grad-start) 0%, var(--header-grad-mid) 40%, var(--header-grad-end) 100%) !important;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0) 100%);
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  transition: background 0.3s ease;
}

.chat-header-seamless {
  background: transparent !important;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

.chat-input-bar-floating {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-top: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#messages-list {
  padding-top: calc(4.75rem + env(safe-area-inset-top, 0px)) !important;
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important;
  scroll-behavior: smooth;
}

.glass-bottom-bar {
  background: var(--glass-surface-elevated);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border-top: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  padding-bottom: env(safe-area-inset-bottom, 8px);
}

/* Buttons & Micro-Interactions */
.btn-glass-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22) 0%, rgba(0, 180, 255, 0.12) 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-glass-primary:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35) 0%, rgba(0, 180, 255, 0.22) 100%);
  border-color: rgba(0, 240, 255, 0.7);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}

.btn-glass-primary:active {
  transform: scale(0.97);
}

.btn-glass-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-glass-emerald:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.32) 0%, rgba(5, 150, 105, 0.2) 100%);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.btn-glass-emerald:active {
  transform: scale(0.97);
}

.btn-glass-purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(147, 51, 234, 0.1) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-glass-purple:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.32) 0%, rgba(147, 51, 234, 0.2) 100%);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
}

.btn-glass-purple:active {
  transform: scale(0.97);
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-slide-in {
  animation: slideInUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popModal {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-modal-pop {
  animation: popModal 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Message Bubble Enhancements */
.msg-bubble-out {
  background: var(--msg-bubble-out-bg);
  border: 1px solid var(--msg-bubble-out-border);
  color: var(--msg-bubble-out-text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.msg-bubble-in {
  background: var(--msg-bubble-in-bg);
  border: 1px solid var(--msg-bubble-in-border);
  color: var(--msg-bubble-in-text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

/* Video Note Circle */
.videonote-circle-container {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2.5px solid #00f0ff;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.35);
  background: #000;
}

.videonote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Voice Waveform Visualizer */
.voice-wave-bar {
  width: 3px;
  border-radius: 9999px;
  background: rgba(0, 240, 255, 0.5);
  transition: height 0.08s ease, background-color 0.15s ease;
}
.voice-wave-bar.active {
  background: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

/* Apple-Style Sleek Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.4);
}

/* Floating Toast */
#app-toast {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Status Beacons */
.online-pulse {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-emerald 2s infinite;
}

@keyframes pulse-emerald {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ================= WYSIWYG & Rich Text Styles ================= */
#chat-input[contenteditable="true"]:empty:before {
  content: attr(data-placeholder);
  color: #64748b;
  pointer-events: none;
  display: block;
}

#chat-input[contenteditable="true"] {
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.45;
  padding: 10px 16px;
  overflow-y: auto;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#chat-input[contenteditable="true"]::-webkit-scrollbar {
  width: 4px;
}

#chat-input[contenteditable="true"]::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}

#chat-input blockquote, .msg-bubble-in blockquote, .msg-bubble-out blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding-left: 8px;
  margin: 4px 0;
  color: inherit;
  background: rgba(0, 240, 255, 0.06);
  border-radius: 0 6px 6px 0;
}

#chat-input code, .msg-bubble-in code, .msg-bubble-out code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 0.88em;
  color: inherit;
  border: 1px solid var(--glass-border);
}

#chat-input a, .msg-bubble-in a, .msg-bubble-out a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Floating WYSIWYG Selection Toolbar */
#wysiwyg-toolbar {
  position: fixed;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(11, 15, 26, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 240, 255, 0.2);
  transform: translate(-50%, -100%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

#wysiwyg-toolbar.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -100%) scale(1);
}

.wysiwyg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wysiwyg-btn:hover {
  color: #00f0ff;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.08);
}

.wysiwyg-btn:active {
  transform: scale(0.95);
}

.wysiwyg-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
}

/* Reply jump flash pulse */
.msg-highlight-pulse {
  animation: msg-pulse 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes msg-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.8), inset 0 0 20px rgba(0, 240, 255, 0.4);
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 30px 4px rgba(0, 240, 255, 0.5), inset 0 0 15px rgba(0, 240, 255, 0.3);
  }
  100% {
    box-shadow: none;
    transform: scale(1);
  }
}

/* ================= Apple-Style Segmented Control & iOS Toggle Switch ================= */
.theme-segmented-control {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

.theme-segment-btn {
  color: var(--text-muted);
}

.theme-segment-btn:hover {
  color: var(--text-main);
}

.theme-segment-btn.active {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.25);
}

.ios-switch {
  transition: background-color 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ================= Auth Tabs Styling ================= */
.auth-tabs-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
}

.auth-tab-btn {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tab-btn:hover {
  color: var(--text-main);
}

.auth-tab-btn.active {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.15);
}

/* ================= Floating Input Mode Hint Popup (Telegram / WhatsApp style) ================= */
.input-mode-hint-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 12px;
  padding: 7px 13px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 500;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 40;
  max-width: 270px;
  text-align: center;
  line-height: 1.35;
}

[data-theme="light"] .input-mode-hint-popup,
html:not(.dark) .input-mode-hint-popup {
  background: rgba(28, 28, 30, 0.94) !important;
  color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}

/* ================= Destructive Button Styling ================= */
.btn-destructive {
  color: #FF3B30 !important;
  background: rgba(255, 59, 48, 0.1) !important;
  border: 1px solid rgba(255, 59, 48, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-destructive:hover {
  background: rgba(255, 59, 48, 0.18) !important;
  border-color: rgba(255, 59, 48, 0.45) !important;
  transform: translateY(-1px);
}

.btn-destructive:active {
  transform: scale(0.98);
}

/* ================= Onboarding Carousel Styling ================= */
.onboarding-dot {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-dot.active {
  background: #00f0ff;
  width: 24px;
  border-radius: 9999px;
}

[data-theme="light"] .onboarding-dot,
html:not(.dark) .onboarding-dot {
  background: rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .onboarding-dot.active,
html:not(.dark) .onboarding-dot.active {
  background: #0284c7 !important;
}

/* ================= Avatar Borders ================= */
.theme-avatar-border {
  border-color: rgba(255, 255, 255, 0.15);
}

/* ================= Light Theme Specific Utility Overrides ================= */
[data-theme="light"] body,
html:not(.dark) body {
  background-color: #f2f2f7 !important;
  color: #1C1C1E !important;
}

[data-theme="light"] *,
html:not(.dark) * {
  text-shadow: none !important;
}

/* Solid non-gradient dark text for all headings & names in Light Mode */
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] .theme-heading,
[data-theme="light"] .theme-section-title,
[data-theme="light"] #my-name,
[data-theme="light"] #chat-header-name,
[data-theme="light"] #peer-modal-name,
html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4,
html:not(.dark) h5,
html:not(.dark) h6,
html:not(.dark) .theme-heading,
html:not(.dark) .theme-section-title,
html:not(.dark) #my-name,
html:not(.dark) #chat-header-name,
html:not(.dark) #peer-modal-name {
  color: #1C1C1E !important;
  font-weight: 700 !important;
  -webkit-text-fill-color: #1C1C1E !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}

[data-theme="light"] .theme-label-text,
html:not(.dark) .theme-label-text {
  color: #1C1C1E !important;
  font-weight: 600;
}

[data-theme="light"] .text-gray-100,
[data-theme="light"] .text-gray-200,
html:not(.dark) .text-gray-100,
html:not(.dark) .text-gray-200 {
  color: #1C1C1E !important;
}

[data-theme="light"] .text-gray-300,
[data-theme="light"] .text-gray-400,
[data-theme="light"] .theme-subtext,
[data-theme="light"] .theme-username,
[data-theme="light"] #my-username,
[data-theme="light"] #chat-header-status,
[data-theme="light"] #peer-modal-username,
[data-theme="light"] #peer-modal-status-text,
html:not(.dark) .text-gray-300,
html:not(.dark) .text-gray-400,
html:not(.dark) .theme-subtext,
html:not(.dark) .theme-username,
html:not(.dark) #my-username,
html:not(.dark) #chat-header-status,
html:not(.dark) #peer-modal-username,
html:not(.dark) #peer-modal-status-text {
  color: #48484a !important;
}

[data-theme="light"] .text-gray-500,
html:not(.dark) .text-gray-500 {
  color: #636366 !important;
}

/* Light Theme Auth Switcher (Вход / Регистрация) */
[data-theme="light"] .auth-tabs-container,
html:not(.dark) .auth-tabs-container {
  background: #E5E5EA !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .auth-tab-btn,
html:not(.dark) .auth-tab-btn {
  color: #636366 !important;
  font-weight: 500;
}

[data-theme="light"] .auth-tab-btn:hover,
html:not(.dark) .auth-tab-btn:hover {
  color: #1C1C1E !important;
}

[data-theme="light"] .auth-tab-btn.active,
html:not(.dark) .auth-tab-btn.active {
  background: #ffffff !important;
  color: #1C1C1E !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
  font-weight: 600 !important;
}

/* Light Theme Segmented Control */
[data-theme="light"] .theme-segmented-control,
html:not(.dark) .theme-segmented-control {
  background: #E5E5EA !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .theme-segment-btn,
html:not(.dark) .theme-segment-btn {
  color: #636366 !important;
}

[data-theme="light"] .theme-segment-btn.active,
html:not(.dark) .theme-segment-btn.active {
  background: #ffffff !important;
  color: #1C1C1E !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Light Theme Avatar & Badge Borders */
[data-theme="light"] .theme-avatar-border,
html:not(.dark) .theme-avatar-border {
  border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .theme-badge,
html:not(.dark) .theme-badge {
  background-color: #E5E5EA !important;
  color: #1C1C1E !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Light Theme Headers on ALL Screens */
[data-theme="light"] .glass-header,
html:not(.dark) .glass-header {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .glass-header h1,
[data-theme="light"] .glass-header h2,
[data-theme="light"] .glass-header h3,
[data-theme="light"] .glass-header span,
html:not(.dark) .glass-header h1,
html:not(.dark) .glass-header h2,
html:not(.dark) .glass-header h3,
html:not(.dark) .glass-header span {
  color: #1C1C1E !important;
  font-weight: 700 !important;
}

[data-theme="light"] .glass-header button,
html:not(.dark) .glass-header button {
  color: #1C1C1E !important;
}

[data-theme="light"] .glass-header button:hover,
html:not(.dark) .glass-header button:hover {
  background-color: rgba(0, 0, 0, 0.06) !important;
  color: #000000 !important;
}

/* Inputs in Light Mode */
[data-theme="light"] .glass-input,
html:not(.dark) .glass-input {
  background: #ffffff !important;
  color: #1C1C1E !important;
  border-color: rgba(0, 0, 0, 0.14) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .glass-input:focus,
html:not(.dark) .glass-input:focus {
  background: #ffffff !important;
  color: #1C1C1E !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Cards & Modals in Light Mode */
[data-theme="light"] .glass-card,
[data-theme="light"] .glass-card-elevated,
html:not(.dark) .glass-card,
html:not(.dark) .glass-card-elevated {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .bg-\[\#07090e\],
[data-theme="light"] .bg-slate-950,
[data-theme="light"] .bg-slate-900,
html:not(.dark) .bg-\[\#07090e\],
html:not(.dark) .bg-slate-950,
html:not(.dark) .bg-slate-900 {
  background-color: #f2f2f7 !important;
}

[data-theme="light"] #peer-profile-modal,
[data-theme="light"] #settings-modal,
[data-theme="light"] #calls-modal,
[data-theme="light"] #active-call-overlay,
[data-theme="light"] #auth-screen,
[data-theme="light"] #admin-modal,
html:not(.dark) #peer-profile-modal,
html:not(.dark) #settings-modal,
html:not(.dark) #calls-modal,
html:not(.dark) #active-call-overlay,
html:not(.dark) #auth-screen,
html:not(.dark) #admin-modal {
  background: #f2f2f7 !important;
  background-color: #f2f2f7 !important;
}

/* Message Bubbles in Light Mode */
[data-theme="light"] .msg-bubble-in,
[data-theme="light"] .msg-bubble-in *,
[data-theme="light"] .msg-bubble-out,
[data-theme="light"] .msg-bubble-out *,
[data-theme="light"] #messages-list *,
[data-theme="light"] #chat-input,
[data-theme="light"] #chat-input *,
html:not(.dark) .msg-bubble-in,
html:not(.dark) .msg-bubble-in *,
html:not(.dark) .msg-bubble-out,
html:not(.dark) .msg-bubble-out *,
html:not(.dark) #messages-list *,
html:not(.dark) #chat-input,
html:not(.dark) #chat-input * {
  color: #1C1C1E !important;
}

[data-theme="light"] .msg-bubble-in a,
[data-theme="light"] .msg-bubble-out a,
[data-theme="light"] #chat-input a,
html:not(.dark) .msg-bubble-in a,
html:not(.dark) .msg-bubble-out a,
html:not(.dark) #chat-input a {
  color: #007AFF !important;
}

[data-theme="light"] .msg-bubble-in blockquote,
[data-theme="light"] .msg-bubble-out blockquote,
[data-theme="light"] #chat-input blockquote,
html:not(.dark) .msg-bubble-in blockquote,
html:not(.dark) .msg-bubble-out blockquote,
html:not(.dark) #chat-input blockquote {
  border-left-color: #007AFF !important;
  background: rgba(0, 122, 255, 0.08) !important;
  color: #1C1C1E !important;
}

[data-theme="light"] .msg-bubble-in code,
[data-theme="light"] .msg-bubble-out code,
[data-theme="light"] #chat-input code,
html:not(.dark) .msg-bubble-in code,
html:not(.dark) .msg-bubble-out code,
html:not(.dark) #chat-input code {
  background: #E5E5EA !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #1C1C1E !important;
}

