/* ========================================
   Protec.one Video Conference CSS
   Modern Design with Purple/Magenta Gradient Theme
   ======================================== */

:root {
  /* Brand Colors - Purple & Magenta Gradients */
  --color-primary: #8B5CF6;
  --color-primary-dark: #7C3AED;
  --color-secondary: #EC4899;
  --color-accent: #3B82F6;
  
  /* Background Colors - Dark Theme */
  --bg-primary: #0F0A1E;
  --bg-secondary: #1A1527;
  --bg-tertiary: #251F35;
  --bg-card: #1E1831;
  --bg-hover: #2D2642;
  
  /* Text Colors */
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dark: #1E293B;
  
  /* State Colors */
  --color-success: #10B981;
  --color-danger: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;
  
  /* Border Colors */
  --border-primary: #2D2642;
  --border-light: #3F3651;
  --border-accent: rgba(139, 92, 246, 0.3);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  --gradient-dark: linear-gradient(180deg, #1A1527 0%, #0F0A1E 100%);
  --gradient-card: linear-gradient(135deg, #251F35 0%, #1E1831 100%);
  --gradient-accent: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.4);
  --shadow-glow-pink: 0 0 30px rgba(236, 72, 153, 0.4);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-quick: all 0.15s ease-out;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
}

/* ========================================
   Base Styles
   ======================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Layout
   ======================================== */

.app {
  background: var(--gradient-dark);
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-shadow: var(--shadow-lg);
  min-height: 100vh;
}

.container {
  width: 100%;
}

.row {
  display: flex;
}

.full-height {
  height: calc(var(--vh, 1vh) * 100);
}

.full-width {
  width: calc(100vw - 200px);
  height: calc(var(--vh, 1vh) * 100 - 56px);
}

.full-width-active {
  width: 100vw;
}

.coln-left {
  flex: 30%;
  padding: 0;
  margin: 0;
}

.coln-left-hide {
  flex: 0;
}

.coln-right {
  flex: 70%;
  position: relative;
  background: var(--gradient-dark);
}

/* ========================================
   Top Navigation
   ======================================== */

.nav-fixed .topnav {
  z-index: 1039;
}

.fixed-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
}

.topnav {
  padding-left: 0;
  height: 3.5rem;
  z-index: 1039;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.navbar, .navbar .container, .navbar .container-fluid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.navbar {
  position: relative;
  padding: 0.1rem;
}

.topnav .navbar-brand {
  width: 15rem;
  padding-left: 1rem;
  padding-right: 1rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

#header {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

header .collapse {
  float: left;
  text-align: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-primary);
  margin-right: 20px;
  margin-left: 5px;
  transition: var(--transition-quick);
}

header .collapse:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

.header-title {
  float: left;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 2em;
}

#title {
  text-align: center;
}

h1 {
  white-space: nowrap;
}

/* ========================================
   Navigation Menu
   ======================================== */

.nav-menu {
  position: absolute;
  margin: 4px;
  padding: 0px;
  right: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.nav-menu li {
  list-style: none;
}

.nav-link {
  padding: 0;
  color: var(--text-primary);
  min-width: 30px;
  display: block;
  text-align: center;
  margin: 0 10px;
  position: relative;
  line-height: 1.1;
  transition: var(--transition-quick);
}

.nav-link span {
  display: block;
}

.nav-link label {
  display: block;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.65rem;
  margin-top: var(--spacing-xs);
  transition: var(--transition-quick);
}

.nav-link:hover {
  color: var(--color-primary);
  transform: translateY(-2px);
}

.nav-link:hover label {
  color: var(--color-primary);
}

.nav-cancel, .muted, .nav-cancel label, .muted label {
  color: var(--color-danger);
}

.nav-cancel:hover, .muted:hover {
  color: var(--color-danger);
  filter: brightness(1.2);
}

.nav-button {
  cursor: pointer;
  font-size: 25px;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 0.5rem;
  transition: var(--transition-quick);
}

.nav-button:hover {
  background: var(--bg-hover);
}

.nav-more {
  margin-left: 0;
  font-size: 25px;
}

/* Hide top nav controls (moved to bottom bar) */
.nav-hidden-control {
  display: none !important;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-block;
  font-weight: 500;
  font-size: 1em;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1.25rem;
  line-height: 1.5;
  border-radius: 0.75rem;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn:not(:disabled):not(.disabled) {
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-default {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

.btn-default:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
}

.btn-success {
  color: #fff;
  background: var(--color-success);
  border: none;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: #059669;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.btn-cancel {
  color: #fff;
  background: var(--color-danger);
  border: none;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-cancel:hover {
  background: #DC2626;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.btn-blue {
  color: #fff;
  background: var(--gradient-primary);
  border: none;
  box-shadow: var(--shadow-glow);
  font-weight: 600;
}

.btn-blue:hover {
  background: var(--gradient-accent);
  box-shadow: var(--shadow-glow), 0 0 40px rgba(139, 92, 246, 0.6);
  transform: translateY(-2px) scale(1.02);
}

.btn-warn {
  color: var(--color-warning);
  background-color: transparent;
  border: 1px solid var(--color-warning);
}

.btn-warn:hover {
  color: var(--text-dark);
  background-color: var(--color-warning);
}

.btn-large {
  font-size: 110%;
  padding: 0.625rem 1.5rem;
}

#presentbutton, #unpresentbutton {
  white-space: nowrap;
  margin-right: 0.4em;
  margin-top: 0.1em;
  font-size: 1em;
  text-align: left;
  min-width: 5.8em;
}

/* ========================================
   Forms
   ======================================== */

.form-control {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  transition: var(--transition-quick);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  background-color: var(--bg-tertiary);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-control-inline {
  display: inline-block;
}

.form-reply {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-quick);
  resize: none;
  font-family: "Noto-galene", sans-serif;
}

.form-reply:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-reply::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

textarea.form-reply {
  height: 2.5em;
  margin-right: 0.2em;
}

.select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  transition: var(--transition-quick);
}

.select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.select-inline {
  display: inline-block;
}

.switch-radio {
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
}

.switch-radio input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-right: 0.5rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.switch-radio label {
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-quick);
}

.switch-radio:hover label {
  color: var(--text-primary);
}

/* ========================================
   Left Sidebar - Users
   ======================================== */

#left-sidebar {
  min-width: 200px;
  max-width: 200px;
  transition: all 0.3s;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
}

#left-sidebar.active,
#left-sidebar.sidebar-hidden {
  min-width: 0;
  max-width: 0;
  overflow: hidden;
}

.users-header {
  height: 3.5rem;
  padding: 10px;
  background: var(--gradient-primary);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.users-header:after, .profile-user:after, .users-header:before {
  display: table;
  content: " ";
}

.users-header:after, .profile-user:after {
  clear: both;
}

.galene-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 34px;
  display: inline-block;
}

.header-sep {
  height: 0;
  border-bottom: 1px solid var(--border-primary);
}

#users-container {
  height: calc(100% - 56px);
  overflow-y: auto;
  background-color: var(--bg-secondary);
}

#users {
  padding: var(--spacing-sm);
  margin: 0;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

/* All participants - simple list style */
#users .user-p {
  position: relative;
  padding: 10px 14px !important;
  border: 1px solid var(--border-primary);
  border-radius: 0.5rem;
  height: auto;
  line-height: 1.4;
  margin: 0 !important;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: var(--transition-quick);
  color: var(--text-primary);
  font-size: 0.85rem;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

#users .user-p:hover {
  background-color: var(--bg-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

/* Status indicators */
#users .user-p::before {
  content: "\f111";
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.5rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

#users .user-p.user-status-microphone::before {
  color: var(--color-success);
  animation: pulse-ring 2s ease-out infinite;
  width: 10px;
  height: 10px;
  text-align: center;
  border-radius: 5px;
}

#users .user-p.user-status-camera::before {
  color: var(--color-primary);
}

#users .user-p.user-status-raisehand::before {
  content: "\f256";
  color: var(--color-warning);
  font-size: 0.75rem;
}

/* Camera icon for users with video */
#users .user-p.user-status-camera::after {
  content: "\f030";
  font-family: 'Font Awesome 6 Free';
  color: var(--color-secondary);
  font-weight: 900;
  font-size: 0.75rem;
  margin-left: auto;
}

/* Raised hand indicator for audio-only users */
#users .user-p.user-status-raisehand:not(.user-status-camera) {
  background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-primary) 100%);
  animation: raise-hand-pulse 1.5s ease-in-out infinite;
}

@keyframes raise-hand-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}

/* Audio activity animation */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* ========================================
   Chat
   ======================================== */

#chat {
  padding: 0;
  margin: 0;
  background: var(--bg-card);
  overflow-y: scroll;
  border-right: 1px solid var(--border-primary);
  height: 100% !important;
  width: 100%;
  min-width: 300px;
  overflow: hidden;
}

#chatbox {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

#box {
  overflow: auto;
  flex: 1;
  padding: var(--spacing-md);
}

.reply {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  background: var(--bg-tertiary);
  padding: var(--spacing-md);
  border-top: 1px solid var(--border-primary);
  z-index: 1000;
}

#inputform {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
}

#input {
  flex: 1;
  border: none;
  resize: none;
  overflow-y: hidden;
  font-family: "Noto-galene", sans-serif;
}

#input:focus {
  outline: none;
}

#inputbutton {
  margin-left: 0;
  padding: 0.5rem 1rem;
}

#inputbutton:focus {
  outline: none;
}

.close-chat {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  transition: var(--transition-quick);
  z-index: 10;
}

.close-chat:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.close-icon {
  font: normal 1em/1 Arial, sans-serif;
  display: inline-block;
}

.close-icon:before {
  content: "\2715";
}

/* ========================================
   Messages
   ======================================== */

.message {
  width: auto !important;
  padding: 0.75rem 1rem !important;
  background: var(--bg-tertiary);
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  border-radius: 1rem;
  word-wrap: break-word;
  display: inline-block;
  margin: 0.75rem 0;
  max-width: 80%;
  text-align: left;
  border: 1px solid var(--border-primary);
  transition: var(--transition-quick);
}

.message:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-md);
}

.message-sender {
  background: var(--bg-hover);
  border-left: 3px solid var(--color-primary);
}

.message-private {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid var(--border-accent);
}

.message-private .message-header:after {
  content: "(private)";
  margin-left: 1em;
  color: var(--color-primary);
  font-size: 0.75rem;
}

.message-system {
  font-size: 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  text-align: center;
  font-style: italic;
  padding: 0.5rem 0.75rem !important;
}

.message-row:after, .message-row:before {
  display: table;
  content: " ";
}

.message-row:after {
  clear: both;
}

.message-content {
  white-space: pre-wrap;
  margin: 0;
  padding: 0;
  word-wrap: break-word;
  word-break: break-word;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: "Noto-galene", sans-serif;
}

.message-header {
  margin: 0;
  font-style: italic;
  text-shadow: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 0.25rem;
}

.message-footer {
  margin: 0;
  padding: 0;
  margin-top: 0.25rem;
  line-height: 0.9;
  text-align: right;
}

.message-time {
  margin-left: 0.5em;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ========================================
   Emoji
   ======================================== */

.emoji {
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: var(--transition-quick);
  border-radius: 0.5rem;
}

.emoji:hover {
  background: var(--bg-hover);
  transform: scale(1.2);
}

.additional-emoji-button {
  display: inline-block;
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  font-family: "Noto-galene", sans-serif;
  transition: var(--transition-quick);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.additional-emoji-button:hover {
  background: var(--bg-hover);
  transform: scale(1.1);
}

.additional-emoji-popup {
  display: none;
  position: absolute;
  bottom: 60px;
  right: 10px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 0.75rem;
  z-index: 100;
  font-family: "Noto-galene", sans-serif;
}

.additional-emoji-content {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
}

/* ========================================
   Video Container
   ======================================== */

.video-container {
  height: calc(var(--vh, 1vh) * 100 - 56px);
  position: relative;
  background: var(--gradient-dark);
  display: block;
}

#expand-video {
  height: 100%;
  width: 100%;
}

#peers {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-auto-rows: minmax(200px, auto);
  gap: 12px;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: auto;
  align-items: center;
  justify-items: center;
}

.peer {
  position: relative;
  border: 2px solid var(--border-primary);
  background: var(--bg-card);
  border-radius: 1rem;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.peer:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.peer-active {
  border: 2px solid var(--color-success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.peer-hidden {
  display: none;
}

/* Audio-only peer - minimalist avatar */
.peer-audio-only {
  min-height: auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
  border: 3px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.peer-audio-only:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-glow), 0 0 40px rgba(139, 92, 246, 0.6);
}

.peer-audio-only .media {
  display: none;
}

.peer-audio-only .video-controls,
.peer-audio-only .top-video-controls {
  display: none;
}

.peer-audio-only .label {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  backdrop-filter: none;
  padding: 0.25rem 0.5rem;
  margin: 0;
  font-size: 0.75rem;
  text-align: center;
  box-shadow: none;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  border: 1px solid var(--border-primary);
}

.peer-audio-only::before {
  content: attr(data-initials);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  z-index: 1;
  line-height: 1;
}

/* Activity indicator for audio-only - ring around avatar */
.peer-audio-only.peer-active {
  border: 3px solid var(--color-success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: audio-ring-pulse 1.5s ease-out infinite;
}

@keyframes audio-ring-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7), var(--shadow-glow);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0), var(--shadow-glow);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), var(--shadow-glow);
  }
}

.media {
  width: 100%;
  max-height: calc(var(--vh, 1vh) * 100 - 76px);
  object-fit: contain;
  background: var(--bg-tertiary);
}

.media-failed {
  filter: grayscale(0.5) contrast(0.5);
  opacity: 0.5;
}

.mirror {
  transform: scaleX(-1);
}

.label {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  padding: 0.375rem 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.label-fallback {
  opacity: 0.5;
  display: none;
}

/* ========================================
   Video Controls
   ======================================== */

.video-controls, .top-video-controls {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 25px;
  text-align: center;
  color: var(--text-primary);
  font-size: 1.1em;
  opacity: 0;
  height: 32px;
  transition: var(--transition-quick);
}

.video-controls:after, .top-video-controls:after {
  clear: both;
  display: table;
  content: " ";
}

.top-video-controls {
  text-align: right;
  bottom: inherit;
  top: 0;
  line-height: 1.1;
  font-size: 1.3em;
}

.controls-button {
  padding: 3px 10px;
  vertical-align: middle;
  height: 100%;
}

.controls-left {
  float: left;
  text-align: left;
}

.controls-right {
  float: right;
  text-align: right;
}

.vc-overlay {
  /* background: linear-gradient(180deg, rgba(15, 10, 30, 0.3) 0%, rgba(15, 10, 30, 0.6) 50%, rgba(15, 10, 30, 0.8) 100%); */
  /* backdrop-filter: blur(5px); */
  border-radius: 0.5rem;
  padding: 0 1rem;
}

.peer:hover > .video-controls, .peer:hover > .top-video-controls {
  opacity: 1;
}

.video-controls span, .top-video-controls span {
  margin-right: 20px;
  transition: var(--transition-quick);
  opacity: 1;
  cursor: pointer;
  color: var(--text-primary);
}

.video-controls span:last-child, .top-video-controls span:last-child {
  margin-right: 0;
}

.video-controls span:hover, .top-video-controls span:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

.top-video-controls .video-stop {
  display: flex;
  width: 2rem;
  height: 2rem;
  background: rgba(239, 68, 68, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  color: white;
  transition: var(--transition-quick);
}

.top-video-controls .video-stop:hover {
  background: var(--color-danger);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.video-controls .volume {
  display: inline-block;
  text-align: center;
}

.video-controls .video-play {
  font-size: 0.85em;
  display: none;
}

.video-controls .video-stop {
  color: var(--color-danger);
}

.video-controls span.disabled, .video-controls span.disabled:hover, .top-video-controls span.disabled:hover {
  opacity: 0.2;
  color: var(--text-muted);
  cursor: not-allowed;
}

.volume-mute {
  vertical-align: middle;
  width: 25px;
  display: var(--dv, inline);
}

.volume-slider {
  height: 4px;
  width: 60px;
  cursor: pointer;
  margin: 5px;
  vertical-align: middle;
  opacity: var(--ov, 0);
  transition: var(--transition-quick);
  accent-color: var(--color-primary);
}

.video-controls .volume:hover {
  --ov: 1;
  --dv: inline;
}

/* ========================================
   Chat Buttons
   ======================================== */

.chat-btn {
  display: block;
  z-index: 1002;
  font-size: 1.5em;
  position: absolute;
  top: 20px;
  left: 20px;
  cursor: pointer;
  background: var(--bg-card);
  padding: 0.75rem;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.chat-btn:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.chat-btn .icon-chat {
  color: var(--text-primary);
  display: block;
}

.collapse-video {
  left: 30px;
  right: inherit;
}

.show-video {
  position: absolute;
  right: 30px;
  bottom: 120px;
  color: white;
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 1rem;
  border-radius: 3rem;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.show-video:hover {
  box-shadow: var(--shadow-glow), 0 0 40px rgba(139, 92, 246, 0.6);
  transform: scale(1.05);
}

.blink {
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% {
    box-shadow: var(--shadow-glow);
  }
  50% {
    box-shadow: var(--shadow-glow), 0 0 50px rgba(139, 92, 246, 0.8);
  }
}

/* ========================================
   Captions
   ======================================== */

/* Captions - hidden by default */
#captions-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

#captions {
  display: none;
}

/* ========================================
   Login Container - Full Screen Overlay
   ======================================== */

.login-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: var(--bg-primary);
  z-index: 9999;
  padding: var(--spacing-lg);
}

/* Animated floating circles background */
.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 600px 600px at 20% 20%, rgba(139, 92, 246, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 30%, rgba(236, 72, 153, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 40% 80%, rgba(59, 130, 246, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 350px 350px at 70% 70%, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  filter: blur(60px);
  animation: float-bg 20s ease-in-out infinite alternate;
  z-index: 0;
}

.login-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 300px 300px at 10% 60%, rgba(236, 72, 153, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 450px 450px at 90% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 250px 250px at 50% 10%, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  filter: blur(80px);
  animation: float-bg-reverse 25s ease-in-out infinite alternate;
  z-index: 0;
}



@keyframes float-bg {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, 20px) scale(1.05);
  }
  100% {
    transform: translate(-20px, 30px) scale(1);
  }
}

@keyframes float-bg-reverse {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-40px, -30px) scale(1.1);
  }
  100% {
    transform: translate(20px, -20px) scale(1);
  }
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: rgba(30, 24, 49, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 1.5rem;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  z-index: 1;
  position: relative;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2rem;
  font-weight: 700;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.login-box .connect {
  width: 100%;
  text-align: center;
  margin-top: 1.5rem;
}

.loginform label {
  min-width: 3em;
  display: block;
  padding-top: 0.75rem;
  padding-bottom: 0.375rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.loginform input[type="text"], .loginform input[type="password"] {
  width: 100%;
}

.present-switch {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 0.75rem;
  border: 1px solid var(--border-primary);
}

/* ========================================
   Side Navigation (Settings)
   ======================================== */

.sidenav {
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
  display: block;
  position: fixed;
  transition: width 0.3s ease-out;
  width: 0px;
  z-index: 2999;
  top: 0;
  right: 0;
  height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  overflow-y: hidden;
  border-left: 1px solid var(--border-primary);
}

.sidenav a {
  padding: 10px 20px;
  text-decoration: none;
  font-size: 30px;
  color: var(--text-primary);
  display: block;
  transition: var(--transition-quick);
  line-height: 1.0;
}

.sidenav a:hover {
  color: var(--color-primary);
}

.sidenav .closebtn {
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 10px 20px;
}

.sidenav .closebtn:hover {
  color: var(--color-danger);
}

.sidenav-label {
  display: block;
  margin-top: 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.sidenav-label-first {
  display: block;
  margin-top: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.sidenav form {
  margin-top: 15px;
}

.sidenav form label {
  color: var(--text-secondary);
  cursor: pointer;
}

.sidenav form input[type="checkbox"] {
  accent-color: var(--color-primary);
  margin-right: 0.5rem;
  cursor: pointer;
}

.sidenav-header {
  height: 56px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.sidenav-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 36px;
}

.sidenav-content {
  padding: 20px;
  background: var(--bg-secondary);
  height: calc(100% - 56px);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidenav-content h2 {
  margin: 0;
  color: var(--text-primary);
}

/* ========================================
   Profile
   ======================================== */

.profile {
  width: 100%;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-logo {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border-radius: 50%;
  text-align: center;
  vertical-align: middle;
  font-size: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.profile-info {
  flex: 1;
  color: var(--text-primary);
}

.profile-info span {
  display: block;
  line-height: 1.4;
}

#userspan {
  font-weight: 600;
  font-size: 1rem;
}

#permspan {
  font-size: 0.875rem;
  color: var(--color-success);
  font-style: italic;
}

#chpwspan a {
  padding: 4px 0;
  font-size: 0.875rem;
  color: var(--color-secondary);
  text-decoration: none;
  transition: var(--transition-quick);
}

#chpwspan a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.user-logout {
  text-align: center;
}

.user-logout a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 1rem;
  padding: 0.5rem;
  color: var(--color-danger);
  cursor: pointer;
  transition: var(--transition-quick);
  border-radius: 0.5rem;
  text-decoration: none;
}

.user-logout a:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

.logout-icon {
  display: block;
  font-size: 1.5em;
}

.logout-text {
  font-size: 0.7em;
}

/* ========================================
   Fieldsets
   ======================================== */

fieldset {
  margin: 0;
  margin-top: 20px;
  border: 1px solid var(--border-light);
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--bg-card);
}

legend {
  padding: 0 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ========================================
   Record Buttons
   ======================================== */

.recordBtn {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  cursor: pointer;
  color: var(--text-primary);
  border-radius: 0.75rem;
  transition: var(--transition-quick);
  font-size: 0.9rem;
}

.recordBtn:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
}

.recordBtn:active {
  background: var(--bg-tertiary);
}

.recordBtn:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border-primary);
}

#recordStatus {
  display: block;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================
   Resizer
   ======================================== */

#resizer {
  width: 4px;
  margin-left: -4px;
  z-index: 1000;
  background: var(--border-primary);
  transition: var(--transition-quick);
}

#resizer:hover {
  cursor: ew-resize;
  background: var(--color-primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* ========================================
   Dialog
   ======================================== */

#invite-dialog {
  background: var(--bg-card);
  border: 2px solid var(--color-primary);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

#invite-dialog form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#invite-dialog button {
  background: var(--gradient-primary);
  color: white;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  margin-top: 1em;
  margin-right: 1em;
  display: inline-block;
  min-width: 7em;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-glow);
}

#invite-dialog button:hover {
  background: var(--gradient-accent);
  box-shadow: var(--shadow-glow), 0 0 30px rgba(139, 92, 246, 0.6);
  transform: translateY(-2px);
}

#invite-dialog #invite-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

#invite-dialog #invite-cancel:hover {
  background: var(--bg-hover);
  box-shadow: var(--shadow-md);
}

#invite-dialog input {
  margin-top: 0.5em;
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.75rem;
  color: var(--text-primary);
  transition: var(--transition-quick);
}

#invite-dialog input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

#invite-dialog label {
  margin-top: 0.5em;
  display: inline-block;
  width: 100%;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

/* ========================================
   Toast Notifications
   ======================================== */

.toastify.error {
  background: linear-gradient(135deg, #DC2626, #EF4444);
  color: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
}

.toastify.error .toast-close {
  color: #fff;
}

.toastify.warning {
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: var(--text-dark);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
}

.toastify.warning .toast-close {
  color: var(--text-dark);
}

.toastify.info {
  background: linear-gradient(135deg, #059669, #10B981);
  color: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
}

.toastify.info .toast-close {
  color: #fff;
}

/* ========================================
   Context Menu
   ======================================== */

:root {
  --contextualMenuBg: var(--bg-card);
  --contextualMenuShadow: var(--shadow-lg);
  --contextualMenuRadius: 0.75rem;
  --contextualMenuText: var(--text-primary);
  --contextualSubMenuBg: var(--bg-tertiary);
  --contextualHover: var(--bg-hover);
  --contextualOverflowIcon: var(--text-muted);
  --contextualSeperator: var(--border-light);
}

.contextualMenu {
  z-index: 2999;
  border: 1px solid var(--border-light);
}

/* ========================================
   Progress
   ======================================== */

.file-progress {
  accent-color: var(--color-primary);
  margin-left: 10px;
  margin-right: 10px;
}

/* ========================================
   Utility Classes
   ======================================== */

.invisible {
  display: none;
}

.error {
  color: var(--color-danger);
  font-weight: bold;
}

.noerror {
  display: none;
}

.clear {
  clear: both;
  content: "";
}

.connected {
  color: var(--color-success);
}

.disconnected {
  color: var(--color-danger);
  font-weight: bold;
}

.shadow {
  box-shadow: var(--shadow-md);
}

.bg-white {
  background-color: var(--bg-card);
}

.bg-gray {
  background-color: var(--bg-tertiary);
}

/* ========================================
   Scrollbar
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ========================================
   Responsive Design
   ======================================== */

@media only screen and (min-width: 1025px) {
  .coln-right .collapse-video, .coln-right .show-video {
    display: none;
  }
}

@media only screen and (max-width: 1024px) {
  #presentbutton, #unpresentbutton {
    width: auto;
  }

  .nav-link {
    margin: 0 4px;
    line-height: 1.5;
  }

  .nav-link label {
    display: none;
  }

  .nav-text {
    display: none;
  }

  .nav-more {
    padding-top: 0;
    margin-left: inherit;
  }

  .full-width {
    height: calc(var(--vh, 1vh) * 100 - 56px);
  }

  .close-chat, .show-chat {
    display: none;
  }

  .video-container {
    position: fixed;
    height: calc(var(--vh, 1vh) * 100 - 56px);
    top: 56px;
    right: 0;
    left: 0;
    margin-bottom: 60px;
  }

  .top-video-controls {
    opacity: 1;
  }

  .login-container {
    position: fixed;
    height: calc(var(--vh, 1vh) * 100 - 56px);
    top: 56px;
    right: 0;
    left: 0;
  }

  .login-box {
    background: var(--gradient-card);
  }

  .coln-left {
    flex: 100%;
    width: 100vw;
    display: block !important;
  }

  .coln-right {
    flex: none;
    position: relative;
  }

  .full-width {
    width: 100vw;
  }

  #left-sidebar.active {
    min-width: 200px;
    max-width: 200px;
  }

  #left-sidebar {
    min-width: 0;
    max-width: 0;
  }

  #left-sidebar {
    margin-left: 0;
  }

  .sidenav a {
    padding: 10px 10px;
  }

  .sidenav-header h2 {
    line-height: 36px;
  }

  #peers {
    padding: 5px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  #resizer {
    display: none;
  }

  #chat {
    border-right: none;
  }

  .chat-btn .icon-chat {
    background: var(--bg-card);
    border-radius: 50%;
    padding: 0.75rem;
  }
}

@media only screen and (max-width: 768px) {
  .login-box {
    padding: 2rem 1.5rem;
  }

  .login-box h2 {
    font-size: 1.75rem;
  }

  #peers {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 90%;
  }
}

@media only screen and (max-width: 480px) {
  .topnav {
    height: 3rem;
  }

  .header-title {
    font-size: 1rem;
  }

  .nav-button {
    font-size: 20px;
    padding: 0.25rem 0.5rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .login-box {
    padding: 1.5rem 1rem;
  }

  .form-control {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .sidenav-content {
    padding: 15px;
  }

  fieldset {
    padding: 0.75rem;
  }
}

/* ========================================
   Animations
   ======================================== */

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

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

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

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .topnav,
  #left-sidebar,
  .chat-btn,
  .video-controls,
  .top-video-controls,
  .sidenav {
    display: none !important;
  }
}

/* ========================================
   Bottom Video Control Bar (Discord-style)
   ======================================== */

.video-control-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 10, 30, 0.95) 40%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  z-index: 100;
}

.control-bar-left,
.control-bar-center,
.control-bar-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.control-bar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.control-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
  font-size: 1.1rem;
}

.control-btn:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.control-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

.control-btn.muted {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.control-btn.muted:hover {
  background: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.control-btn-end {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: white;
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
}

.control-btn-end:hover {
  background: #DC2626;
  border-color: #DC2626;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
  transform: scale(1.1);
}

/* Hide top navbar controls when control bar is visible */
.video-container:not(.invisible) ~ .topnav .nav-menu {
  opacity: 0.5;
}

/* Responsive control bar */
@media (max-width: 768px) {
  .video-control-bar {
    padding: 0 var(--spacing-md);
    height: 64px;
  }
  
  .control-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .control-btn-end {
    width: 48px;
    height: 48px;
  }
}

/* ========================================
   Utility Classes
   ======================================== */

.invisible {
  display: none !important;
}

/* Login container special handling - when visible, override invisible */
.login-container:not(.invisible) {
  display: flex !important;
}


/* ===== Volume controls (master + per-peer) ===== */
.master-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
}

.range-value {
  min-width: 46px;
  opacity: 0.9;
  font-size: 12px;
}

/* Peer tile: highlight self (ярче, чтобы не путать с другими) */
.peer.peer-self {
  outline: 2px solid rgba(160, 255, 120, 0.95);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35) inset;
}

/* .peer.peer-self::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(160, 255, 120, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
  pointer-events: none;
} */
/* Peer popover (Discord-like) */
.peer-popover {
  position: fixed;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow: hidden;
  border-radius: 14px;
  background: rgba(18, 20, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.peer-popover.hidden {
  display: none;
}

.pp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  flex: 0 0 auto;
}

.pp-titlewrap {
  min-width: 0;
  flex: 1 1 auto;
}

.pp-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-sub {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.pp-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pp-body {
  padding: 12px;
  overflow: auto;
  max-height: calc(100vh - 120px);
}

.pp-section {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pp-section + .pp-section {
  margin-top: 10px;
}

.pp-section-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.pp-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pp-hint {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.pp-quick {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.pp-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.pp-quick-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.pp-quick-btn i {
  font-size: 14px;
  opacity: 0.95;
}

.pp-quick-btn span {
  white-space: nowrap;
}

.pp-danger {
  background: rgba(220, 70, 70, 0.14);
  border-color: rgba(220, 70, 70, 0.25);
}

.pp-danger:hover {
  background: rgba(220, 70, 70, 0.20);
}

.pp-mt {
  margin-top: 10px;
}

/* When settings are embedded inside popover, make them fit */
#optionsdiv.pp-embedded {
  padding: 0;
}

#optionsdiv.pp-embedded fieldset {
  margin: 10px 0;
}

#optionsdiv.pp-embedded legend {
  font-size: 12px;
}

#optionsdiv.pp-embedded .sidenav-label-first,
#optionsdiv.pp-embedded .sidenav-label {
  margin-top: 10px;
}
