:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --accent: #4cc9f0;
  --accent-light: #7dd3f7;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4bb543;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 10px 15px rgba(67, 97, 238, 0.15);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--light-bg);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  z-index: 1000;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

.filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem; /* Reduced from 2rem */
}

.filter-btn {
  background-color: #ffffff;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  font-size: 0.95rem;
}

.filter-btn.active,
.filter-btn:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(67, 97, 238, 0.2);
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
}

.lesson-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(67, 97, 238, 0.1);
}

.lesson-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(67, 97, 238, 0.15);
}

.lesson-image {
  height: 220px;
  position: relative;
  overflow: hidden;
}

.lesson-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.lesson-card:hover .lesson-image img {
  transform: scale(1.1);
}

.lesson-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(67, 97, 238, 0.2);
}

.lesson-content {
  padding: 1.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lesson-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* Fallback */
}

.lesson-description {
  color: #64748b;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.lesson-meta {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.meta-item {
  display: flex;
  align-items: center;
  margin-right: 1.5rem;
}

.meta-item svg {
  margin-right: 0.4rem;
}

.lesson-button {
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.9rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  margin-top: auto;
  border: none;
}

.lesson-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(67, 97, 238, 0.25);
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .lessons-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  main.content {
    margin-top: 70px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .lessons-grid {
    grid-template-columns: 1fr;
  }
}

.customization-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 1000;
  width: 300px;
  transition: transform 0.3s ease;
  transform: translateX(320px);
}

.customization-panel.open {
  transform: translateX(0);
}

.panel-trigger {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  box-shadow: var(--shadow);
}

.control-group {
  margin-bottom: 15px;
}

.control-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 0.9rem;
}

.control-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.color-picker {
  width: 100%;
  height: 35px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Adjust main content spacing */
main.content {
  padding-top: 60px; /* Reduced from 80px */
  margin-top: 0; /* Remove redundant margin */
  min-height: calc(100vh - 80px);
}

/* Override container styles for main content */
main.content .container {
  padding-top: 20px; /* Reduced padding since main already has padding */
}

.page-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem; /* Reduced from 3rem */
  padding: 1rem; /* Reduced padding */
}

.page-header h1 {
  margin-bottom: 1rem;
  background: linear-gradient(to right, var(--primary), var(--accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* Fallback */
}

.page-header .subtitle {
  color: var(--text-light);
  font-size: 1.2rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .page-header {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }
}
