/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

.card-body {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}

.card-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  line-height: 1.6;
}

.badge-primary {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-error {
  background: var(--error-bg);
  color: var(--error);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

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

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

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--fs-xs);
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-base);
}

.btn-icon {
  padding: var(--space-sm);
  border-radius: var(--border-radius-sm);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
}

/* Tabs */
.tab-group {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  gap: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: var(--fw-semibold);
}

.tab-content {
  display: none;
  padding: var(--space-lg) 0;
}

.tab-content.active {
  display: block;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-base);
}

.modal-backdrop.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

.modal-close {
  padding: var(--space-xs);
  border-radius: var(--border-radius-sm);
  font-size: var(--fs-xl);
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg-tertiary);
}

/* Tooltips */
.tooltip-trigger {
  position: relative;
  cursor: help;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--fs-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 200;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
}

.tooltip-trigger:hover .tooltip {
  opacity: 1;
}

/* Progress bar */
.progress-bar-container {
  background: var(--bg-tertiary);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--accent);
  transition: width var(--transition-slow);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.breadcrumb-item a {
  color: var(--text-muted);
}

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

.breadcrumb-sep::before {
  content: '/';
  margin: 0 var(--space-xs);
  color: var(--text-muted);
}

.breadcrumb-item:last-child {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

/* Search */
.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  padding-left: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  max-height: 400px;
  overflow-y: auto;
  z-index: 300;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-tertiary);
}

.search-result-category {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Section headings */
.section-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: var(--fs-md);
  margin-bottom: var(--space-xl);
}

/* Stat cards */
.stat-card {
  text-align: center;
  padding: var(--space-lg);
}

.stat-value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--accent);
}

.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Tag list */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tag {
  padding: 2px 8px;
  border-radius: var(--border-radius-sm);
  font-size: var(--fs-xs);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Theme toggle */
.theme-toggle {
  padding: var(--space-sm);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  opacity: 0.3;
}

/* Lesson Planner — Step list */
.step-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.step-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  border-left: 3px solid var(--border-color);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.step-item.completed { border-left-color: var(--success, #22c55e); }
.step-item.current { border-left-color: var(--accent); background: var(--accent-light, rgba(59,130,246,0.06)); }

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.step-icon.completed { background: var(--success, #22c55e); color: #fff; }
.step-icon.current { background: var(--accent); color: #fff; }

.step-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.step-title { font-weight: var(--fw-medium); font-size: var(--fs-sm); }

/* Module card header */
.module-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Difficulty badge */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  background: color-mix(in srgb, var(--diff-color) 15%, transparent);
  color: var(--diff-color);
}
