body,
html {
  height: 100vh;
  overflow: hidden;
  background: #f3f4f6;
}

.live-container {
  display: flex;
  height: 100vh;
}

/* Left Side: Question */
.question-area {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white url("../asset/logo.png") no-repeat center center;
  background-size: 300px;
  position: relative;
  overflow: hidden;
}

.question-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

/* Stats Graph Overlay */
.stats-overlay {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.stats-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.stat-box {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #e5e7eb;
  color: #9ca3af;
  transition: all 0.15s ease;
  position: relative;
}

.stat-box.correct {
  border-color: #34d399;
  color: #34d399;
  background: rgba(236, 253, 245, 0.95);
}

.stat-box.incorrect {
  border-color: #f87171;
  color: #f87171;
  background: rgba(254, 242, 242, 0.95);
}

.stat-box .count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #374151;
  color: white;
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
}

.stat-box.correct .count-badge {
  background: #22c55e;
}

.stat-box.incorrect .count-badge {
  background: #ef4444;
}

/* Right Side: Student List */
.student-sidebar {
  width: 260px;
  min-width: 240px;
  max-width: 300px;
  background: #f9fafb;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: white;
}

.class-label,
.timer-display,
.btn-outline-secondary,
.btn-primary,
.btn-secondary {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

.class-label {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.class-label:empty {
  display: none;
}

.student-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-card {
  background: white;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  font-weight: 500;
  font-size: 0.875rem;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  line-height: 1.4;
}

.student-card.answered {
  background: #eff6ff;
  border-color: #6366f1;
  color: #4338ca;
}

.student-card.correct {
  background: #dcfce7;
  border-color: #22c55e;
  color: #15803d;
}

.student-card.incorrect {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.student-card .status-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
  margin-left: 8px;
}

.student-card.answered .status-icon {
  background: #6366f1;
  box-shadow: 0 0 0 1.5px #c7d2fe;
}

.student-card.correct .status-icon {
  background: #22c55e;
  box-shadow: 0 0 0 1.5px #86efac;
}

.student-card.incorrect .status-icon {
  background: #ef4444;
  box-shadow: 0 0 0 1.5px #fca5a5;
}

.daily-score {
  font-size: 0.7rem;
  font-weight: 700;
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
  color: #6b7280;
  margin-right: 6px;
  min-width: 32px;
  text-align: center;
}

.daily-score.good {
  color: #059669;
  background: #ecfdf5;
}
.daily-score.fair {
  color: #d97706;
  background: #fffbeb;
}
.daily-score.poor {
  color: #dc2626;
  background: #fef2f2;
}

.controls {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.controls .btn,
.timer-display {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.controls .btn {
  padding: 0 10px;
  cursor: pointer;
  background: #f8fafc;
  color: #475569;
}

.controls .btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

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

.controls .btn-icon-only {
  width: 34px;
  padding: 0;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Primary Reveal Button - matched to others */
.controls .btn-primary:hover {
  background: #e2e8f0 !important;
}

/* Secondary Button (Fullscreen) - matched to others */
.controls .btn-secondary:hover {
  background: #e2e8f0 !important;
}

.timer-display {
  font-weight: 700;
  padding: 0 12px;
  min-width: 44px;
  font-family: "Inter", monospace;
  cursor: default;
}

.timer-display.warning {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  animation: pulse 1s infinite;
}

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

.controls .btn svg {
  flex-shrink: 0;
}

.btn-icon-small {
  padding: 5px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: white;
  cursor: pointer;
}

/* Reveal Colors handled by stat-box classes */

.answer-box {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  border: 1px solid transparent;
  margin-left: 8px;
  flex-shrink: 0;
}

.answer-box.correct {
  background-color: #ecfdf5;
  border-color: #22c55e;
  color: #15803d;
}

.answer-box.incorrect {
  background-color: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}

.text-correct {
  color: #15803d !important;
}

.text-incorrect {
  color: #b91c1c !important;
}

/* Drawing Toolbar - Modern Premium Refined Style */
.drawing-toolbar {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  overflow: hidden;
  z-index: 100;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.1);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 500px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(-20px);
}

.drawing-toolbar.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.drawing-toolbar.collapsed {
  max-height: 48px;
}

.toolbar-content {
  display: flex;
  flex-direction: column;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  opacity: 1;
}

.drawing-toolbar.collapsed .toolbar-content {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.tool-btn {
  width: 48px;
  height: 48px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.35rem;
  transition: all 0.2s ease;
  color: #334155;
  flex-shrink: 0;
}

.tool-btn:last-child {
  border-bottom: none;
}

#btn-toggle-toolbar {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  font-weight: bold;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.drawing-toolbar.collapsed #btn-toggle-toolbar {
  border-bottom: none;
}

.tool-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}

.tool-btn.active {
  background: #6366f1;
  color: white;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 6px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%; /* Circle for modern look */
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px #6366f1;
}

#drawing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 50;
  touch-action: none;
}

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

/* Lobby Overlay */
.lobby-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  z-index: 1000;
  display: none; /* Controlled by JS */
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
}

.lobby-content {
  max-width: 800px;
  width: 90%;
}

.join-code-box {
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 20px;
  margin: 20px 0;
  border: 2px solid #6366f1;
}

.join-label {
  display: block;
  font-size: 1.5rem;
  color: #94a3b8;
  margin-bottom: 10px;
}

.join-pin {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: 10px;
  color: white;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.qrcode-container {
  background: white;
  padding: 15px;
  border-radius: 12px;
  display: inline-block;
  margin: 20px 0;
}

.participant-counter {
  font-size: 1.5rem;
  margin: 30px 0 15px;
}

.participant-counter span {
  color: #10b981;
  font-weight: bold;
}

.participant-bubble-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
}

.participant-bubble {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 1rem;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.join-url {
  font-size: 1.2rem;
  color: #64748b;
  margin-top: 20px;
}
