/* ============================================================
   Deglecy shared component styles
   Loaded on every page — cached once by the browser, reused
   across index.php, courses.php, and future pages that opt in.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #f5f6fa; color: #1a1a2e; margin: 0; }

/* ── CONTAINER ── */
.bt-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── HERO (shared shell — page CSS supplies .bt-hero-inner layout) ── */
.bt-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-radius: 0 0 40px 40px;
  background: linear-gradient(135deg, #0b0f2a 0%, #131736 40%, #0f2057 100%);
}
.bt-hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(79,70,229,0.18) 0%, transparent 70%);
  top: -100px; left: -100px;
  border-radius: 50%;
  animation: orb1 12s ease-in-out infinite alternate;
}
.bt-hero::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
  bottom: -80px; right: 200px;
  border-radius: 50%;
  animation: orb2 15s ease-in-out infinite alternate;
}
@keyframes orb1 { to { transform: translate(80px, 60px); } }
@keyframes orb2 { to { transform: translate(-60px, -40px); } }

.bt-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(79,70,229,0.2);
  border: 1px solid rgba(79,70,229,0.4);
  color: #a5b4fc;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 22px;
}

.bt-hero-title {
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.bt-hero-title span {
  background: linear-gradient(90deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 900px) {
  .bt-hero { border-radius: 0 0 24px 24px; }
}

/* Breadcrumb visible fix */
.breadcrumb-item a,
.breadcrumb-item.active,
.breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255,255,255,0.8) !important;
}
nav[aria-label="breadcrumb"] { color: rgba(255,255,255,0.7); }

/* ── COURSE ROWS (scrollable) ── */
.bt-courses-section { padding: 0 0 48px; }
.bt-courses-section + .bt-courses-section {
  border-top: 1px solid #e9ecef;
  padding-top: 48px;
}

.bt-row-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.bt-row-title { font-size: 1.3rem; font-weight: 800; color: #1a1a2e; margin: 0; }
.bt-row-count { font-size: 12px; font-weight: 600; color: #9ca3af; margin-left: 8px; }
.bt-row-see-all {
  font-size: 14px;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.bt-row-see-all:hover { text-decoration: underline; color: #4f46e5; }

.bt-scroll-wrap { position: relative; }
.bt-scroll-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.bt-scroll-track::-webkit-scrollbar { height: 4px; }
.bt-scroll-track::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.bt-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  color: #374151;
  transition: background .15s, color .15s;
  font-size: 13px;
}
.bt-scroll-arrow:hover { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.bt-scroll-arrow.left { left: -14px; }
.bt-scroll-arrow.right { right: -14px; }

/* Grid layout (used for "All Courses" on courses.php) */
.bt-course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1000px) { .bt-course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .bt-course-grid { grid-template-columns: 1fr; } }

/* Course card */
.bt-course-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.bt-course-card.scrollable { flex: 0 0 220px; }
.bt-course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.10);
  color: inherit;
  text-decoration: none;
}
.bt-course-thumb-wrap { overflow: hidden; height: 140px; background: #e9ecef; }
.bt-course-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.bt-course-card:hover .bt-course-thumb { transform: scale(1.04); }
.bt-course-body { padding: 12px 16px 16px; }
.bt-course-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bt-course-desc {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bt-course-cta {
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
  display: flex;
  align-items: center;
  gap: 4px;
}
.bt-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ede9fe;
  color: #6d28d9;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
@media (max-width: 600px) {
  .bt-course-card.scrollable { flex: 0 0 72vw; }
}

/* AI-generated course card */
.bt-ai-card {
  flex: 0 0 260px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.bt-ai-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.10);
  color: inherit;
  text-decoration: none;
}
.bt-ai-card-head {
  background:
    linear-gradient(135deg, rgba(11,15,42,0.88) 0%, rgba(19,23,54,0.80) 40%, rgba(79,70,229,0.65) 140%),
    url('https://deglecy.com/assets/img/course-placeholder.jpeg') center/cover no-repeat;
  padding: 16px 16px 14px;
  position: relative;
}
.bt-ai-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #c7d2fe;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.bt-ai-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.bt-ai-card-body { padding: 12px 16px 16px; }
.bt-ai-card-desc {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.bt-ai-card-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bt-ai-card-meta span { font-size: 11.5px; color: #6b7280; display: flex; align-items: center; gap: 4px; }
.bt-ai-card-cta { font-size: 12px; font-weight: 600; color: #4f46e5; display: flex; align-items: center; gap: 4px; }
@media (max-width: 600px) { .bt-ai-card { flex: 0 0 72vw; } }

.bt-empty { font-size: 14px; color: #9ca3af; padding: 20px 0; }

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid #d1d5db;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back-to-top {
  position: fixed; bottom: 90px; right: 24px; z-index: 998;
  width: 44px; height: 44px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
}
