/* ==========================================================================
   [ hush ] Private Messenger - Custom Monochromatic Nothing OS Styles
   Featuring OLED Pure Black, Shimmering Siri Aura Mist, and Apple Glassmorphism.
   ========================================================================== */

:root {
  --bg-oled: #000000; /* Pure deep OLED pitch black */
  --bg-card: rgba(14, 14, 18, 0.52); /* Base fallback */
  --bg-input: rgba(0, 0, 0, 0.58); /* Deep carved translucent glass inputs */
  --border-graphite: rgba(255, 255, 255, 0.07); /* Crisp crystal edge */
  --border-focus: rgba(255, 255, 255, 0.25); /* Solid white boundary focus */
  
  --text-white: #ffffff;
  --text-gray: #71717a;
  --text-dark: #000000;
  --danger-red: #ef4444;
  
  --font-premium: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-code: 'Space Mono', monospace;
  
  --timing-smooth: cubic-bezier(0.16, 1, 0.3, 1); /* Apple-grade ease out */
  --timing-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* Physical rebound bounce */
}

/* ==========================================================================
   GLOBAL RESET & LOWERCASE RULES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  text-transform: lowercase; /* strict lowercase globally */
}

body {
  background-color: var(--bg-oled);
  color: var(--text-white);
  font-family: var(--font-premium);
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  position: relative;
}

button, input, select, textarea, option {
  font-family: var(--font-premium);
  font-weight: 700;
  color: inherit;
  outline: none;
}

/* ==========================================================================
   CINEMATIC GRAIN OVERLAY
   ========================================================================== */
.noise-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  filter: url(#hushNoise);
  opacity: 0.015; /* Screen dither texture */
}

/* ==========================================================================
   OLED PURE BLACK BACKGROUND & SHIMMERING 5-SOURCE CSS AURA
   ========================================================================== */
.cyber-background-container {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1;
  background-color: var(--bg-oled);
  overflow: hidden;
}

/* Outer Fading Container: Dedicated ONLY to perfect 3.0s fade in and out */
.glow-wrapper {
  position: absolute;
  top: 50%; left: 50%;
  width: 480px; height: 480px;
  transform: translate(-50%, -50%) scale(0.85);
  
  /* CRITICAL: Absolutely black (invisible) when quiet */
  opacity: 0;
  
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
  
  /* Standard premium CSS Blur processing on GPU */
  filter: blur(80px);
  mix-blend-mode: screen;
  
  /* Flawless, conflict-free 3.0s fading transitions */
  transition: transform 3.0s var(--timing-smooth), 
              opacity 3.0s var(--timing-smooth);
}

/* When active or typing, swell the aura and fade in with perfect transition */
.cyber-background-container.typing .glow-wrapper {
  opacity: 0.82;
  transform: translate(-50%, -50%) scale(1.04);
}

/* Inner Rotator: Dedicated ONLY to continuous rotation and shimmer */
.glow-rotator {
  width: 100%;
  height: 100%;
  position: relative;
  transform-origin: center center;
  will-change: transform;
}

/* Rotation is only calculated on GPU during active typing session */
.cyber-background-container.typing .glow-rotator {
  animation: siriDrift 16s infinite linear;
}

/* Slow, organic rotational drift + dynamic brightness breathing (Shimmer) */
@keyframes siriDrift {
  0% { 
    transform: rotate(0deg);
    filter: brightness(1);
  }
  25% {
    filter: brightness(1.22);
  }
  50% { 
    transform: rotate(180deg);
    filter: brightness(0.85);
  }
  75% {
    filter: brightness(1.18);
  }
  100% { 
    transform: rotate(360deg);
    filter: brightness(1);
  }
}

/* Symmetric, offset circular blobs representing full spectrum sources */
.glow-spot {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.spot-blue {
  top: 15px; left: 65px;
  width: 170px; height: 170px;
  background: rgb(59, 130, 246);
}
.spot-purple {
  top: 15px; right: 65px;
  width: 160px; height: 160px;
  background: rgb(168, 85, 247);
}
.spot-rose {
  bottom: 55px; right: 55px;
  width: 155px; height: 155px;
  background: rgb(244, 63, 94);
}
.spot-green {
  bottom: 55px; left: 55px;
  width: 165px; height: 165px;
  background: rgb(16, 185, 129);
}
.spot-yellow {
  top: 50%; left: 50%;
  width: 170px; height: 170px;
  transform: translate(-50%, -50%);
  background: rgb(245, 158, 11);
  z-index: -1;
}

.cyber-vignette {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.98) 100%);
  pointer-events: none;
  z-index: 3;
}

/* ==========================================================================
   MAIN APP CONTAINER
   ========================================================================== */
.monolit-app {
  position: relative;
  z-index: 4;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

/* ==========================================================================
   AUTHENTICATION GLASS CARD (Apple Glassmorphism)
   ========================================================================== */
.auth-deck {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeInAuth 0.5s var(--timing-smooth);
}

@keyframes fadeInAuth {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card {
  position: relative;
  width: 360px;
  
  /* Physical glass card with horizontal face gradient */
  background: linear-gradient(135deg, rgba(20, 20, 26, 0.68) 0%, rgba(8, 8, 10, 0.48) 100%);
  
  /* Physical glass backdrop filters */
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  
  border-radius: 24px;
  padding: 44px 34px;
  border: 1px solid var(--border-graphite);
  
  /* Top inner highlight representing polished bevel glass edge reflection */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 
              0 30px 80px rgba(0, 0, 0, 0.95);
              
  display: flex;
  flex-direction: column;
  transition: all 0.4s var(--timing-smooth);
}

/* Focused glow effect */
.auth-card:focus-within {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 
              0 30px 90px rgba(255, 255, 255, 0.01),
              0 30px 80px rgba(0, 0, 0, 0.95);
}

.brand-title {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -1.3px;
  text-align: center;
  
  /* Premium metal glaze text gradient */
  background: linear-gradient(135deg, #ffffff 40%, rgba(255, 255, 255, 0.5) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 9px;
  color: var(--text-gray);
  text-align: center;
  margin-top: 4px;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   ELASTIC TAB PILL SELECTOR (Rounded capsule)
   ========================================================================== */
.auth-tabs {
  position: relative;
  display: flex;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 30px;
  padding: 3px;
  margin-bottom: 26px;
  z-index: 1;
}

.tab-slider-bg {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: #ffffff;
  border-radius: 26px;
  z-index: -1;
  transform: translateX(0);
  
  /* Super satisfying physics rebound bounce + bright halo shadow */
  transition: transform 0.55s var(--timing-spring);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.35);
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-gray);
  font-size: 11px;
  padding: 9px 0;
  border-radius: 26px;
  cursor: pointer;
  z-index: 2;
  letter-spacing: 0.3px;
  transition: color 0.4s var(--timing-smooth);
}

.auth-tab-btn.active {
  color: var(--text-dark);
}

/* ==========================================================================
   VERTICAL STACKED CROSS-FADE VIEWPORT (Prevents squishing inputs)
   ========================================================================== */
.auth-carousel {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.auth-view {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.5s var(--timing-smooth), transform 0.5s var(--timing-smooth);
  z-index: 1;
}

/* Active slide becomes relative so container height adapts dynamically */
.auth-view.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  z-index: 2;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-field-group label {
  font-size: 9px;
  color: var(--text-gray);
  letter-spacing: 0.5px;
  font-weight: 800;
  padding-left: 2px;
}

.input-field-group input {
  background-color: var(--bg-input);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-graphite);
  border-radius: 12px; /* Sleeker rounded profiles */
  color: #fff;
  padding: 12px 14px;
  font-size: 12.5px;
  
  /* Beautiful glass carved-in depth shadows */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
  transition: all 0.3s var(--timing-smooth);
}

.input-field-group input:focus {
  border-color: var(--border-focus);
  background-color: rgba(0, 0, 0, 0.6);
  transform: translateY(-1px);
  
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.75), 
              inset 0 1px 0 rgba(255, 255, 255, 0.03), 
              0 0 15px rgba(255, 255, 255, 0.02);
}

.font-mono {
  font-family: var(--font-code) !important;
  letter-spacing: 0.5px;
}

/* Luxury white ceramic capsule button with spring compression on click */
.auth-submit-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f6 100%);
  color: #000000;
  border: none;
  border-radius: 30px; /* Fully rounded capsule */
  padding: 13px;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.4s var(--timing-smooth);
  margin-top: 10px;
  box-shadow: 0 5px 16px rgba(255, 255, 255, 0.12);
}

.auth-submit-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 255, 255, 0.28);
}

.auth-submit-btn:active {
  transform: translateY(0) scale(0.95); /* Rebound compression click */
}

/* ==========================================================================
   2FA QR FRAME WITH BOUNCE ZOOM
   ========================================================================== */
.qr-setup-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.qr-instructions {
  font-size: 10.5px;
  color: var(--text-gray);
  line-height: 1.45;
  text-align: center;
  margin-bottom: 12px;
}

.cyber-qr-wrapper {
  background: #ffffff;
  border-radius: 14px;
  padding: 12px;
  width: 146px;
  height: 146px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  
  /* Premium springy scale pop */
  animation: qrZoom 0.65s var(--timing-spring) both;
}

@keyframes qrZoom {
  from { transform: scale(0.8) rotate(-4deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.real-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.qr-secret-label {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-graphite);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sec-lbl {
  font-size: 9px;
  color: var(--text-gray);
}

.sec-val {
  font-size: 10px;
  color: #fff;
  font-weight: 800;
}

/* ==========================================================================
   MESSENGER CHAT DECK (SPLIT-PANE DIRECT MESSENGER LAYOUT)
   ========================================================================== */
.chat-deck {
  width: 100vw;
  height: 100vh;
  display: flex;
  animation: fadeInChat 0.6s var(--timing-smooth);
}

.chat-deck.hidden, .auth-deck.hidden {
  display: none !important;
}

.messenger-split-pane {
  display: flex;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* ==========================================================================
   LEFT SIDEBAR: SEARCH & DIRECTORIES
   ========================================================================== */
.chat-sidebar {
  width: 290px;
  height: 100%;
  background: rgba(10, 10, 12, 0.45);
  backdrop-filter: blur(25px) saturate(140%);
  -webkit-backdrop-filter: blur(25px) saturate(140%);
  border-right: 1px solid var(--border-graphite);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

/* Current User Profile Card */
.profile-card {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar-container {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s var(--timing-smooth);
  overflow: visible;
}

.profile-avatar-container:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.user-avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-image.hidden {
  display: none !important;
}

.user-avatar-placeholder {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
}

.user-avatar-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981; /* emerald online */
  border: 1.5px solid #000000;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  z-index: 10;
}

.profile-nick {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.ping-latency {
  font-family: var(--font-code);
  font-size: 9.5px;
  color: var(--text-gray);
}

/* Search input wrapper */
.sidebar-search-wrapper {
  padding: 16px 20px;
}

#userSearchInput {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-graphite);
  border-radius: 30px;
  color: #fff;
  padding: 10px 16px;
  font-size: 11.5px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: all 0.3s var(--timing-smooth);
}

#userSearchInput:focus {
  border-color: var(--border-focus);
  background-color: rgba(0, 0, 0, 0.65);
}

/* Sidebar lists scroll-feed */
.sidebar-contacts-section {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Contacts Directory Rows */
.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s var(--timing-smooth);
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.02);
}

.contact-item.active {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.04);
}

.contact-name-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-avatar-container {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.contact-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.contact-avatar-placeholder {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
}

.contact-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1.5px solid #08080a;
  z-index: 10;
  transition: all 0.3s var(--timing-smooth);
}

.contact-status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.contact-item.active .contact-status-dot {
  border-color: #1a1a22;
}

.contact-name {
  font-size: 12px;
  font-weight: 700;
  color: #e4e4e7;
}

/* Direct notifications dot */
.contact-badge-unread {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--danger-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   RIGHT MAIN PANEL: MESSAGES STREAM
   ========================================================================== */
.chat-main {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
  z-index: 5;
}

.chat-header {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-graphite);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0.2);
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.active-node-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}

.active-node-hash {
  font-family: var(--font-code);
  font-size: 9px;
  color: var(--text-gray);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.text-action-btn {
  background: transparent;
  border: none;
  color: var(--text-gray);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
}

.text-action-btn:hover {
  color: #fff;
}

.text-action-btn.logout {
  color: var(--danger-red);
  opacity: 0.7;
}

.text-action-btn.logout:hover {
  opacity: 1;
}

/* Timeline Feed */
.timeline-container {
  flex: 1;
  overflow-y: auto;
  padding: 36px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.message-timeline {
  width: 100%;
  max-width: 680px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Home Welcome Screen Panel (Strictly Typographic Minimalistic logo replacing emojis) */
.timeline-welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 80px 40px;
  opacity: 0.85;
}

.welcome-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.welcome-logo .logo-dot {
  width: 5px;
  height: 5px;
  background: #ffffff;
  border-radius: 50%;
}

.welcome-logo .logo-line {
  width: 32px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.welcome-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-bottom: 8px;
  text-transform: lowercase;
}

.welcome-desc {
  font-size: 11.5px;
  color: var(--text-gray);
  line-height: 1.6;
  max-width: 330px;
  text-align: center;
}

/* System Notifications */
.timeline-event {
  font-family: var(--font-code);
  font-size: 9.5px;
  color: var(--text-gray);
  align-self: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.01);
  padding-bottom: 4px;
  margin: 6px 0;
  display: flex;
  gap: 8px;
}

.timeline-event.success {
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.03);
}

.ev-time {
  opacity: 0.5;
}

/* Dialogue entries with clean bounce slides */
.timeline-message {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  max-width: 75%;
  animation: springSlide 0.55s var(--timing-smooth) both;
}

@keyframes springSlide {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.timeline-message.received {
  align-self: flex-start;
}

.timeline-message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar-container {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.msg-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.msg-avatar-img.hidden {
  display: none !important;
}

.msg-avatar-placeholder {
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
}

.msg-balloon {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--text-gray);
  margin-bottom: 1px;
}

.received .msg-meta-row { justify-content: flex-start; }
.sent .msg-meta-row { justify-content: flex-end; }

.msg-sender {
  font-weight: 800;
}

.msg-text-bubble {
  padding: 12px 18px;
  font-size: 12.5px;
  line-height: 1.45;
}

/* Sleek matte white chat balloon for sent items */
.sent .msg-text-bubble {
  background-color: #ffffff;
  color: #000000;
  font-weight: 700;
  border-radius: 14px;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.02);
}

/* Sleek graphite translucent glass bubble for received items */
.received .msg-text-bubble {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-radius: 14px;
  border-bottom-left-radius: 2px;
}

/* Minimal graphite timer text badge */
.destruct-countdown-badge {
  font-family: var(--font-code) !important;
  font-size: 9px;
  color: var(--text-gray);
  opacity: 0.8;
  font-weight: 700;
  letter-spacing: 0.1px;
}

/* ==========================================================================
   CENTERED PILL INPUT CONTAINER (Gemini search bar style)
   ========================================================================== */
.pill-input-wrapper {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: opacity 0.5s var(--timing-smooth);
}

.pill-input-wrapper.hidden {
  display: none !important;
}

.pill-input-card {
  width: 100%;
  background-color: rgba(22, 22, 30, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-graphite);
  border-radius: 100px;
  padding: 8px 12px 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
}

.pill-input-card:focus-within {
  border-color: var(--border-focus);
  background-color: rgba(22, 22, 30, 0.95);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.02);
}

.pill-action-btn {
  background: transparent;
  border: 1px solid var(--border-graphite);
  color: var(--text-gray);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.pill-action-btn:hover {
  border-color: #fff;
  color: #fff;
}

#messageInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13.5px;
  padding: 6px 0;
}

#messageInput::placeholder {
  color: var(--text-gray);
}

.pill-send-btn {
  background-color: #ffffff;
  color: #000000;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--timing-smooth);
}

.pill-send-btn:hover {
  background-color: #e5e5e5;
  transform: scale(1.05);
}

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

/* Auto-destruct drop-down row below input card */
.destruct-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.destruct-lbl {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-gray);
  letter-spacing: 0.2px;
}

.destruct-select {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.destruct-select option {
  background-color: var(--bg-oled);
  color: #fff;
}

/* ==========================================================================
   WEBRTC CALL OVERLAY MODAL (Premium Glassmorphism)
   ========================================================================== */
.call-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s var(--timing-smooth);
}

.call-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.call-card {
  width: 90%;
  max-width: 600px;
  background: linear-gradient(135deg, rgba(20, 20, 26, 0.72) 0%, rgba(8, 8, 10, 0.52) 100%);
  border: 1px solid var(--border-graphite);
  border-radius: 28px;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 
              0 30px 80px rgba(0, 0, 0, 0.95);
  animation: scaleUpCall 0.6s var(--timing-spring) both;
}

@keyframes scaleUpCall {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.call-avatars-link {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  position: relative;
}

.call-avatar-container-large {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.3s;
}

#callPartnerAvatar {
  border-color: #ffffff;
  animation: breathGlowLarge 2.5s infinite ease-in-out;
}

@keyframes breathGlowLarge {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.25);
    transform: scale(1.04);
  }
}

.call-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.call-avatar-img.hidden {
  display: none !important;
}

.call-avatar-placeholder {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
}

.call-avatar-link-line {
  width: 24px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--border-graphite) 0%, #ffffff 100%);
  opacity: 0.7;
}

.call-minimize-btn {
  position: absolute;
  top: 32px;
  right: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-graphite);
  color: var(--text-gray);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--timing-smooth);
  z-index: 20;
}

.call-minimize-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* Floating Call Island (Apple Style) */
.call-island {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  min-width: 270px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(25px) saturate(140%);
  -webkit-backdrop-filter: blur(25px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 200px;
  padding: 8px 12px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.75),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 10001;
  animation: slideDownIsland 0.5s var(--timing-spring) both;
  transition: all 0.3s var(--timing-smooth);
}

.call-island.hidden {
  display: none !important;
  opacity: 0;
  transform: translateX(-50%) translateY(-20px) scale(0.9);
  pointer-events: none;
}

@keyframes slideDownIsland {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.island-avatar-container {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-graphite);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.island-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.island-avatar-img.hidden {
  display: none !important;
}

.island-avatar-placeholder {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
}

.island-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.island-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.island-status {
  font-size: 8.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.2px;
}

/* Premium Voice-synchronized sound wave equalizers */
.island-waves {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 12px;
  margin-right: 2px;
}

.wave-bar {
  width: 2px;
  height: 12px;
  background-color: #ffffff;
  border-radius: 2px;
  transform: scaleY(0.15);
  transform-origin: bottom;
  transition: transform 0.05s ease-out;
}

.island-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.island-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-graphite);
  color: #fff;
  transition: all 0.25s var(--timing-smooth);
}

.island-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.island-btn.mute.muted {
  background: var(--danger-red);
  border-color: var(--danger-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.island-btn.hangup {
  background: var(--danger-red);
  border-color: var(--danger-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.island-btn.hangup:hover {
  background: #f87171;
  border-color: #f87171;
}

.island-btn.expand {
  background: transparent;
  color: var(--text-gray);
}

.island-btn.expand:hover {
  color: #fff;
}

.call-user-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 8px;
}

.call-status-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-gray);
  margin-bottom: 36px;
  letter-spacing: 0.5px;
}

.call-actions-row {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.call-circle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s var(--timing-smooth);
}

.call-circle-btn.mute {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.call-circle-btn.mute.muted {
  background: var(--danger-red);
  color: #fff;
  border-color: var(--danger-red);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.call-circle-btn.hangup {
  background: var(--danger-red);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.call-circle-btn:hover {
  transform: scale(1.08);
}

.call-circle-btn.mute:hover {
  background: rgba(255, 255, 255, 0.15);
}

.call-circle-btn.hangup:hover {
  background: #f87171;
}

/* Screen Share Button */
.call-circle-btn.screen-share {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.call-circle-btn.screen-share:hover {
  background: rgba(255, 255, 255, 0.15);
}

.call-circle-btn.screen-share.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.45);
}

/* Dual-Panel Screen Share Video Wrapper */
.call-video-wrapper {
  width: 100%;
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  position: relative;
}

.call-video-wrapper.hidden {
  display: none !important;
}

.call-video-box {
  position: relative;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-graphite);
  border-radius: 12px;
  overflow: hidden;
}

.call-video-box.remote-video {
  flex: 3;
  aspect-ratio: 16 / 9;
}

.call-video-box.local-video {
  flex: 1;
  aspect-ratio: 16 / 9;
  max-width: 160px;
  opacity: 0.85;
}

.call-video-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.video-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: lowercase;
  pointer-events: none;
}

.video-fullscreen-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
}

.call-video-box.remote-video:hover .video-fullscreen-btn {
  opacity: 1;
}

.video-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.video-watermark-strip {
  position: absolute;
  bottom: -16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.1);
  text-transform: lowercase;
  pointer-events: none;
}

/* Active Speaking Avatar Glow */
.call-avatar-container-large.speaking {
  border-color: #fff !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(255, 255, 255, 0.15) !important;
  animation: none !important;
}

/* Draggable Island */
.call-island {
  cursor: grab;
  user-select: none;
}

.call-island:active {
  cursor: grabbing;
}

.call-island.dragging {
  transition: none !important;
}
