/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Modern design tokens inspired by design brief */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #64748b;
  --accent-color: #10b981;
  --background: #ffffff;
  --background-alt: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-alt);
}

/* ===== NAVIGATION ===== */
.navbar {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.navbar-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.navbar-link:hover {
  color: var(--primary-color);
}

/* ===== HERO SECTION ===== */
.landing-hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.landing-hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.landing-hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.95;
  max-width: 600px;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== SECTIONS ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* ===== COURSE CARDS ===== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.course-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow-hover);
}

.course-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.course-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: 500;
}

.course-content {
  padding: 1.5rem;
}

.course-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.course-instructor {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.course-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.9375rem;
}

.course-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.course-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.course-price-free {
  color: var(--accent-color);
}

/* ===== FILTERS & SEARCH ===== */
.filters-section {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.filters-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.filter-select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* ===== COURSE DETAILS PAGE ===== */
.course-detail-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.course-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.course-detail-main {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.course-detail-main h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.course-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.course-detail-thumbnail {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.course-detail-sidebar {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.curriculum-section {
  margin-top: 3rem;
}

.curriculum-section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.lesson-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lesson-item {
  padding: 1rem;
  background: var(--background-alt);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===== ENROLLMENT PAGE ===== */
.enrollment-container {
  max-width: 600px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.enrollment-card {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.enrollment-summary {
  padding: 1.5rem;
  background: var(--background-alt);
  border-radius: 8px;
  margin-bottom: 2rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.summary-total {
  font-size: 1.5rem;
  font-weight: 700;
  padding-top: 1rem;
  border-top: 2px solid var(--border-color);
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: #64748b;
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* ===== AUTH PAGES ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.auth-box h2 {
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
}

.auth-link {
  text-align: center;
  margin-top: 1rem;
}

/* ===== ADMIN/DASHBOARD LAYOUT ===== */
.admin-layout,
.instructor-layout,
.student-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #2c3e50;
  color: white;
  padding: 1rem;
}

.sidebar-header {
  padding: 1rem 0;
  border-bottom: 1px solid #34495e;
  margin-bottom: 1rem;
}

.sidebar-header h3 {
  color: white;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.nav-link {
  padding: 0.75rem 1rem;
  color: #ecf0f1;
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  transition: background 0.3s;
}

.nav-link:hover {
  background: #34495e;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-header {
  background: white;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-body {
  flex: 1;
  padding: 2rem;
}

/* ===== DASHBOARD STATS ===== */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #667eea;
}

/* ===== FORMS ===== */
.form-container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
}

/* ===== TABLES ===== */
.table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.data-table tr:hover {
  background: #f8f9fa;
}

.table-thumbnail {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* ===== BADGES ===== */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-admin {
  background: #e74c3c;
  color: white;
}

.badge-instructor {
  background: #3498db;
  color: white;
}

.badge-student {
  background: #2ecc71;
  color: white;
}

.badge-active {
  background: #2ecc71;
  color: white;
}

.badge-inactive {
  background: #95a5a6;
  color: white;
}

.badge-draft {
  background: #f39c12;
  color: white;
}

.badge-completed {
  background: #2ecc71;
  color: white;
}

.badge-pending {
  background: #f39c12;
  color: white;
}

.badge-failed {
  background: #e74c3c;
  color: white;
}

/* ===== ALERTS ===== */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.alert-success {
  background: #efe;
  color: #383;
  border: 1px solid #cfc;
}

/* ===== LESSON PAGE ===== */
.lesson-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lesson-sidebar {
  background: #f8f9fa;
  padding: 1.5rem;
}

.lesson-link {
  display: block;
  padding: 0.75rem;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  transition: background 0.3s;
}

.lesson-link:hover {
  background: #e9ecef;
}

.lesson-link.active {
  background: #667eea;
  color: white;
}

.lesson-content {
  padding: 2rem;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  border-radius: 8px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.lesson-text {
  line-height: 1.8;
  color: #444;
}

.preview-image {
  max-width: 300px;
  border-radius: 8px;
  margin-top: 0.5rem;
}

.page-actions {
  margin-bottom: 2rem;
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.text-muted {
  color: #999;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .landing-hero h1 {
    font-size: 2rem;
  }

  .course-detail-grid {
    grid-template-columns: 1fr;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .navbar-container {
    padding: 1rem;
  }

  .section {
    padding: 2rem 1rem;
  }
}
