/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  outline: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.btn-primary {
  background: var(--purple-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--purple-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-black);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
  color: var(--text-darkblack);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

/* ================= STATS HERO CARDS ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
  border-color: var(--purple-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.stat-header, .stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-primary);
  border: 1px solid var(--purple-border);
}

.stat-icon-wrap svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-darkblack);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.stat-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= BATCH QUEUE SLOTS (X/5) ================= */
.batch-queue-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.queue-info h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-darkblack);
  margin-bottom: 4px;
}

.queue-info p {
  font-size: 12.5px;
  color: var(--text-muted);
}

.queue-slots-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.queue-slot {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1.5px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.queue-slot.filled {
  background: var(--purple-light);
  border: 1.5px solid var(--purple-primary);
  color: var(--purple-primary);
  box-shadow: 0 2px 12px var(--purple-glow);
  animation: slotPop 0.3s ease forwards;
}

@keyframes slotPop {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ================= LIVE TERMINAL STREAM ================= */
.terminal-box {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  height: 230px;
  overflow-y: auto;
  font-family: 'Poppins', monospace;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.15);
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
  word-break: break-all;
}

.log-time {
  color: #64748b;
  font-family: monospace;
  font-size: 11px;
}

.log-level {
  font-weight: 700;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.log-level.INFO {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.log-level.SUCCESS {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.log-level.WARNING {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.log-level.ERROR {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.log-msg {
  color: #e2e8f0;
  flex: 1;
}

/* ================= COURSE CATALOG ================= */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.search-box svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-dim);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-darkblack);
  font-size: 13px;
  width: 100%;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.filter-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-darkblack);
}

.filter-pill.active {
  background: var(--purple-light);
  border-color: var(--purple-primary);
  color: var(--purple-primary);
  font-weight: 600;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.course-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple-border);
  box-shadow: var(--shadow-hover);
}

.course-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.course-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 4px;
  background: var(--purple-light);
  color: var(--purple-primary);
  border: 1px solid var(--purple-border);
}

.course-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-darkblack);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.course-meta-item svg {
  width: 13px;
  height: 13px;
  stroke: var(--text-dim);
}

.course-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.course-free-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-success);
}

/* ================= SCRAPERS SWITCHBOARD ================= */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.source-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.source-card:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.source-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.source-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--purple-light);
  color: var(--purple-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.source-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-darkblack);
}

.source-status {
  font-size: 11px;
  color: var(--color-success);
  font-weight: 600;
}

/* iOS Style Clean Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border: 1px solid #cbd5e1;
  transition: 0.22s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.22s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--purple-primary);
  border-color: var(--purple-primary);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.checkbox-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.checkbox-card:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.checkbox-card input {
  accent-color: var(--purple-primary);
  width: 16px;
  height: 16px;
}

.checkbox-card span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-black);
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: var(--text-darkblack);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.12), 0 0 12px rgba(124, 58, 237, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success {
  border-left: 4px solid var(--color-success);
}

.toast.error {
  border-left: 4px solid var(--color-danger);
}

.toast.purple {
  border-left: 4px solid var(--purple-primary);
}

@keyframes slideIn {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
