/* ===================================================================
   GLASS LIQUID STYLE - LỚP HỌC TRỰC TUYẾN (hoc.bbb.bz)
   Inspiration: Dark Cosmic Liquid Mesh with Frosted Glass Panels
   =================================================================== */

:root {
  --bg-dark: #07090e;
  --glass-bg: rgba(18, 24, 38, 0.65);
  --glass-bg-hover: rgba(26, 35, 54, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-glow: rgba(99, 102, 241, 0.3);
  --glass-border-green: rgba(16, 185, 129, 0.4);
  
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Liquid Ambient Mesh Glow */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

body::before {
  top: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28) 0%, rgba(59, 130, 246, 0.15) 50%, transparent 70%);
  animation: floatSlow 20s ease-in-out infinite alternate;
}

body::after {
  bottom: -15%;
  right: -10%;
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(6, 182, 212, 0.15) 50%, transparent 70%);
  animation: floatSlow 25s ease-in-out infinite alternate-reverse;
}

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

/* Reusable Glass Components */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.35), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.pill-badge.purple {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.35);
}

.pill-badge.emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
}

.pill-badge.cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.35);
}

.pill-badge.gold {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

/* Universal Single-Stroke SVG Icons */
.inline-svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.tag-svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.modal-icon-svg {
  width: 48px;
  height: 48px;
  stroke: #8b5cf6;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 16px;
  display: inline-block;
}

/* ===================================================================
   LANDING PAGE STYLES (Glass Liquid)
   =================================================================== */

.landing-wrap {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Top Floating Pill Navigation */
.top-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 36px;
}

.nav-item-tab {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-item-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-item-tab:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.landing-hero {
  text-align: center;
  max-width: 720px;
  margin-bottom: 45px;
}

.landing-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg, #ffffff 30%, #c4b5fd 70%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* Glass Card Grid */
.landing-cards-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
  margin-bottom: 50px;
}

.liquid-card {
  padding: 38px 32px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.liquid-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.liquid-card.featured {
  border-color: var(--glass-border-green);
  box-shadow: 0 20px 50px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(52, 211, 153, 0.3);
}

.liquid-card.featured:hover {
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 25px 65px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(52, 211, 153, 0.4);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-heading {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.card-subtext {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 28px;
}

/* Form inputs with glass styling */
.glass-input-group {
  margin-bottom: 20px;
  text-align: left;
}

.glass-input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.glass-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

.glass-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
  background: rgba(15, 21, 33, 0.9);
}

.glass-btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-pill);
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  margin-top: 10px;
}

.glass-btn.primary {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.glass-btn.primary:hover {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.glass-btn.emerald {
  background: linear-gradient(135deg, #059669, #0d9488);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.glass-btn.emerald:hover {
  background: linear-gradient(135deg, #10b981, #14b8a6);
  box-shadow: 0 15px 35px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

/* Feature Checkmarks List (Mirroring Image Style) */
.glass-check-list {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.check-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.check-circle.green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.check-circle.purple {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

/* ===================================================================
   ROOM INTERFACE (Glass Liquid + Picture-in-Picture Engine)
   =================================================================== */

.room-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

/* Glass Header Topbar */
.room-glass-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(14, 20, 32, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.btn-pill-action {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-pill-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.btn-pill-action.record {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn-pill-action.record:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(244, 63, 94, 0.55);
  color: #ffffff;
}

.btn-pill-action.record.active {
  background: rgba(244, 63, 94, 0.85);
  color: #fff;
  animation: pulseRec 1.5s infinite;
}

@keyframes pulseRec {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

/* Stage Layout */
.room-stage-wrap {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.stage-viewport {
  flex: 1;
  display: flex;
  position: relative;
  padding: 16px;
  gap: 16px;
  overflow: hidden;
}

/* Normal Video Grid */
.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-card {
  position: relative;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-card.teacher-card {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.35), 0 0 14px -2px rgba(16, 185, 129, 0.2), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

/* Screen Share Stage Item */
.screen-stage-card {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-stage-card video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===================================================================
   AUTOMATIC PiP (PICTURE-IN-PICTURE) MODE
   When Screen Sharing OR Whiteboard is active:
   Teacher's camera is NEVER closed. It automatically shrinks to PiP!
   =================================================================== */

.stage-viewport.pip-active .video-grid {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 250px;
  max-height: calc(100% - 48px);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 30;
  pointer-events: none;
}

.stage-viewport.pip-active .video-grid::-webkit-scrollbar {
  display: none;
}

.stage-viewport.pip-active .video-card {
  height: 155px;
  max-height: 155px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 25px -6px rgba(15, 23, 42, 0.22), 0 4px 10px -2px rgba(15, 23, 42, 0.12), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
  pointer-events: auto;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.stage-viewport.pip-active .video-card.teacher-card {
  order: -1;
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 10px 25px -6px rgba(15, 23, 42, 0.22), 0 0 12px -2px rgba(16, 185, 129, 0.28), inset 0 1px 1px 0 rgba(255, 255, 255, 0.25);
}

.stage-viewport.pip-active #local-video-card:not(.teacher-card) {
  order: 1;
}

.user-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  z-index: 2;
}
.avatar-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-muted);
}

.avatar-circle {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

/* ===================================================================
   INTERACTIVE WHITEBOARD (Glass Liquid Container)
   =================================================================== */

.whiteboard-panel {
  position: absolute;
  inset: 16px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.whiteboard-panel.hidden {
  display: none;
}

.wb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.wb-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wb-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wb-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.wb-btn.active {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
  border-color: #8b5cf6;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.wb-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

#wb-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Whiteboard Text Tool Input Overlay */
.wb-text-overlay-input {
  position: absolute;
  background: transparent;
  border: 1.5px dashed #8b5cf6;
  border-radius: 4px;
  padding: 4px 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.35;
  outline: none;
  min-width: 140px;
  min-height: 32px;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
  z-index: 50;
  box-sizing: border-box;
  resize: none;
  overflow: hidden;
}

/* Whiteboard Remote Live Text Preview */
.wb-live-text-preview {
  position: absolute;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 4px 6px;
  background: transparent;
  border: 1.5px dashed #8b5cf6;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
  z-index: 45;
  box-sizing: border-box;
}

/* Whiteboard Permission Locked Banner */
.wb-locked-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Teacher Student Permission Dropdown Modal */
.wb-perm-dropdown {
  position: absolute;
  top: 55px;
  left: 20px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.18);
  z-index: 100;
  width: 320px;
}

.wb-perm-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.student-perm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.student-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #e2e8f0;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #475569;
  transition: .3s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(18px); }

/* ===================================================================
   CHAT SIDEBAR & BOTTOM CONTROLS
   =================================================================== */

.chat-sidebar {
  width: 330px;
  background: rgba(14, 20, 32, 0.75);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 15;
}

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

.chat-header {
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chat-bubble {
  background: rgba(255, 255, 255, 0.07);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-bubble.mine {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  align-self: flex-end;
  border: none;
}

.chat-input-wrap {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
}

/* Floating Bottom Controls Pill Bar */
.room-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 24px;
  background: rgba(14, 20, 32, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 20;
  height: 72px;
  box-sizing: border-box;
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.16), 0 4px 12px -2px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ctrl-svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: block;
}

/* Automatic mic & cam icon toggle on mute */
.ctrl-btn .mic-off,
.ctrl-btn .cam-off {
  display: none !important;
}

.ctrl-btn.off .mic-on,
.ctrl-btn.off .cam-on {
  display: none !important;
}

.ctrl-btn.off .mic-off,
.ctrl-btn.off .cam-off {
  display: block !important;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px -2px rgba(0, 0, 0, 0.3);
  color: #ffffff;
}

.ctrl-btn.off {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px -2px rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.ctrl-btn.off:hover {
  background: rgba(239, 68, 68, 0.32);
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px -2px rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

.ctrl-btn.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.85), rgba(79, 70, 229, 0.85));
  border-color: rgba(167, 139, 250, 0.6);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.3), 0 0 16px rgba(139, 92, 246, 0.45);
  color: #ffffff;
}

.ctrl-btn.leave {
  width: auto;
  height: 48px;
  min-height: 48px;
  border-radius: var(--radius-pill);
  padding: 0 20px;
  font-size: 0.95rem;
  font-weight: 600;
  gap: 8px;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.2), 0 4px 14px -2px rgba(239, 68, 68, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fecaca;
}

.ctrl-btn.leave:hover {
  background: rgba(239, 68, 68, 0.38);
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.3), 0 6px 18px -2px rgba(239, 68, 68, 0.45);
  color: #ffffff;
  transform: translateY(-2px);
}

/* Modals & Knock Banner (Liquid Glass) */
.glass-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.glass-modal-backdrop.hidden {
  display: none;
}

.glass-modal-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  width: 90%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.18);
}

/* Knock Notification Banner */
.knock-banner-glass {
  position: fixed;
  top: 75px;
  right: 24px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.35), 0 0 14px -2px rgba(16, 185, 129, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.knock-banner-glass.hidden {
  display: none;
}

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