/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

:root {
  --primary-color: #4f46e5;
  --primary-dark: #4338ca;
  --secondary-color: #64748b;
  --success-color: #22c55e;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   NAVIGATION BAR
   ======================================== */

.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  font-weight: 700;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background: rgba(79, 70, 229, 0.1);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.938rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-large {
  padding: 0.875rem 2rem;
  font-size: 1.063rem;
}

.btn-block {
  width: 100%;
  display: block;
}

/* ========================================
   LANDING PAGE
   ======================================== */

.landing-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  padding: 2rem;
  text-align: center;
  background: var(--surface);
}

.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.hero {
  position: relative;
  width: 100%;
  margin: 0 auto 4rem;
  padding: 4rem 2rem;
  background-image: linear-gradient(120deg, rgba(15, 23, 42, 0.78), rgba(79, 70, 229, 0.55)), url('assets/images/hero-banner.png');
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: #f8fafc;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 35%),
              radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.06), transparent 35%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 720px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-tag {
  display: inline-block;
  width: fit-content;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.18);
  color: #e0e7ff;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero h2 {
  font-size: 2.85rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
  line-height: 1.15;
}

.hero p {
  font-size: 1.1rem;
  color: #e2e8f0;
  margin-bottom: 1rem;
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hero-secondary-cta {
  margin-top: 0.25rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  width: 100%;
}

.feature-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.938rem;
}

.landing-footer {
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ========================================
   AUTH PAGES (LOGIN/SIGNUP)
   ======================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--surface);
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.auth-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.938rem;
}

.form-group input {
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.error-message {
  background: #fee;
  color: var(--danger-color);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: none;
}

.success-message {
  background: #d1fae5;
  color: var(--success-color);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ========================================
   DASHBOARD
   ======================================== */

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-content h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.stat-content p {
  color: var(--text-secondary);
  font-size: 0.938rem;
}

.my-courses-section {
  margin-top: 3rem;
}

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

.section-header h2 {
  font-size: 1.75rem;
}

/* ========================================
   COURSE CARDS & GRID
   ======================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.course-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.course-header h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  flex: 1;
}

.course-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.course-description {
  color: var(--text-secondary);
  font-size: 0.938rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--success-color);
  transition: width 0.3s;
}

.course-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.lesson-count {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.course-enrolled {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.enrolled-badge {
  color: var(--success-color);
  font-weight: 600;
  font-size: 0.875rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ========================================
   COURSE DETAILS
   ======================================== */

.course-details-container {
  max-width: 900px;
  margin: 0 auto;
}

.breadcrumb {
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.course-detail-header {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.course-detail-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.course-detail-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.course-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.info-item {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.info-icon {
  font-size: 2rem;
}

.info-item strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.info-item p {
  color: var(--text-secondary);
  font-size: 0.938rem;
}

.enrolled-status {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-align: center;
  margin-bottom: 2rem;
}

.enrolled-badge-large {
  display: inline-block;
  background: rgba(34, 197, 94, 0.1);
  color: var(--success-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 1rem;
}

.course-curriculum {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.course-curriculum h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.lesson-list {
  list-style: none;
}

.lesson-list .lesson-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lesson-list .lesson-item:last-child {
  border-bottom: none;
}

.lesson-number {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary-color);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

.lesson-title {
  flex: 1;
  font-weight: 500;
}

/* ========================================
   LESSONS PAGE
   ======================================== */

.lessons-container {
  max-width: 1000px;
  margin: 0 auto;
}

.lessons-header {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.lessons-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.lessons-header p {
  color: var(--text-secondary);
}

.progress-summary {
  text-align: center;
}

.progress-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
}

.progress-circle span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.progress-summary p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lessons-list .lesson-item {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.2s;
}

.lessons-list .lesson-item:hover {
  box-shadow: var(--shadow-lg);
}

.lessons-list .lesson-item.completed {
  background: rgba(34, 197, 94, 0.05);
  border-left: 4px solid var(--success-color);
}

.lesson-number-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.lesson-content {
  flex: 1;
}

.lesson-content h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.lesson-checkbox {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  cursor: pointer;
}

.checkbox-label {
  color: var(--text-secondary);
  font-size: 0.938rem;
}

.lesson-status {
  flex-shrink: 0;
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success-color);
}

.status-badge.pending {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-secondary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .hero {
    padding: 2.5rem 1.25rem;
  }

  .nav-menu {
    flex-direction: column;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    text-align: center;
  }

  .hero h2 {
    font-size: 2.1rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .cta-buttons {
    justify-content: center;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .stats-section {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .lessons-header {
    flex-direction: column;
    text-align: center;
  }

  .lessons-list .lesson-item {
    flex-direction: column;
    text-align: center;
  }

  .course-info {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .container,
  .dashboard-container,
  .lessons-container,
  .course-details-container {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .dashboard-header h2 {
    font-size: 1.5rem;
  }

  .course-detail-header h1 {
    font-size: 1.75rem;
  }
}
