/* AegisChat - Modern Glassmorphism & Enterprise Privacy Responsive Theme */
:root {
  --bg-dark: #070a13;
  --panel-bg: rgba(15, 23, 42, 0.88);
  --panel-border: rgba(255, 255, 255, 0.1);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.45);
  --accent-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(10, 15, 28, 0.7);
  --msg-own: linear-gradient(135deg, #6366f1, #4f46e5);
  --msg-other: rgba(30, 41, 59, 0.88);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --font-main: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --touch-min-height: 44px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

/* CUSTOM SCROLLBARS FOR CLEAN NATURAL SCROLLING */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 15, 28, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Lighting */
.app-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.35;
  animation: pulseGlow 10s ease-in-out infinite alternate;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -120px;
  left: -120px;
}

.glow-2 {
  width: 450px;
  height: 450px;
  background: var(--accent-cyan);
  bottom: -120px;
  right: -120px;
}

.glow-3 {
  width: 350px;
  height: 350px;
  background: var(--accent-pink);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(1.1); opacity: 0.45; }
}

.hidden { display: none !important; }

/* GLOBAL BANNER */
.global-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--accent);
  backdrop-filter: blur(12px);
  font-size: 13px;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  text-transform: uppercase;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--accent-cyan);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.4s ease 3.5s forwards;
  max-width: 360px;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  min-width: 0;
  min-height: 0;
}

/* LANDING PAGE STYLES */
.landing-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Landing Header / Navbar */
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 24px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px var(--accent-glow);
  flex-shrink: 0;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-btn {
  padding: 10px 18px;
  font-size: 13px;
  border-radius: 12px;
  min-height: var(--touch-min-height);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 20px 30px 20px;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 24px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px auto;
  font-weight: 400;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cta-btn {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
  min-height: 50px;
}

/* Features Section & Grid */
.features-section {
  padding: 20px 0 40px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  padding: 28px;
  transition: transform 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.35);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.icon-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.icon-pink {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-pink);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.feature-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Landing Footer */
.landing-footer {
  padding: 24px 0 20px 0;
  border-top: 1px solid var(--panel-border);
  margin-top: 2rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
  gap: 1rem;
}

.footer-branding {
  font-weight: 500;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--accent-cyan);
  text-decoration: none;
}

.footer-github-btn {
  padding: 8px 16px;
  font-size: 12px;
  min-height: var(--touch-min-height);
}

/* INPUTS, BUTTONS & FORMS */
.form-group {
  text-align: left;
  margin-bottom: 16px;
  min-width: 0;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

input, select, textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text-main);
  padding: 12px 16px;
  font-size: 15px;
  min-height: var(--touch-min-height);
  outline: none;
  transition: all 0.2s ease;
}

select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 14px top 50%;
  background-size: 10px auto;
  padding-right: 32px;
}

option {
  background: #0f172a;
  color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  min-height: var(--touch-min-height);
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.full-width-btn {
  width: 100%;
}

.style-danger-btn {
  background: linear-gradient(135deg, var(--danger), var(--danger-hover));
  color: white;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.4);
}

.style-danger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.5);
}

.style-danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

.style-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.style-warning {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warning);
}

.style-warning:hover {
  background: rgba(245, 158, 11, 0.15);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 10px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.icon-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.emergency-btn {
  color: #f87171;
}

.emergency-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.status-msg {
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent-cyan);
}

/* SWITCH TOGGLE STYLES */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* APP CONTAINER & MAIN CHAT INTERFACE */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1520px;
  height: 92vh;
  max-height: 940px;
  min-height: 640px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-chat-card {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Mobile Bar */
.mobile-bar {
  display: none;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(10, 15, 28, 0.85);
  flex-shrink: 0;
}

.mobile-bar-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.mobile-brand {
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mobile-only { display: none; }
.desktop-only { display: inline-flex; }

/* Sidebar */
.sidebar {
  width: 360px;
  background: rgba(10, 15, 28, 0.5);
  border-right: 1px solid var(--panel-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: transform 0.3s ease;
  z-index: 10;
  min-width: 0;
  flex-shrink: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--panel-border);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.profile-info { flex: 1; min-width: 0; overflow: hidden; }
.profile-info h3 {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.id-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.dot.online {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.dot.offline {
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
}

.profile-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}

.profile-actions .icon-btn {
  min-width: 34px;
  min-height: 34px;
  padding: 6px;
  border-radius: 8px;
}

.search-bar-wrapper {
  padding: 2px 0;
  width: 100%;
}

.search-bar-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.search-bar-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.section-title-spaced {
  margin-top: 10px;
}

.add-contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-group {
  display: flex;
  gap: 6px;
}

.btn-group .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  min-height: 38px;
  white-space: nowrap;
  justify-content: center;
  align-items: center;
}

.groups-list-container {
  max-height: 150px;
  min-height: 44px;
  overflow-y: auto;
}

.contacts-list {
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  touch-action: manipulation;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.contact-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
}

.contact-item .contact-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.contact-item .contact-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.contact-item .contact-id {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-item .contact-type-tag {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.group-members-checklist {
  max-height: 180px;
  overflow-y: auto;
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-member-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.group-member-checkbox-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.group-member-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.mesh-video-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 10px;
  box-sizing: border-box;
}

.mesh-video-tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 140px;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
}

.mesh-video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mesh-video-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  backdrop-filter: blur(8px);
}

/* PROMPT BAR FOR SAVING CONTACT */
.prompt-bar {
  background: rgba(99, 102, 241, 0.18);
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  animation: slideDown 0.25s ease-out;
  flex-wrap: wrap;
  gap: 10px;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.prompt-text {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c7d2fe;
}

.prompt-actions {
  display: flex;
  gap: 8px;
}

.prompt-btn {
  padding: 6px 14px;
  font-size: 12px;
  width: auto;
  border-radius: 8px;
}

/* Footer / Branding in Sidebar */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.brand-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.brand-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* Chat Viewport */
.chat-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(15, 23, 42, 0.25);
  min-width: 0;
  min-height: 0;
}

.chat-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(10, 15, 28, 0.45);
  backdrop-filter: blur(12px);
  min-height: 68px;
  flex-shrink: 0;
}

.back-nav-btn {
  width: auto;
  padding: 6px 12px;
  font-size: 13px;
  min-height: 38px;
  border-radius: 8px;
}

.active-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-radius: 12px;
  padding: 6px 10px;
  transition: background 0.2s;
  min-width: 0;
  flex: 1;
}

.active-user-info:hover {
  background: rgba(255, 255, 255, 0.06);
}

.active-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#active-contact-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.inline-edit-btn {
  padding: 2px 4px;
  opacity: 0.6;
  flex-shrink: 0;
}

.active-user-info:hover .inline-edit-btn {
  opacity: 1;
}

.status-indicator {
  font-size: 12px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.typing-text {
  font-size: 12px;
  color: var(--accent-cyan);
  font-style: italic;
  animation: pulse 1.2s infinite;
}

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

.lock-icon {
  font-size: 11px;
}

.chat-header-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.sender-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 15, 28, 0.65);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 2px 8px;
}

.sender-select-wrapper label {
  font-size: 11px;
  margin-bottom: 0;
  white-space: nowrap;
  color: var(--text-muted);
}

.sender-dropdown {
  padding: 6px 20px 6px 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  outline: none;
  min-height: 32px;
  cursor: pointer;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.messages-viewport-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages-container {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.msg-bubble {
  max-width: 68%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
  animation: fadeIn 0.2s ease-out;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.msg-bubble.own {
  align-self: flex-end;
  background: var(--msg-own);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.msg-bubble.other {
  align-self: flex-start;
  background: var(--msg-other);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--panel-border);
}

.msg-meta {
  font-size: 10px;
  opacity: 0.75;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.msg-tick {
  font-size: 11px;
  color: #38bdf8;
}

.message-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(10, 15, 28, 0.7);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.input-actions-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.input-actions-left .icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.input-actions-left .icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.18);
}

.send-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  flex-shrink: 0;
}

/* OVERHAUL: SETTINGS MODAL */
.settings-card {
  width: 100%;
  max-width: 680px;
  padding: 28px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 12px;
}

.settings-card-segment {
  background: rgba(10, 15, 28, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-segment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

.settings-segment-header h4 {
  font-size: 15px;
  font-weight: 700;
}

.settings-info-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  border-radius: 12px;
}

.settings-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  color: var(--accent-cyan);
  font-weight: 600;
}

.info-value.font-mono {
  font-family: var(--font-mono);
}

.settings-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-action-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-action-desc strong {
  font-size: 13px;
  color: var(--text-main);
  display: block;
  margin-bottom: 2px;
}

/* OVERHAUL: ADMIN DASHBOARD MODAL */
.admin-dashboard-card {
  width: 100%;
  max-width: 860px;
  padding: 28px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-dashboard-card .modal-header {
  flex-shrink: 0;
}

/* ADMIN DASHBOARD TABS NAVIGATION */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 42px;
  touch-action: manipulation;
}

.admin-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab-btn.active {
  color: white;
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.admin-tab-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-right: 4px;
}

.admin-card-box {
  background: rgba(10, 15, 28, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-card-box h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

/* ADMIN STATS GRID */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.admin-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.admin-toggle-info h4 {
  font-size: 14px;
  font-weight: 700;
}

.admin-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.admin-invite-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form-group {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
}

.inline-btn {
  width: auto;
  min-width: 160px;
}

.admin-banner-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.flex-1 { flex: 1; min-width: 160px; }

/* RESPONSIVE TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 480px;
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
}

.admin-table th {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.status-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-used { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.badge-frozen { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-admin { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-user { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

/* SUPPORT BADGES & DISCLAIMER */
.badge-supporter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.6);
  color: #10b981;
  white-space: nowrap;
}

.support-disclaimer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  margin: 12px 16px 4px 16px;
}

.support-disclaimer-icon {
  font-size: 24px;
}

.support-disclaimer-text strong {
  color: #10b981;
  font-size: 13px;
}

.support-disclaimer-text p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.support-status-badge {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

/* CALL EVENT CHAT WIDGETS */
.call-event-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 2px 0;
  min-width: 180px;
}

.call-event-card.call-widget-missed {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.call-event-card.call-widget-ended {
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.05);
}

.call-event-icon {
  font-size: 20px;
}

.call-event-info {
  display: flex;
  flex-direction: column;
}

.call-event-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
}

.call-event-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* FORENSIC WATERMARK OVERLAY (LEAK PROTECTION) */
.forensic-watermark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
  opacity: 0.12;
  mix-blend-mode: overlay;
  display: flex;
  flex-wrap: wrap;
  align-content: space-around;
  justify-content: space-around;
  user-select: none;
}

.watermark-pattern-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  padding: 16px 20px;
  transform: rotate(-22deg);
  white-space: nowrap;
  letter-spacing: 0.8px;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* EXCLUSIVE FOUNDER & LEAD DEV VIP BADGE FOR ACCOUNT "ARIEN" */
.badge-founder {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.35) 0%, rgba(168, 85, 247, 0.45) 100%);
  border: 1px solid #ffd700;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35), inset 0 0 6px rgba(255, 215, 0, 0.2);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  vertical-align: middle;
  animation: founderGlow 3s ease-in-out infinite alternate;
}

.badge-founder svg {
  width: 13px;
  height: 13px;
  fill: #ffd700;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.8));
}

@keyframes founderGlow {
  0% {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3), inset 0 0 4px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.8);
  }
  100% {
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.6), inset 0 0 8px rgba(255, 215, 0, 0.4);
    border-color: #ffffff;
  }
}

/* BURNER NUMBERS MODAL */
.burner-card {
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.burner-creation-box {
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.burner-creation-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.burner-select { flex: 1; min-width: 180px; }

.burner-list-section { text-align: left; }
.burner-list-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.burner-list {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.burner-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
}

.burner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.burner-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.call-voice-mask-badge {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.call-voice-mask-badge.active {
  background: rgba(236, 72, 153, 0.2);
  border-color: rgba(236, 72, 153, 0.5);
  color: #f472b6;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.3);
}

.call-control-circle.active {
  background: rgba(236, 72, 153, 0.25) !important;
  color: #f472b6 !important;
  border-color: rgba(236, 72, 153, 0.6) !important;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.4);
}

.burner-expiry {
  font-size: 11px;
  color: var(--text-muted);
}

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

/* MODALS OVERLAY & ACCESSIBILITY Z-INDEX */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 8, 15, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  margin: auto;
}

.setup-card {
  display: flex;
  flex-direction: column;
}

.setup-card .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.setup-card .brand h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin: 0;
}

.setup-card .tagline {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.invite-hint-text {
  font-size: 13px;
  line-height: 1.55;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.modal-actions-btn {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-container {
  background: white;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.qr-container img, .qr-container canvas {
  display: block;
  max-width: 200px;
  max-height: 200px;
}

.camera-reader-viewport {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
}

.modal-subtext {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ONBOARDING TOUR MODAL */
.onboarding-card {
  max-width: 480px;
  padding: 32px;
  text-align: center;
}

.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.step-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px auto;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.onboarding-step h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
}

.onboarding-step p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
}

.dot-indicator.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent-cyan);
}

.onboarding-actions {
  display: flex;
  gap: 12px;
}

/* ATTACHMENTS & MEDIA CARDS */
.attach-btn {
  color: var(--text-muted);
  margin-right: 4px;
}

.attach-btn:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.file-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 15, 28, 0.8);
  border: 1px solid var(--panel-border);
  border-bottom: none;
  padding: 10px 16px;
  backdrop-filter: blur(10px);
}

.file-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-cyan);
}

.file-preview-details {
  display: flex;
  flex-direction: column;
}

.file-preview-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.file-preview-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  transition: width 0.2s ease;
}

.media-card {
  margin-top: 6px;
  margin-bottom: 6px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 280px;
}

.media-card-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.2s ease;
}

.media-card-img:hover {
  transform: scale(1.02);
}

.file-attachment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  margin-top: 6px;
  margin-bottom: 6px;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s;
}

.file-attachment-card:hover {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--accent);
}

.file-attachment-icon {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.file-attachment-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-attachment-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-attachment-size {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.file-attachment-dl-btn {
  margin-left: auto;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* Lightbox Modal */
.lightbox-card {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  overflow: hidden;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--panel-border);
}

.lightbox-filename {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.85);
  overflow: auto;
}

.lightbox-body img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
}

/* TAB BLUR SCREENSHOT PROTECTION OVERLAY */
.tab-blur-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  animation: fadeIn 0.2s ease-out;
}

.tab-blur-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  max-width: 320px;
}

.tab-blur-content svg {
  color: var(--accent-cyan);
}

.tab-blur-content h3 {
  font-size: 18px;
  font-weight: 700;
}

.tab-blur-content p {
  font-size: 13px;
  color: var(--text-muted);
}

/* VOICE RECORDING BAR & MIC BUTTON */
.mic-btn {
  color: var(--text-muted);
  transition: all 0.2s;
}

.mic-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

.mic-btn.recording {
  color: white;
  background: var(--danger);
  animation: pulseRed 1s infinite;
}

.voice-recording-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(239, 68, 68, 0.12);
  border-top: 1px solid rgba(239, 68, 68, 0.3);
  backdrop-filter: blur(12px);
}

.voice-recording-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recording-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: pulseRed 1s infinite alternate;
}

@keyframes pulseRed {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}

.recording-timer {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
}

.recording-label {
  font-size: 12px;
  color: var(--text-muted);
}

.voice-recording-actions {
  display: flex;
  gap: 8px;
}

/* CUSTOM VOICE MESSAGE AUDIO PLAYER UI */
.voice-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  margin-top: 6px;
  margin-bottom: 6px;
  min-width: 220px;
}

.voice-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, background-color 0.15s ease;
  touch-action: manipulation;
}

.voice-play-btn:hover {
  transform: scale(1.05);
  background: var(--accent-hover);
}

.voice-player-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

.voice-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.voice-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
  border-radius: 3px;
  transition: width 0.1s linear;
}

.voice-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* VIEW ONCE MEDIA & CALL OVERLAY STYLES */
.view-once-btn {
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.view-once-btn:hover {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
}

.view-once-btn.active {
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
  border: 1px solid rgba(6, 182, 212, 0.5);
}

.view-once-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--accent-cyan);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  margin: 6px 0;
}

.view-once-card:hover {
  background: rgba(6, 182, 212, 0.15);
  transform: translateY(-1px);
}

.view-once-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.view-once-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.view-once-burned {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--panel-border);
}

/* CALL OVERLAY & WEBRTC CALL UI */
.call-action-btn {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}

.call-action-btn:hover {
  background: rgba(6, 182, 212, 0.25);
  color: white;
  transform: scale(1.05);
}

.call-overlay {
  z-index: 3000;
}

.call-card {
  width: 100%;
  max-width: 640px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: rgba(10, 15, 28, 0.95);
}

.call-state-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.call-avatar-pulse {
  position: relative;
  margin: 12px 0;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 26px;
  border-radius: 24px;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 34px;
  border-radius: 30px;
}

.call-header-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.call-security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.call-type-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.call-actions-row {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.call-control-btn, .call-accept-btn, .call-reject-btn {
  width: auto;
  min-width: 130px;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
}

.call-accept-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

.call-accept-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
}

.ringing-pulse {
  animation: ringPulse 1.2s ease-in-out infinite alternate;
}

@keyframes ringPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  100% { transform: scale(1.08); box-shadow: 0 0 0 20px rgba(99, 102, 241, 0); }
}

/* VIDEO VIEWPORT */
.video-viewport-container {
  width: 100%;
  height: 360px;
  background: #000;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--panel-border);
}

.remote-video-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.local-video-pip {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  z-index: 10;
  background: #1e293b;
}

.audio-call-avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 5;
}

.call-active-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.call-timer-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.call-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGlow 1.5s infinite alternate;
}

.call-controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.call-control-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.call-control-circle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.call-control-circle.off {
  background: rgba(239, 68, 68, 0.25);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
}

.call-hangup-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--danger), var(--danger-hover));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5);
  transition: all 0.2s ease;
}

.call-hangup-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

/* RESPONSIVE BREAKPOINTS (MOBILE & TABLET OVERHAUL) */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }

  /* Prevent iOS input auto-zoom by setting font-size to 16px */
  input, select, textarea {
    font-size: 16px !important;
  }

  .landing-container {
    padding: 16px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .app-container {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    padding: 0;
  }

  .glass-card {
    border-radius: 0;
    border: none;
  }

  .main-chat-card {
    flex-direction: column;
  }

  .mobile-bar {
    display: flex;
  }

  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }

  /* 1-Column Mobile Chat view */
  .sidebar {
    width: 100%;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    position: absolute;
    top: 56px;
    left: 0;
    background: rgba(10, 15, 28, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 50;
    border-right: none;
  }

  .sidebar.mobile-hidden {
    display: none;
  }

  .chat-viewport {
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    width: 100%;
  }

  .msg-bubble {
    max-width: 88%;
  }

  /* Bottom Drawer / Fullscreen Modals on Mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    max-height: 90vh;
    max-height: 90dvh;
    padding: 24px 20px;
    animation: slideUpDrawer 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUpDrawer {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .settings-card, .admin-dashboard-card, .burner-card {
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 28px 28px 0 0;
  }

  .admin-invite-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-btn {
    width: 100%;
  }
}

/* TABLET RESPONSIVE ADJUSTMENTS (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .app-container {
    max-width: 98%;
    height: 94vh;
    padding: 10px;
  }
  
  .sidebar {
    width: 320px;
  }
  
  .msg-bubble {
    max-width: 78%;
  }
}

/* LARGE DESKTOP RESPONSIVE ENHANCEMENT (1400px+) */
@media (min-width: 1400px) {
  .app-container {
    max-width: 1600px;
    height: 94vh;
    max-height: 980px;
  }
  
  .sidebar {
    width: 380px;
  }
  
  .messages-container {
    padding: 28px 36px;
  }
}

/* DYNAMIC WATERMARK OVERLAY (ANTI-LEAK PROTECTION) */
.chat-watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.chat-watermark-text {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.12);
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
  white-space: nowrap;
  animation: floatingWatermark 18s ease-in-out infinite alternate;
  letter-spacing: 1px;
}

@keyframes floatingWatermark {
  0% { transform: translate(-25%, -25%) rotate(-22deg); }
  50% { transform: translate(25%, 25%) rotate(-22deg); }
  100% { transform: translate(-25%, -25%) rotate(-22deg); }
}
