:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb; /* Gray 50 */
  --bg-card: #ffffff;
  --fg-primary: #111827; /* Gray 900 */
  --fg-secondary: #4b5563; /* Gray 600 */
  --fg-muted: #9ca3af; /* Gray 400 */
  --accent: #d97706; /* Amber 600 - Better contrast on white */
  --accent-hover: #b45309; /* Amber 700 */
  --accent-light: rgba(217, 119, 6, 0.1);
  --success: #059669; /* Emerald 600 */
  --danger: #dc2626; /* Red 600 */
  --border: #e5e7eb; /* Gray 200 */
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--fg-primary);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Space Grotesk', sans-serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Background Effects for Light Mode */
.bg-grid-light {
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.2; /* Subtle glow */
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1-light {
  background: #fcd34d; /* Amber 300 */
  top: -200px;
  right: -200px;
}

.bg-glow-2-light {
  background: #93c5fd; /* Blue 300 */
  bottom: -200px;
  left: -200px;
}

/* Glass Effect Light */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.glass-light {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.btn-secondary {
  background: #ffffff;
  color: var(--fg-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.btn-ghost {
  background: transparent;
  color: var(--fg-secondary);
}
.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--fg-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Input */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--fg-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.input::placeholder { color: var(--fg-muted); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
  /* Light mode shadow */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card:hover {
  border-color: rgba(217, 119, 6, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* Progress Bar */
.progress-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f59e0b);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid var(--border);
  z-index: 100;
  transition: transform 0.3s ease;
  box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.05);
}

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1); }
  .main-content { margin-left: 0; }
}

/* Menu Item */
.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.menu-item:hover {
  background: #f3f4f6;
  color: var(--fg-primary);
}
.menu-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
}
.badge-primary {
  background: var(--accent-light);
  color: var(--accent);
}
.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}
.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Page Transitions */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Video Player */
.video-player {
  aspect-ratio: 16/9;
  background: #f3f4f6;
  border-radius: 0.75rem;
  overflow: hidden;
  position: relative;
}

/* Roadmap Node */
.roadmap-node {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4); /* Darker overlay for contrast */
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Stagger Animation */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerIn 0.5s ease forwards;
}

@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Quiz Styles */
.quiz-option {
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
}
.quiz-option:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.quiz-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.quiz-option.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}
.quiz-option.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Certificate Light */
.certificate {
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
  border: 2px solid var(--accent);
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
/* Pattern stays same */

/* Notes */
.note-card {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 1rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Tab */
.tab {
  padding: 0.75rem 1.5rem;
  color: var(--fg-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab:hover { color: var(--fg-primary); }
.tab.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  color: #111827;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}