/**
 * HAI Tech Academy - Modern Course Page
 * Individual course overview with lessons
 */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a24;
  --bg-hover: #22222e;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Heebo', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  z-index: 100;
  gap: 24px;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.back-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.back-link svg {
  width: 20px;
  height: 20px;
}

.navbar-logo {
  height: 36px;
}

/* ==================== HERO ==================== */
.course-hero {
  position: relative;
  padding: 120px 32px 80px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  overflow: hidden;
}

.course-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 60px;
  align-items: center;
  position: relative;
}

.course-info {
  z-index: 1;
}

.course-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.course-badge svg {
  width: 16px;
  height: 16px;
}

.course-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.course-description {
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 600px;
}

.course-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 15px;
}

.stat svg {
  width: 22px;
  height: 22px;
  color: var(--accent-light);
}

.course-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.btn svg {
  width: 20px;
  height: 20px;
}

/* ==================== COURSE THUMBNAIL ==================== */
.course-thumbnail {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.course-thumbnail img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-button {
  width: 80px;
  height: 80px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.play-button:hover {
  transform: scale(1.1);
}

.play-button svg {
  width: 32px;
  height: 32px;
  color: white;
  margin-right: -4px;
}

/* ==================== PROGRESS BANNER ==================== */
.progress-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -40px;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.progress-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-info p {
  color: var(--text-secondary);
  font-size: 14px;
}

.progress-bar-container {
  flex: 1;
  max-width: 400px;
  margin: 0 40px;
}

.progress-bar {
  height: 12px;
  background: var(--bg-hover);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #34d399);
  border-radius: 100px;
  transition: width 0.5s ease;
}

.progress-percentage {
  font-size: 24px;
  font-weight: 700;
  color: var(--success);
}

/* ==================== LESSONS SECTION ==================== */
.lessons-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
}

.lessons-count {
  color: var(--text-muted);
  font-size: 15px;
}

/* ==================== LESSON LIST ==================== */
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.lesson-card:hover {
  border-color: var(--accent);
  transform: translateX(-4px);
}

.lesson-card.completed {
  border-color: rgba(16, 185, 129, 0.3);
}

.lesson-card.active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.lesson-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  transition: var(--transition);
}

.lesson-card.completed .lesson-number {
  background: var(--success);
  color: white;
}

.lesson-card.active .lesson-number {
  background: var(--accent);
  color: white;
}

.lesson-content {
  flex: 1;
  min-width: 0;
}

.lesson-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.lesson-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lesson-meta-item svg {
  width: 14px;
  height: 14px;
}

.free-badge {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.locked-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.lesson-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.lesson-card.locked:hover {
  transform: none;
  border-color: var(--border);
}

.lesson-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.lesson-card:hover .lesson-action {
  background: var(--accent);
  color: white;
}

.lesson-action svg {
  width: 18px;
  height: 18px;
}

.completed-icon {
  color: var(--success);
}

/* ==================== MOBILE ==================== */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .course-thumbnail {
    max-width: 500px;
    margin: 0 auto;
  }

  .course-title {
    font-size: 32px;
  }

  .progress-banner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    margin: -40px 16px 40px;
  }

  .progress-bar-container {
    width: 100%;
    max-width: none;
    margin: 0;
  }
}

@media (max-width: 640px) {
  .course-hero {
    padding: 100px 16px 60px;
  }

  .course-title {
    font-size: 26px;
  }

  .course-stats {
    gap: 16px;
  }

  .lessons-section {
    padding: 0 16px 60px;
  }

  .lesson-card {
    padding: 16px;
    gap: 12px;
  }

  .lesson-number {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .lesson-title {
    font-size: 15px;
  }

  .lesson-action span {
    display: none;
  }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lesson-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.lesson-card:nth-child(1) { animation-delay: 0.1s; }
.lesson-card:nth-child(2) { animation-delay: 0.15s; }
.lesson-card:nth-child(3) { animation-delay: 0.2s; }
.lesson-card:nth-child(4) { animation-delay: 0.25s; }
.lesson-card:nth-child(5) { animation-delay: 0.3s; }
.lesson-card:nth-child(6) { animation-delay: 0.35s; }
.lesson-card:nth-child(7) { animation-delay: 0.4s; }
.lesson-card:nth-child(8) { animation-delay: 0.45s; }
