/* ==========================================================================
   OmniCall Design System - Obsidian Glass Theme
   ========================================================================== */

:root {
  --bg-primary: #070a12;
  --bg-secondary: #0d121f;
  --bg-tertiary: #141c2e;
  --bg-glass: rgba(16, 24, 40, 0.75);
  --bg-glass-hover: rgba(26, 38, 64, 0.85);
  --bg-glass-card: rgba(18, 26, 45, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-active: rgba(56, 189, 248, 0.4);

  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
  --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.35);
  --shadow-glow-rose: 0 0 20px rgba(244, 63, 94, 0.35);
  --shadow-elevated: 0 20px 40px -15px rgba(0, 0, 0, 0.7);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Frameless Window Titlebar (Electron)
   ========================================================================== */
.window-titlebar {
  height: 38px;
  background: rgba(7, 10, 18, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 1000;
  -webkit-app-region: drag;
}

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

.titlebar-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.titlebar-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #e2e8f0;
}

.titlebar-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-weight: 500;
}

.titlebar-controls {
  display: flex;
  align-items: center;
  -webkit-app-region: no-drag;
}

.window-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

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

.window-btn.close-btn:hover {
  background: var(--accent-rose);
  color: white;
}

/* ==========================================================================
   App Container & View Layouts
   ========================================================================== */
#app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  height: calc(100vh - 38px);
}

.view-section {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-section.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

/* ==========================================================================
   Lobby Screen
   ========================================================================== */
.lobby-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(circle at 50% 10%, #16203a 0%, #070a12 70%);
  overflow-y: auto;
}

.lobby-content {
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}

@media (max-width: 900px) {
  .lobby-content {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}

/* Video Preview Card */
.preview-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-screen {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020408;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror preview */
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 40%, rgba(0,0,0,0.6) 100%);
}

.camera-off-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d121f;
  color: var(--text-dim);
  gap: 12px;
}

.camera-off-indicator svg {
  width: 52px;
  height: 52px;
  opacity: 0.5;
}

.preview-status-pill {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: auto;
}

.preview-action-btn {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.preview-action-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.preview-action-btn.muted,
.preview-action-btn.off {
  background: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: var(--shadow-glow-rose);
}

/* Mic Activity Meter */
.mic-meter-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mic-meter-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mic-meter-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
  border-radius: 4px;
  transition: width 0.05s ease-out;
}

/* Lobby Form Card */
.lobby-form-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lobby-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.lobby-header p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.input-with-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.custom-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.custom-input::placeholder {
  color: var(--text-dim);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

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

/* Engine Mode Selector */
.engine-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.engine-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.engine-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.engine-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.engine-option.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  box-shadow: var(--shadow-glow-cyan);
}

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

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

.primary-btn {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  border: none;
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.5);
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

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

/* ==========================================================================
   In-Call Screen
   ========================================================================== */
#call-view {
  background: #050811;
}

.call-topbar {
  height: 52px;
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 20;
}

.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-info-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

.room-name-display {
  color: #f1f5f9;
  font-weight: 600;
}

.copy-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  transition: var(--transition);
}

.copy-pill-btn:hover {
  color: var(--accent-cyan);
}

.timer-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-emerald);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.badge-unlimited {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  font-weight: 600;
}

.engine-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

/* Call Main Layout */
.call-body {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Stage Area (Videos / Screen Share) */
.stage-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

/* Video Grid */
.video-grid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 16px;
  overflow: hidden;
}

/* Grid layout variations depending on count */
.video-grid[data-count="1"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.video-grid[data-count="1"] .video-tile {
  width: 100%;
  max-width: 1060px;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 180px);
  margin: auto;
}

.video-grid[data-count="2"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  margin: auto;
}

.video-grid[data-count="2"] .video-tile {
  flex: 1;
  max-width: calc(50% - 8px);
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 180px);
}

.video-grid[data-count="3"],
.video-grid[data-count="4"] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1300px;
  max-height: calc(100vh - 160px);
  margin: auto;
}

.video-grid[data-count="3"] .video-tile,
.video-grid[data-count="4"] .video-tile {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
}

.video-grid[data-count="5"],
.video-grid[data-count="6"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-height: calc(100vh - 160px);
  margin: auto;
}

.video-grid[data-count="5"] .video-tile,
.video-grid[data-count="6"] .video-tile {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
}

.video-grid[data-count="7"],
.video-grid[data-count="8"],
.video-grid[data-count="9"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-height: calc(100vh - 160px);
  margin: auto;
}

.video-grid[data-count="10"],
.video-grid[data-count="11"],
.video-grid[data-count="12"] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-height: calc(100vh - 160px);
  margin: auto;
}

/* Video Tile */
.video-tile {
  background: #090e1a;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 16 / 9;
}

.video-tile.speaking {
  border-color: var(--accent-emerald);
  box-shadow: var(--shadow-glow-emerald);
}

.video-tile.pinned {
  border-color: var(--accent-cyan);
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020408;
  display: block;
}

.video-element.mirrored {
  transform: scaleX(-1);
}

.video-tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 40%, rgba(0,0,0,0.6) 100%);
  z-index: 5;
}

.tile-top-row, .tile-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.peer-name-tag {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.tile-avatar-placeholder {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #1e293b 0%, #0a0f1d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2;
}

.avatar-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow-glow-cyan);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.avatar-camera-off-tag {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Secure Context Notice Banner */
.secure-context-banner {
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.25) 0%, rgba(225, 29, 72, 0.2) 100%);
  border-bottom: 1px solid rgba(249, 115, 22, 0.4);
  backdrop-filter: blur(16px);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: #ffedd5;
  z-index: 100;
  animation: slideDown 0.3s ease-out;
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 14px;
}

.banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.banner-btn.primary {
  background: #ea580c;
  color: white;
}

.banner-btn.primary:hover {
  background: #f97316;
}

.banner-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.banner-close {
  background: transparent;
  border: none;
  color: #ffedd5;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

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

/* Screen Share Stage Mode */
.screen-share-stage {
  flex: 1;
  display: none;
  flex-direction: column;
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--border-glass-active);
}

.screen-share-stage.active {
  display: flex;
}

#screen-share-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage-filmstrip {
  height: 150px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
}

/* Floating Bottom Control Bar */
.call-controls-bar {
  height: 76px;
  background: rgba(13, 18, 31, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  z-index: 20;
}

.control-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.control-btn.active {
  background: var(--accent-cyan);
  color: white;
  box-shadow: var(--shadow-glow-cyan);
  border-color: var(--accent-cyan);
}

.control-btn.muted,
.control-btn.off {
  background: var(--accent-rose);
  color: white;
  border-color: var(--accent-rose);
  box-shadow: var(--shadow-glow-rose);
}

.control-btn.end-call-btn {
  background: var(--accent-rose);
  color: white;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  border: none;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
}

.control-btn.end-call-btn:hover {
  background: #e11d48;
  transform: translateY(-2px) scale(1.05);
}

.badge-unread {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent-cyan);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0d121f;
}

/* ==========================================================================
   Sidebar Drawer (Chat & Participants)
   ========================================================================== */
.sidebar-drawer {
  width: 340px;
  height: 100%;
  background: rgba(10, 15, 28, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 25;
}

.sidebar-drawer.closed {
  transform: translateX(100%);
  position: absolute;
  right: 0;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
}

.sidebar-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-tab.active {
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.sidebar-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
}

.chat-bubble.mine {
  align-self: flex-end;
}

.chat-sender {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-sender-name {
  font-weight: 600;
  color: var(--text-main);
}

.chat-text {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
  user-select: text;
}

.chat-bubble.mine .chat-text {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-bubble.theirs .chat-text {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

/* File Transfer Item */
.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  margin-top: 4px;
}

.file-icon {
  color: var(--accent-cyan);
}

.file-details {
  flex: 1;
  overflow: hidden;
}

.file-name {
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-download-btn {
  background: var(--accent-cyan);
  color: #000;
  border: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: white;
  font-size: 13px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent-cyan);
}

/* Participants List */
.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

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

.participant-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.participant-name-text {
  font-size: 13px;
  font-weight: 500;
}

/* ==========================================================================
   Modals (Settings, Screen Picker, Stats)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 560px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-elevated);
  transform: translateY(15px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.custom-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: white;
  font-size: 13px;
  outline: none;
}

.custom-select option {
  background: var(--bg-secondary);
  color: white;
}

/* Screen sources grid for Electron */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.source-item {
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.source-item:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.source-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.source-name {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* HUD Toast */
.toast-hud {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  box-shadow: var(--shadow-glow-cyan);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: white;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-hud.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
