/* ==========================================================================
   DESIGN SYSTEM & VARIABLES - RELIGION Q2 QUIZ PORTAL
   ========================================================================== */
:root {
  /* Color Palette - Deep Indigo & Theological Amber/Gold */
  --bg-main: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.72);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-gold: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gold-glow: rgba(245, 158, 11, 0.3);
  
  --success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --success-glow: rgba(16, 185, 129, 0.25);
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  --danger-glow: rgba(239, 68, 68, 0.25);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #111827;
  
  --shadow-main: 0 12px 36px 0 rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.2);
  
  /* Fonts */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Background glowing orbs */
.bg-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
}

.bg-glow-1 {
  background: radial-gradient(circle, #6366f1 0%, #4338ca 100%);
  top: -10%;
  left: -10%;
  animation: float-slow 22s infinite alternate;
}

.bg-glow-2 {
  background: radial-gradient(circle, #d97706 0%, #b45309 100%);
  bottom: -10%;
  right: -10%;
  animation: float-slow 28s infinite alternate-reverse;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(70px, 40px) scale(1.12); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.app-container {
  width: 100%;
  max-width: 720px;
  padding: 24px 20px;
  z-index: 10;
  transition: var(--transition-normal);
}

.view-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow-main);
  animation: fadeIn 0.35s ease-out forwards;
  transition: var(--transition-normal);
}

.view-card.xl-card {
  max-width: 960px;
  margin: 0 auto;
}

.app-container:has(.xl-card.active) {
  max-width: 1020px;
}

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

.hidden {
  display: none !important;
}

/* Typography & Titles */
.main-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 6px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.info-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 18px; }
.block-center { display: block; margin-left: auto; margin-right: auto; }

/* Logo Icon */
.logo-icon {
  width: 68px;
  height: 68px;
  background: var(--primary-gradient);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.85rem;
  color: white;
  box-shadow: 0 10px 25px var(--primary-glow);
}

.logo-icon.success {
  background: var(--success-gradient);
  box-shadow: 0 10px 25px var(--success-glow);
}

/* Badges */
.header-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-accent {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-youtube {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 14px 16px 14px 46px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: var(--transition-fast);
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  padding-right: 44px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  gap: 8px;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.btn-success {
  background: var(--success-gradient);
  color: white;
  box-shadow: 0 4px 14px var(--success-glow);
}
.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--success-glow);
}

.btn-danger {
  background: var(--danger-gradient);
  color: white;
  box-shadow: 0 4px 14px var(--danger-glow);
}
.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}
.btn-link:hover {
  color: #c7d2fe;
}

.btn-icon-right { margin-left: 4px; }
.btn-icon-left { margin-right: 4px; }

.highlight-user {
  color: #a5b4fc;
  font-size: 1.15rem;
}

/* ==========================================================================
   QUIZ SELECTION VIEW & TABS
   ========================================================================== */
.selection-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.user-greeting-badge {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  color: #c7d2fe;
}

.quiz-category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cat-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}
.cat-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.cat-tab-btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.quiz-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 768px) {
  .quiz-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.quiz-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 22px;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.quiz-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.quiz-card.locked {
  opacity: 0.65;
  filter: grayscale(0.3);
}

.quiz-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.quiz-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.35;
}

.quiz-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.quiz-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.quiz-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quiz-score-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ==========================================================================
   QUIZ VIEW: HEADER, QUESTION, OPTIONS
   ========================================================================== */
.quiz-header {
  margin-bottom: 20px;
}

.quiz-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.question-progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.points-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 9999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Video Banner Accordion inside Quiz */
.quiz-video-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
  transition: var(--transition-fast);
}

.video-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.video-banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fca5a5;
}

.btn-toggle-video {
  background: transparent;
  border: none;
  color: #fca5a5;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.video-embed-container {
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Question Container */
.question-container {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 24px 22px;
  margin-bottom: 20px;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  color: #ffffff;
}

/* Options Container */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.option-btn {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-main);
  text-align: left;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

.option-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateX(4px);
}

.option-btn.selected {
  background: rgba(99, 102, 241, 0.16);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.option-btn.correct {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35) !important;
}

.option-btn.incorrect {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35) !important;
}

.option-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.option-btn.selected .option-badge {
  background: var(--primary);
  color: white;
  border-color: transparent;
}

.option-btn.correct .option-badge {
  background: #10b981;
  color: white;
  border-color: transparent;
}

.option-btn.incorrect .option-badge {
  background: #ef4444;
  color: white;
  border-color: transparent;
}

.option-content {
  flex-grow: 1;
  line-height: 1.45;
  padding-top: 4px;
}

/* Quiz Actions */
.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.quiz-action-right-group {
  display: flex;
  gap: 10px;
}

/* Live Feedback Box */
.live-feedback-box {
  margin-top: 20px;
  border-radius: 16px;
  padding: 18px 20px;
  animation: fadeIn 0.3s ease-out forwards;
}

.live-feedback-box.correct {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.live-feedback-box.incorrect {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}

.live-feedback-box.correct .feedback-header { color: #34d399; }
.live-feedback-box.incorrect .feedback-header { color: #f87171; }

.feedback-message {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
}

/* ==========================================================================
   RESULT VIEW: SCORE & GRADES (APO-GOSt)
   ========================================================================== */
.score-circle-container {
  display: flex;
  justify-content: center;
  margin: 16px 0 24px;
}

.score-circle {
  position: relative;
  width: 140px;
  height: 140px;
}

.score-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.score-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.score-fill {
  fill: none;
  stroke: #6366f1;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-in-out;
}

.score-values {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-percentage {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  color: white;
}

.score-points {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Result Grade Banner */
.result-grade-banner {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.grade-badge-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 16px 28px;
  text-align: center;
  box-shadow: var(--shadow-main);
  min-width: 260px;
}

.grade-label-sub {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.grade-main-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.grade-val {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.grade-points-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
}

.grade-text-desc {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Review List */
.review-section {
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  text-align: left;
}

.review-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px;
  border-left: 4px solid #6366f1;
}

.review-item.is-correct {
  border-left-color: #10b981;
}
.review-item.is-incorrect {
  border-left-color: #ef4444;
}

.review-q-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: white;
  margin-bottom: 8px;
}

.review-answer-row {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.review-feedback-text {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

/* ==========================================================================
   TEACHER VIEW (DASHBOARD)
   ========================================================================== */
.teacher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 14px;
}

.teacher-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.teacher-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: white;
}

/* Table Container & Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.teacher-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.teacher-table th {
  background: rgba(15, 23, 42, 0.85);
  padding: 14px 16px;
  font-weight: 700;
  color: #c7d2fe;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.teacher-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  white-space: nowrap;
}

.teacher-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.06);
}

.sync-indicator {
  font-size: 0.85rem;
  color: #34d399;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Unlock Panel & Toggles */
.unlock-info-banner {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.unlock-info-banner h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.unlock-info-banner p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.unlock-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.unlock-quiz-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .unlock-quiz-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.unlock-quiz-item {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.unlock-quiz-item:hover {
  border-color: var(--border-card-hover);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 9999px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary-gradient);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  background: #111827;
  border: 1px solid var(--border-card);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-card.modal-lg {
  max-width: 840px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover { color: white; }

.modal-body {
  padding: 24px;
}

.max-h-drawer {
  max-height: 70vh;
  overflow-y: auto;
}

.detail-student-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.detail-modal-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.error-text {
  color: #f87171;
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ==========================================================================
   RESPONSIVE OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 640px) {
  .view-card {
    padding: 24px 18px;
    border-radius: 20px;
  }
  
  .main-title {
    font-size: 1.5rem;
  }
  
  .teacher-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .teacher-header-actions {
    width: 100%;
  }
  
  .teacher-header-actions .btn {
    flex: 1;
  }
  
  .quiz-actions {
    flex-direction: column-reverse;
    gap: 14px;
  }
  
  .quiz-action-right-group {
    width: 100%;
  }
  
  .quiz-action-right-group .btn {
    flex: 1;
  }
}
