/* ─────────────────────────────────────────
   Affiliate Ninja — Course Viewer CSS
   ───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Grotesk:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:      #1a44ff;
  --blue-dark: #0a22bb;
  --cyan:      #00ccff;
  --bg:        #04050f;
  --bg-sidebar:#070a18;
  --bg-card:   #0d1022;
  --border:    rgba(26,68,255,0.15);
  --text:      #eef0ff;
  --muted:     #6a70a0;
  --active:    rgba(0,204,255,0.08);
  --active-border: rgba(0,204,255,0.35);

  --font-sans:     'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display:  'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top navbar ── */
.course-nav {
  background: rgba(7,10,24,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav-logo img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(0,204,255,0.25));
}
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-greeting {
  font-size: 0.85rem;
  color: var(--muted);
}
.nav-greeting span { color: var(--cyan); font-weight: 600; }

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--muted);
  padding: 7px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--cyan); color: var(--text); }

.btn-register-nav {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: #031018;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.2s, box-shadow 0.2s;
}
.btn-register-nav:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 16px rgba(0, 204, 255, 0.35);
}

.btn-register-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: #031018;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 26px;
  border-radius: 6px;
  text-decoration: none;
  transition: filter 0.2s, box-shadow 0.2s;
}
.btn-register-cta:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 22px rgba(0, 204, 255, 0.4);
}

/* ── Layout ── */
.course-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  min-height: 0;
}

/* ── Sidebar (lesson list) ── */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.sidebar-back-btn:hover {
  color: var(--cyan);
  transform: translateX(-2px);
}
.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.course-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.lesson-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* Scrollbar */
.lesson-list::-webkit-scrollbar { width: 4px; }
.lesson-list::-webkit-scrollbar-track { background: transparent; }
.lesson-list::-webkit-scrollbar-thumb { background: rgba(0,204,255,0.2); border-radius: 2px; }

.lesson-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.lesson-card:hover {
  background: rgba(0,204,255,0.04);
  border-left-color: rgba(0,204,255,0.3);
}
.lesson-card.active {
  background: var(--active);
  border-left-color: var(--cyan);
}

.lesson-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(0,204,255,0.25);
  min-width: 28px;
  transition: color 0.2s;
}
.lesson-card.active .lesson-num,
.lesson-card:hover .lesson-num { color: var(--cyan); }

.lesson-info { flex: 1; min-width: 0; }
.lesson-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-play {
  font-size: 0.6rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s;
}
.lesson-card:hover .lesson-play,
.lesson-card.active .lesson-play { opacity: 1; color: var(--cyan); }

/* ── Player panel ── */
#player-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  flex-shrink: 0;
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-meta {
  padding: 28px 32px;
  flex: 1;
}
#video-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
#video-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 700px;
}

/* ── States ── */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  text-align: center;
  color: var(--muted);
  padding: 40px;
  gap: 12px;
}
.state-icon { font-size: 3rem; }
.state-box p { font-size: 0.95rem; line-height: 1.6; }

/* ── Complete Button ── */
.btn-complete {
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-complete:hover {
  background: rgba(0, 204, 255, 0.08);
}
.btn-complete.completed {
  background: rgba(0, 204, 136, 0.1);
  border-color: #00cc88;
  color: #00cc88;
}
.btn-complete.completed:hover {
  background: rgba(0, 204, 136, 0.18);
}

/* Sidebar completion indicator */
.lesson-card .lesson-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  margin-right: 2px;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: transparent;
  font-weight: 700;
}
.lesson-card.completed .lesson-check {
  border-color: #00cc88;
  background: rgba(0, 204, 136, 0.1);
  color: #00cc88;
}

/* ── Navigation Buttons & Course Dropdown ── */
.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
  flex: 1;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-links::-webkit-scrollbar {
  display: none;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-btn:hover {
  color: var(--text);
  border-color: rgba(0, 204, 255, 0.35);
  background: rgba(0, 204, 255, 0.06);
}
.nav-btn.active {
  color: var(--cyan);
  border-color: rgba(0, 204, 255, 0.45);
  background: rgba(0, 204, 255, 0.1);
  box-shadow: 0 0 14px rgba(0, 204, 255, 0.12);
}
/* ── Badges ── */
.course-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.badge-free {
  background: rgba(0, 204, 255, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 204, 255, 0.25);
}
.badge-locked {
  background: rgba(255, 100, 100, 0.1);
  color: #ff6464;
  border: 1px solid rgba(255, 100, 100, 0.25);
}
.badge-unlocked {
  background: rgba(0, 204, 136, 0.1);
  color: #00cc88;
  border: 1px solid rgba(0, 204, 136, 0.25);
}

/* Course & Resource category icons in sidebar */
.course-nav-card .lesson-check,
.resource-cat-card .lesson-check {
  border: none;
  background: transparent;
  color: var(--cyan);
  font-size: 1rem;
  width: 22px;
  height: 22px;
}

/* Loading & Empty states in sidebar */
.lessons-loading,
.lessons-empty,
.lessons-error {
  padding: 18px 20px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .course-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 280px;
  }
  .course-nav { padding: 12px 16px; gap: 10px; }
  .nav-left { gap: 12px; }
  .nav-links { gap: 8px; }
  .nav-btn { padding: 7px 12px; font-size: 0.8rem; }
  .nav-greeting { display: none; }
  .video-meta { padding: 20px; }
}

/* Locked lesson styles */
.lesson-card.locked {
  opacity: 0.6;
}
.lesson-card.locked:hover {
  background: rgba(255, 255, 255, 0.02);
  border-left-color: rgba(255, 255, 255, 0.1);
}
.lesson-card.locked .lesson-num {
  color: rgba(255, 255, 255, 0.15) !important;
}
.lesson-card.locked .lesson-play {
  color: var(--muted);
  opacity: 1;
}
.lesson-card.locked.active {
  background: rgba(255, 255, 255, 0.03);
  border-left-color: var(--muted);
}

/* ── Resources Grid View in Dashboard ── */
#resources-view {
  background: var(--bg);
  overflow-y: auto;
  flex: 1;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

/* Resource Cards */
.res-card {
  background: rgba(13, 16, 34, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.res-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.res-card:hover {
  transform: translateY(-4px);
  border-color: var(--active-border);
  box-shadow: 0 10px 25px rgba(0, 204, 255, 0.08), inset 0 0 10px rgba(26, 68, 255, 0.05);
}

.res-card:hover::before {
  opacity: 1;
}

.res-card.featured {
  border-color: rgba(0, 204, 255, 0.25);
  background: rgba(13, 16, 34, 0.65);
}
.res-card.featured::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--blue));
}

.featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(0, 204, 255, 0.15);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(0, 204, 255, 0.3);
}

.card-header {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.res-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 700;
}
.res-badge {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

.res-desc {
  font-size: 0.85rem;
  color: #c4c9e2;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.res-meta {
  border-top: 1px solid rgba(26,68,255,0.08);
  padding-top: 12px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.meta-val {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.meta-val.difficulty-easy { color: #00cc88; }
.meta-val.difficulty-medium { color: var(--cyan); }
.meta-val.difficulty-hard { color: #ff6464; }

.card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(26, 68, 255, 0.1);
  border: 1px solid rgba(26, 68, 255, 0.3);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.card-cta span {
  transition: transform 0.2s ease;
  font-size: 0.7rem;
}
.card-cta:hover {
  background: var(--blue);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(26, 68, 255, 0.3);
}
.card-cta:hover span {
  transform: translate(2px, -2px);
}

