:root {
  --bg-main: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

/* Navbar */
.navbar {
  height: 64px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 28px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.user-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

.btn-logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Classroom Container Grid */
.classroom-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex: 1;
}

/* Player Section */
.player-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.player-card {
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 520px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-wrapper.mode-phone {
  height: 600px;
}

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

/* Dynamic Anti-Screen Record Watermark */
.security-watermark {
  position: absolute;
  top: 15%;
  left: 15%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 8px;
  pointer-events: none;
  user-select: none;
  z-index: 50;
  transition: all 2.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.video-loading {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--accent-cyan);
  font-size: 14px;
  font-weight: 600;
  z-index: 40;
  transition: opacity 0.3s;
}

.video-loading.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Controls Bar */
.player-controls {
  background: #0b0f19;
  border-top: 1px solid var(--border-color);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ctrl-left, .ctrl-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.time-display {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

.speed-selector {
  position: relative;
}

.speed-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  width: 130px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 60;
}

.speed-menu.show {
  display: flex;
}

.speed-opt {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
}

.speed-opt:hover, .speed-opt.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

/* Module Info Card */
.module-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
}

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

.badge-module {
  display: inline-block;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.module-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.4px;
  line-height: 1.3;
}

.module-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.btn-complete {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-green);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-complete:hover {
  background: var(--accent-green);
  color: #fff;
}

.btn-complete.completed {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

/* Tabs */
.info-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tab-content.hidden {
  display: none;
}

.notes-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tool-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.tool-icon {
  font-size: 26px;
}

.tool-item strong {
  display: block;
  font-size: 13px;
  color: #fff;
  margin-bottom: 4px;
}

.tool-item p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.tool-link {
  font-size: 12px;
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 700;
}

/* Sidebar Section */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
}

.progress-label strong {
  color: var(--accent-green);
  font-weight: 800;
}

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

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-green) 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.progress-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Curriculum Card */
.curriculum-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.curriculum-header {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.curriculum-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.module-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.module-item.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--accent-cyan);
}

.item-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s;
}

.module-item.completed .item-check {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-num {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
}

.module-item.active .item-num {
  color: var(--accent-cyan);
}

.item-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

.item-duration {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 1024px) {
  .classroom-container {
    grid-template-columns: 1fr;
  }
  .curriculum-card {
    max-height: none;
  }
  .video-wrapper {
    height: 400px;
  }
}

@media (max-width: 640px) {
  .navbar {
    padding: 0 16px;
  }
  .classroom-container {
    padding: 12px;
    gap: 16px;
  }
  .video-wrapper {
    height: 280px;
  }
  .video-wrapper.mode-phone {
    height: 480px;
  }
  .module-title {
    font-size: 17px;
  }
}
