/* ===== SCORM Slide Player Styles ===== */

:root {
  --player-bg: #0f0f1a;
  --sidebar-bg: #161625;
  --sidebar-hover: #1e1e35;
  --sidebar-active: #2a2a4a;
  --toolbar-bg: #1a1a2e;
  --text-primary: #e8e8f0;
  --text-secondary: #9999bb;
  --accent: #6c63ff;
  --accent-hover: #7b73ff;
  --accent-glow: rgba(108, 99, 255, 0.3);
  --progress-bg: #2a2a3e;
  --progress-fill: linear-gradient(90deg, #6c63ff, #b063ff);
  --border: #2a2a3e;
  --radius: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--player-bg);
  color: var(--text-primary);
  overflow: hidden;
}

/* ===== Layout ===== */

.player-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ===== Sidebar (Table of Contents) ===== */

.sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease, opacity 0.3s ease;
  z-index: 10;
}

.sidebar.collapsed {
  margin-left: -200px;
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.lesson-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  list-style: none;
}

.toc-list::-webkit-scrollbar {
  width: 4px;
}

.toc-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.toc-item {
  padding: 10px 16px 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.toc-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.toc-item.active {
  background: var(--sidebar-active);
  color: var(--text-primary);
  border-left-color: var(--accent);
}

.toc-item.viewed {
  color: var(--text-primary);
}

.toc-item .toc-num {
  font-size: 11px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--progress-bg);
  flex-shrink: 0;
  transition: background 0.2s;
}

.toc-item.viewed .toc-num {
  background: var(--accent);
  color: white;
}

.toc-item.active .toc-num {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 8px var(--accent-glow);
}

.toc-item .toc-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* ===== Main Area ===== */

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== Top Toolbar ===== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--border);
  height: 52px;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background: var(--sidebar-hover);
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background: none;
  border-color: var(--border);
}

.btn-icon {
  padding: 8px;
  font-size: 16px;
  min-width: 36px;
  justify-content: center;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.slide-counter {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

/* ===== Progress Bar ===== */

.progress-bar {
  height: 3px;
  background: var(--progress-bg);
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  background: var(--progress-fill);
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}

/* ===== Slide Viewport ===== */

.slide-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--player-bg);
  position: relative;
  overflow: hidden;
}

.slide-frame {
  border: none;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== Completion Banner ===== */

.completion-banner {
  display: none;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.15), rgba(176, 99, 255, 0.1));
  border-top: 1px solid var(--accent);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  animation: fadeInUp 0.4s ease;
}

.completion-banner.visible {
  display: block;
}

/* ===== Keyboard Shortcuts Hint ===== */

.shortcuts-hint {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.6;
}

.kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--sidebar-hover);
  font-family: monospace;
}

/* ===== Animations ===== */

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

/* ===== Responsive ===== */

@media (max-width: 640px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }

  .sidebar.collapsed {
    margin-left: -200px;
  }

  .shortcuts-hint {
    display: none;
  }
}
