/* Reset & Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea, select {
  user-select: text !important;
  -webkit-user-select: text !important;
}

:root {
  /* Color System */
  --bg-dark: #09090b;
  --bg-card: rgba(24, 24, 27, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-active: rgba(139, 92, 246, 0.4);
  
  --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --accent-rose: #ec4899;
  --accent-emerald: #10b981;
  --accent-crimson: #ef4444;
  
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --shadow-neon: 0 0 20px rgba(139, 92, 246, 0.35);
  --blur-amount: 16px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #030303;
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Starry / Cosmic Desktop Background */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 40px 70px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 50px 160px, rgba(255,255,255,0.7), rgba(0,0,0,0)),
    radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
    radial-gradient(1px 1px at 130px 80px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 160px 120px, #ffffff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.15;
  z-index: 0;
}

/* Background Glowing Orbs for visual wow factor on desktop */
body::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 50%, rgba(0,0,0,0) 100%);
  top: -100px;
  left: -100px;
  z-index: 0;
  animation: floatOrb 20s infinite ease-in-out alternate;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, 80px) scale(1.1); }
}

/* Canvas for Confetti */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* App Container (Emulating Smartphone on Desktop) */
#app-container {
  width: 100%;
  height: 100%;
  max-width: 450px; /* Mobile width constraint for desktops */
  max-height: 920px;
  background-color: var(--bg-dark);
  position: relative;
  overflow: hidden;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* Desktop framing embellishments */
@media (min-width: 460px) {
  #app-container {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 36px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.15);
  }
}

/* Header Bar */
.app-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-emoji {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.logo-text span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
}

/* Icon Buttons styling */
.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  backdrop-filter: blur(var(--blur-amount));
  transition: var(--transition-bounce);
}

.icon-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* Progress bar system */
.progress-bar-container {
  position: absolute;
  top: 64px;
  left: 16px;
  right: 16px;
  height: 24px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  z-index: 10;
  overflow: hidden;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  box-shadow: var(--shadow-neon);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}

.progress-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* Feed container (Scroll snapping) */
.feed-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  background-color: #000;
}

.feed-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

/* Slide Container */
.lesson-slide {
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  overflow: hidden;
  background-color: #030303;
}

/* Videos overlay/fit */
.slide-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

/* Click overlay to catch taps */
.video-click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
}

/* Play/Pause icon feedback */
.play-pause-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 80px;
  height: 80px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.play-pause-icon.paused {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}


/* Gradient shading overlays */
.slide-overlay-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 250px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 40%, rgba(0, 0, 0, 0) 100%);
  z-index: 2;
  pointer-events: none;
}

.slide-overlay-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 320px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Overlay contents: Bottom left details */
.slide-info {
  position: absolute;
  bottom: 30px;
  left: 16px;
  right: 80px; /* Leave space for sidebar buttons */
  z-index: 3;
  color: var(--text-primary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.subject-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
  color: #c084fc;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.lesson-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.lesson-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Sidebar action overlay: Bottom right buttons */
.sidebar-controls {
  position: absolute;
  bottom: 30px;
  right: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sidebar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
}

.btn-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(var(--blur-amount));
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: var(--transition-bounce);
}

.btn-circle svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.sidebar-btn span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.3px;
}

/* Sidebar button specific styling & hover effects */
.sidebar-btn:hover .btn-circle {
  transform: scale(1.08);
}

.btn-understand:hover .btn-circle {
  border-color: rgba(236, 72, 153, 0.4);
  color: var(--accent-rose);
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.25);
}

.btn-understand.completed .btn-circle {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  color: white;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
  animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.5);
}

.btn-understand.completed span {
  color: var(--accent-rose);
  font-weight: 700;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.btn-play-toggle:hover .btn-circle {
  border-color: var(--border-active);
  color: #8b5cf6;
  box-shadow: var(--shadow-neon);
}

.btn-notes:hover .btn-circle {
  border-color: var(--border-active);
  color: #8b5cf6;
  box-shadow: var(--shadow-neon);
}

.btn-quiz:hover .btn-circle {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.btn-quiz.passed .btn-circle {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: white;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* Double click heart anim overlay */
.double-click-heart {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 5;
  color: var(--accent-rose);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.8));
}

.double-click-heart.animate {
  animation: clickHeart 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes clickHeart {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.9; }
  60% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

/* Video loading state spinner */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  z-index: 2;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Overlay: Swipe navigation arrows (desktop fallback helper) */
.nav-assist {
  position: absolute;
  right: -52px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}

.nav-arrow {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.nav-arrow:hover:not(:disabled) {
  background: #8b5cf6;
  border-color: #8b5cf6;
  box-shadow: var(--shadow-neon);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-arrow svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 580px) {
  .nav-assist {
    display: none; /* Hide nav arrows on small mobile viewports */
  }
}

/* Drawer: Bottom sheet styling (Notes) */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer.open {
  visibility: visible;
  opacity: 1;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.drawer-content {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 450px;
  height: 70%;
  background: rgba(18, 18, 22, 0.95);
  border-top: 1px solid var(--border-light);
  border-radius: 24px 24px 0 0;
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  z-index: 101;
}

.drawer.open .drawer-content {
  transform: translateX(-50%) translateY(0);
}

.drawer-header {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.drawer-handle {
  width: 40px;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.drawer-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Custom Markdown Rendering inside Drawer */
.drawer-body h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  margin-top: 5px;
  margin-bottom: 12px;
  color: #a78bfa;
}

.drawer-body h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  margin-top: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 4px;
}

.drawer-body p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.drawer-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.drawer-body ul {
  margin-left: 20px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.drawer-body li {
  margin-bottom: 6px;
}

.drawer-body em {
  color: #f472b6;
  font-style: italic;
}

/* Math block formula display */
.math-formula {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #60a5fa;
  margin: 12px 0;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Modal Popup Window (Quiz & Admin) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.open {
  visibility: visible;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 390px;
  background: rgba(20, 20, 25, 0.95);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  backdrop-filter: blur(24px);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(139, 92, 246, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 201;
}

.modal.open .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #c084fc;
}

.quiz-question {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.option-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* Quiz grading styles */
.option-btn.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: #a7f3d0;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.option-btn.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-crimson);
  color: #fca5a5;
  font-weight: 600;
}

.option-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.option-btn.correct:disabled, .option-btn.incorrect:disabled {
  opacity: 1;
}

/* Explanation Panel */
.quiz-explanation {
  margin-top: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid #60a5fa;
  border-radius: 4px 8px 8px 4px;
  font-size: 13px;
  line-height: 1.5;
  animation: fadeIn 0.4s ease forwards;
}

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

.explanation-title {
  display: block;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.quiz-explanation p {
  color: var(--text-secondary);
}

/* Intro overlay tutorial screen */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #030303;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.intro-box {
  width: 100%;
  max-width: 380px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-animation {
  width: 100px;
  height: 100px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #a78bfa;
  margin-bottom: 24px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: var(--shadow-neon);
}

.hand-swipe-icon {
  width: 48px;
  height: 48px;
  animation: swipeAnim 2s infinite ease-in-out;
}

@keyframes swipeAnim {
  0% { transform: translateY(15px); opacity: 0; }
  20% { opacity: 1; }
  60% { transform: translateY(-15px); opacity: 1; }
  80% { opacity: 0; }
  100% { transform: translateY(15px); opacity: 0; }
}

.intro-box h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.intro-box p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.primary-btn {
  background: var(--primary-gradient);
  border: none;
  color: white;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: var(--shadow-neon);
  transition: var(--transition-bounce);
}

.primary-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
}

.primary-btn:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Admin Panel Specific Styles
   ========================================================================== */

.admin-modal-content {
  max-width: 430px;
  height: 85vh;
  display: flex;
  flex-direction: column;
}

.admin-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-neon);
}

.admin-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar for Admin Panel */
.admin-body::-webkit-scrollbar {
  width: 5px;
}
.admin-body::-webkit-scrollbar-track {
  background: transparent;
}
.admin-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Lesson Management List styling */
.admin-list-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.admin-lessons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-lesson-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 12px 16px;
  transition: var(--transition-smooth);
}

.admin-lesson-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.item-subj {
  font-size: 10px;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-btn-edit:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
  color: #c084fc;
}

.action-btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-crimson);
  color: #fca5a5;
}

/* Forms & Inputs styling */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.form-group.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  font-size: 10px;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, 
.form-group textarea, 
.form-group select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.form-group textarea {
  resize: vertical;
}

.input-tip {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-divider {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #ec4899;
  letter-spacing: 1px;
  margin-top: 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(236, 72, 153, 0.2);
}

.form-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: 12px;
  margin-top: 8px;
  margin-bottom: 16px;
}

/* Tab 3: Backup & Share Panel styles */
.backup-info {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.inline-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  align-self: flex-start;
}

#import-area {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  line-height: 1.4;
}

/* ==========================================================================
   Global Site Password Lock Overlay Styles
   ========================================================================== */

/* Global Site Password Lock Overlay Styles Removed */

/* ==========================================================================
   Responsive Adaptations & Layout Media Queries
   ========================================================================== */

/* 1. Very Small Devices (Phones under 360px width or short screens) */
@media (max-height: 680px) {
  .progress-bar-container {
    top: 58px;
    height: 20px;
  }
  .app-header {
    height: 56px;
  }
  .sidebar-controls {
    gap: 10px;
    bottom: 20px;
  }
  .btn-circle {
    width: 42px;
    height: 42px;
  }
  .slide-info {
    bottom: 20px;
  }
  .lesson-title {
    font-size: 18px;
  }
  .drawer-content {
    height: 80%; /* Give it more room on short heights */
  }
}

/* 2. Tablet Devices (min-width: 768px) */
@media (min-width: 768px) {
  /* Center the app container gracefully on tablet resolutions */
  #app-container {
    max-width: 480px;
    max-height: 940px;
  }
  
  .lesson-title {
    font-size: 24px;
  }
  
  .lesson-desc {
    font-size: 14px;
  }
  
  .sidebar-btn span {
    font-size: 11px;
  }
}

/* 3. Desktops & Laptops (min-width: 1024px) */
@media (min-width: 1024px) {
  /* Center constraint */
  #app-container {
    max-width: 450px;
    max-height: 900px;
  }
}
