/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

/* Design System & Variables */
:root {
  --bg-primary: #0a0915;
  --bg-secondary: rgba(18, 16, 35, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Primary Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --grad-indigo: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  
  /* Colors */
  --accent-color: #a855f7;
  --glow-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.2);
  --glow-shadow-green: 0 8px 32px 0 rgba(16, 185, 129, 0.25);
  
  --font-main: 'Outfit', 'Noto Sans TC', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Glassmorphism Container */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  padding: 2.5rem;
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--glass-highlight);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
}

.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Buttons */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
  color: #fff;
  text-decoration: none;
  outline: none;
}

.btn-primary {
  background: var(--grad-primary);
  box-shadow: var(--glow-shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.45);
}

.btn-success {
  background: var(--grad-success);
  box-shadow: var(--glow-shadow-green);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(16, 185, 129, 0.45);
}

.btn-danger {
  background: var(--grad-danger);
}

.btn-danger:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
}

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

.btn:active {
  transform: translateY(1px);
}

/* Inputs */
.input-field {
  width: 100%;
  padding: 0.8rem 1.2rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
  transition: var(--transition-smooth);
  outline: none;
}

.input-field:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* Layouts */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

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

.brand {
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-dot {
  width: 12px;
  height: 12px;
  background: var(--grad-primary);
  border-radius: 50%;
  display: inline-block;
}

/* Welcome Page (Index) */
.welcome-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 150px);
}

.welcome-card {
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.role-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.role-card {
  padding: 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.role-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent-color);
  transform: translateY(-5px);
}

.role-icon {
  font-size: 3rem;
}

/* Dashboard Layout Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

/* Screen Sharing Video Frame */
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 21, 0.85);
  color: var(--text-secondary);
  gap: 15px;
  text-align: center;
  padding: 1rem;
}

.video-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

/* Tab controls / Sidebar Items */
.students-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 5px;
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.student-item.offline {
  opacity: 0.5;
  border-style: dashed;
}

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

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

.badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-score {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.badge-draw {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
}

/* Question Creator & Presenter */
.question-builder {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-input-group {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.option-letter {
  font-weight: bold;
  color: var(--accent-color);
  width: 20px;
}

.chart-bar-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1.5rem;
}

.chart-bar-row {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chart-bar-row:hover {
  transform: translateX(4px);
}

.chart-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.chart-bar-outer {
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  position: relative;
}

.chart-bar-inner {
  height: 100%;
  background: var(--grad-cyan);
  border-radius: 12px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.1, 0.8, 0.3, 1);
}

.chart-bar-inner.correct {
  background: var(--grad-success);
}

.chart-bar-label-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.leaderboard-item.rank-1 {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(245, 158, 11, 0.4);
}
.leaderboard-item.rank-2 {
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(226, 232, 240, 0.3);
}
.leaderboard-item.rank-3 {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(180, 83, 9, 0.3);
}

.leaderboard-rank {
  font-size: 1.2rem;
  font-weight: 800;
  width: 30px;
  text-align: center;
}

.leaderboard-rank.gold { color: #fbbf24; }
.leaderboard-rank.silver { color: #cbd5e1; }
.leaderboard-rank.bronze { color: #b45309; }

.leaderboard-name {
  flex-grow: 1;
  font-weight: 500;
  margin-left: 10px;
}

.leaderboard-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: #c084fc;
}

/* Draw Picker / Random Select Console */
.draw-picker-console {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  gap: 15px;
}

.draw-animation-box {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  overflow: hidden;
  position: relative;
}

.draw-spinning-text {
  animation: roll-up 0.15s infinite linear;
}

.draw-winner-glow {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Link Pushing Drawer */
.link-push-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Student Response Cards */
.student-response-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 1rem;
}

@media (min-width: 600px) {
  .option-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.option-card {
  padding: 1.2rem;
  background: rgba(255,255,255,0.03);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.option-card.selected {
  background: rgba(168, 85, 247, 0.15);
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.option-card.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.option-card.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Toast Link Notification */
.link-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 400px;
  width: 90%;
  background: rgba(18, 16, 35, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid #a855f7;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  z-index: 1000;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.link-toast.show {
  transform: translateY(0);
}

.link-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.link-toast-close {
  cursor: pointer;
  font-size: 1.2rem;
  background: none;
  border: none;
  color: var(--text-secondary);
}

/* Connection Overlay Mask for Student */
.reconnect-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 9, 21, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  text-align: center;
  padding: 2rem;
}

.reconnect-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.reconnect-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255,255,255,0.05);
  border-top: 4px solid #a855f7;
  border-radius: 50%;
  animation: spin 1.2s infinite cubic-bezier(0.5, 0, 0.5, 1);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes roll-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

@keyframes pop {
  0% { transform: scale(0.8); opacity: 0.5; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1.0); opacity: 1; }
}

/* QR Code & Status details */
.room-details-top {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.room-badge {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 12px;
  background: var(--grad-indigo);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

/* Full-screen Projection Dialog */
.projection-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #05040a;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.12) 0px, transparent 50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  overflow: hidden;
  box-sizing: border-box;
}

.projection-close-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  padding: 0.6rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.projection-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.4);
}

.projection-content {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.projection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--glass-border);
  padding-bottom: 1.5rem;
}

.projection-room-badge {
  background: var(--grad-indigo);
  border: 2px solid rgba(255,255,255,0.15);
  padding: 0.8rem 2rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.projection-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: -1rem;
}

.btn-group-toggle {
  display: inline-flex;
}

.btn-group-toggle button {
  transition: var(--transition-smooth);
}

.btn-group-toggle button.active-toggle {
  background: var(--grad-primary);
  border-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.projection-chart-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

/* Projection Chart Bars */
.proj-bar-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  border-radius: 12px;
  padding: 8px;
  margin: -8px;
  transition: var(--transition-smooth);
}

.proj-bar-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.proj-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 1.4rem;
  font-weight: 600;
}

.proj-bar-outer {
  height: 50px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--glass-border);
  border-radius: 25px;
  overflow: hidden;
  position: relative;
}

.proj-bar-inner {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 25px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.3, 1);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.proj-bar-inner.correct {
  background: var(--grad-success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.proj-bar-inner.locked {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 10px,
    rgba(255, 255, 255, 0.08) 10px,
    rgba(255, 255, 255, 0.08) 20px
  );
  width: 100% !important;
  box-shadow: none;
}

.proj-bar-label-count {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

/* Projection Waiting Lobby Styles */
.proj-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
  padding: 10px;
  border-radius: 12px;
}

.proj-student-card {
  padding: 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.proj-student-card.online {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
}

.proj-student-card.offline {
  opacity: 0.4;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.03);
  text-decoration: line-through;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Word Cloud Styles */
.word-cloud-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 15px 25px;
  min-height: 250px;
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.01);
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.word-cloud-tag {
  display: inline-block;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
  user-select: none;
  transform: rotate(var(--tag-rot, 0deg));
}

.word-cloud-tag:hover {
  transform: scale(1.18) rotate(calc(var(--tag-rot, 0deg) + 3deg));
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
}

/* ================================================
   Screenshot Push Mode
   ================================================ */

/* Tab switcher between Video stream and Screenshot mode */
.share-tab-bar {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  margin-bottom: 0.7rem;
}

.share-tab-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.share-tab-btn:not(:last-child) {
  border-right: 1px solid var(--glass-border);
}

.share-tab-btn.active-tab {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.share-tab-btn:hover:not(.active-tab) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* Screenshot image inside the video container */
#received-screenshot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Timestamp badge over the screenshot */
#screenshot-timestamp {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* Flash animation when a new screenshot is received */
@keyframes screenshot-flash {
  0%   { outline: 3px solid rgba(168, 85, 247, 0.8); }
  60%  { outline: 3px solid rgba(168, 85, 247, 0.3); }
  100% { outline: 3px solid transparent; }
}

.screenshot-flash {
  animation: screenshot-flash 0.6s ease-out forwards;
}

/* Auto-push toggle active state */
#btn-screenshot-auto-toggle.auto-active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

/* Push status text */
#screenshot-push-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 6px;
  vertical-align: middle;
}

/* ================================================
   Student Projection Fullscreen & Screenshot Zoom
   ================================================ */

#student-projection-panel.fullscreen-active {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2500;
  border-radius: 0;
  border: none;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
}

#student-projection-panel.fullscreen-active #student-stream-panel,
#student-projection-panel.fullscreen-active #student-screenshot-panel {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 0;
}

#student-projection-panel.fullscreen-active .video-container {
  flex-grow: 1;
  aspect-ratio: auto;
  height: 0;
  width: 100%;
}

.zoom-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: grab;
}

.zoom-wrapper:active {
  cursor: grabbing;
}

.zoom-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
  -webkit-user-drag: none;
}

.screenshot-zoom-controls {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 10;
  display: flex;
  gap: 8px;
  background: rgba(10, 9, 21, 0.8);
  border: 1px solid var(--glass-border);
  padding: 6px;
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.screenshot-zoom-controls .btn-zoom {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.screenshot-zoom-controls .btn-zoom:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.screenshot-zoom-controls .btn-zoom:active {
  transform: translateY(1px);
}

/* ================================================
   Student Floating Q&A overlay in Fullscreen mode
   ================================================ */

#student-qa-panel.floating-mode {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 420px;
  max-width: 90vw;
  z-index: 2600;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--accent-color);
  padding: 1.5rem;
  background: rgba(18, 16, 35, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  transition: opacity 0.3s ease;
  cursor: move;
  user-select: none;
}

#student-qa-panel.floating-mode .panel-title {
  cursor: move;
  user-select: none;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

#student-qa-panel.floating-mode.collapsed {
  width: auto;
  min-height: auto !important;
  height: auto;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
}

#student-qa-panel.floating-mode.collapsed > *:not(.panel-title) {
  display: none !important;
}

#student-qa-panel.floating-mode.collapsed .panel-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.btn-minimize-qa {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.btn-minimize-qa:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

#student-qa-panel.floating-mode #btn-minimize-qa {
  display: inline-flex !important;
}



