:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --text-dark: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --card: #ffffff;
}

body {
  background: #f8fafc;
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  padding-top: 20px;
}

.container-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Login Prompt */
.login-prompt {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.login-prompt-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.login-prompt-text {
  color: #92400e;
  font-weight: 500;
}

/* Search & Filters */
.controls-section {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 0.95rem;
}

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

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 0.95rem;
  width: 100%;
}

/* Complete Chapter Quiz */
.complete-chapter-section {
  margin-bottom: 2rem;
}

.complete-chapter-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: none;
  transition: all 0.3s ease;
}

.complete-chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.complete-chapter-media {
  position: relative;
  height: 140px;
  overflow: hidden;
}

.complete-chapter-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.chapter-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.4rem;
  text-align: center;
  padding: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
}

.complete-chapter-content {
  padding: 1.5rem;
  background: white;
}

.complete-chapter-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.complete-chapter-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.btn-chapter-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
  text-align: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: block;
  width: 100%;
}

.btn-chapter-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  color: white;
}

/* Subtopic Grid */
.subtopic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.subtopic-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.subtopic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.subtopic-media {
  position: relative;
  height: 120px;
  overflow: hidden;
}

.subtopic-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  text-align: center;
  padding: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
  from {
    text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 20px rgba(255,255,255,0.3);
  }
  to {
    text-shadow: 0 2px 15px rgba(0,0,0,0.9), 0 0 30px rgba(255,255,255,0.5);
  }
}

.subtopic-content {
  padding: 1.25rem;
}

.subtopic-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.subtopic-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.btn-subtopic-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: white;
  text-decoration: none;
  text-align: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: block;
  width: 100%;
}

.btn-subtopic-primary:hover {
  transform: translateY(-1px);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state i {
  font-size: 2rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

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

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

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

.breadcrumb-item.active {
  color: var(--text-light);
}

/* Modal */
.modal-content {
  border: none;
  border-radius: 12px;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  border: none;
  padding: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.quiz-option {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.quiz-option:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.quiz-option h6 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.quiz-option p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Responsive */
@media (min-width: 768px) {
  .controls-grid {
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
  }
  
  .subtopic-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}

/* Focus styles */
a:focus,
button:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}