:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --bg-light: #f9fafb;
  --text-light: #1f2937;
  --card-light: #ffffff;
  --border: #e5e7eb;
  --module-bg: rgba(255, 255, 255, 0.1);
  --module-active: rgba(255, 255, 255, 0.2);
  --sidebar-bg: linear-gradient(to bottom, #1e3a8a, #2563eb);
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --bg-light: #1a1a1a;
  --text-light: #f3f4f6;
  --card-light: #2d2d2d;
  --border: #4b5563;
  --module-bg: rgba(0, 0, 0, 0.2);
  --module-active: rgba(0, 0, 0, 0.3);
  --sidebar-bg: linear-gradient(to bottom, #111827, #1e3a8a);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  display: flex;
  height: 100vh;
  background: var(--bg-light);
  color: var(--text-light);
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.sidebar-container {
  width: 260px;
  background: var(--sidebar-bg);
  color: white;
  padding: 20px;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
  position: relative;
}

.sidebar-container.collapsed {
  transform: translateX(-100%);
  position: absolute;
  z-index: 100;
}

.sidebar h2 {
  font-size: 22px;
  margin-top: 60px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  text-align: center;
}

.module {
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.module-header {
  background-color: var(--module-bg);
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: background 0.2s ease;
}

.module-header:hover {
  background-color: var(--module-active);
}

.module-header .module-icon {
  margin-right: 10px;
  transition: transform 0.2s ease;
  font-size: 12px;
}

.module.active .module-header .module-icon {
  transform: rotate(90deg);
}

.module-content {
  display: none;
  padding: 5px 0;
}

.module.active .module-content {
  display: block;
}

.video-item {
  padding: 8px 15px 8px 30px;
  cursor: pointer;
  color: #e0e7ff;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  position: relative; /* Added for progress bar positioning */
  padding-bottom: 15px; /* Added space for the progress bar */
}

.video-item:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.video-item i {
  margin-right: 10px;
  color: var(--primary-light);
}

/* --- Added CSS for disabled video items --- */
.video-item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.video-item.disabled i {
  color: #9ca3af;
}

.video-item.disabled:hover {
  background-color: transparent;
  color: #e0e7ff;
}
/* ------------------------------------------- */

/* --- Added CSS for the progress bar --- */
.progress-bar {
  position: absolute;
  bottom: 5px; /* Position it at the bottom of the video-item div */
  left: 30px;
  width: calc(100% - 45px); /* Full width minus padding */
  height: 4px; /* Thickness of the bar */
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  transition: background-color 0.5s ease;
}

.progress-fill {
  height: 100%;
  width: 0; /* Starts at 0% */
  background-color: var(--primary-light);
  transition: width 0.5s ease-in-out; /* Smooth animation for filling */
}

/* Style for completed videos */
.video-item.completed .progress-fill {
  background-color: #22c55e; /* A green color for completed */
}
/* ------------------------------------------- */

.main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.tooltip-wrapper {
  position: fixed;
  z-index: 2000;
}

.tooltip-text {
  visibility: hidden;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 8px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  white-space: nowrap;
  margin-top: 4px;
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

#sidebarToggle {
  background: var(--primary);
  color: white;
  border: none;
  font-size: 16px;
  padding: 6px 8px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
}

.theme-toggle {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 2000;
}

#themeToggle {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: background 0.2s ease;
}

#themeToggle:hover {
  background: var(--primary-light);
}

.tooltip-wrapper#sidebarTooltip {
  top: 4px;
  left: 4px;
}

.card {
  background: var(--card-light);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease;
}

input[type="text"] {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 16px;
  margin-top: 10px;
  background: var(--card-light);
  color: var(--text-light);
}

button {
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--primary-light);
}

.video-container-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.video-nav {
  display: flex;
  gap: 10px;
}

.nav-btn {
  padding: 8px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.video-player {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin-top: 15px;
  border-radius: 8px;
  background: #000;
}

.video-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.video-player {
  animation: fadeIn 0.5s ease-in-out;
}


.video-player {
  position: relative;
  height: 100px;         /* Reduce height here */
  max-width: 760px;      /* Adjust width */
  margin: 0 auto;
  margin-top: 15px;
  border-radius: 8px;
  background: #000;
  overflow: hidden;
}

.video-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;         /* Match height */
  border: none;
}

@media (max-width: 768px) {
  .video-player {
    height: 90px; /* Slightly lower for smaller screens */
    max-width: 100%;
  }
}

