/* ==========================================================================
   Techlo LMS Pro – Frontend Styles
   ========================================================================== */

:root {
  --techlo-primary:      #4F46E5;
  --techlo-primary-dark: #3730A3;
  --techlo-secondary:    #10B981;
  --techlo-accent:       #F59E0B;
  --techlo-danger:       #EF4444;
  --techlo-bg:           #F8FAFC;
  --techlo-surface:      #FFFFFF;
  --techlo-border:       #E2E8F0;
  --techlo-text:         #1E293B;
  --techlo-text-muted:   #64748B;
  --techlo-radius:       12px;
  --techlo-shadow:       0 4px 24px rgba(79,70,229,.08);
  --techlo-shadow-lg:    0 8px 48px rgba(79,70,229,.15);
  --techlo-font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.techlo-lms { font-family: var(--techlo-font); color: var(--techlo-text); }

/* ── Course Grid ── */
.techlo-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 0;
}

.techlo-course-card {
  background: var(--techlo-surface);
  border-radius: var(--techlo-radius);
  box-shadow: var(--techlo-shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.techlo-course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--techlo-shadow-lg);
}

.techlo-course-card__thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--techlo-primary) 0%, var(--techlo-secondary) 100%);
}

.techlo-course-card__thumbnail--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
  min-height: 180px;
}

.techlo-course-card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.techlo-course-card__category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--techlo-primary); margin-bottom: 8px; }
.techlo-course-card__title { font-size: 16px; font-weight: 700; line-height: 1.4; margin: 0 0 8px; }
.techlo-course-card__title a { color: var(--techlo-text); text-decoration: none; }
.techlo-course-card__title a:hover { color: var(--techlo-primary); }
.techlo-course-card__meta { font-size: 13px; color: var(--techlo-text-muted); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.techlo-course-card__rating { color: var(--techlo-accent); font-weight: 600; }
.techlo-course-card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--techlo-border); }
.techlo-course-card__price { font-size: 18px; font-weight: 800; color: var(--techlo-primary); }
.techlo-course-card__price--free { color: var(--techlo-secondary); }
.techlo-course-card__badge { position: absolute; top: 12px; left: 12px; background: var(--techlo-primary); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; }

/* ── Buttons ── */
.techlo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .15s ease;
  white-space: nowrap;
}

.techlo-btn-primary { background: var(--techlo-primary); color: #fff; }
.techlo-btn-primary:hover { background: var(--techlo-primary-dark); color: #fff; transform: translateY(-1px); }
.techlo-btn-secondary { background: transparent; color: var(--techlo-primary); border: 2px solid var(--techlo-primary); }
.techlo-btn-secondary:hover { background: var(--techlo-primary); color: #fff; }
.techlo-btn-success { background: var(--techlo-secondary); color: #fff; }
.techlo-btn-danger { background: var(--techlo-danger); color: #fff; }
.techlo-btn-sm { padding: 6px 14px; font-size: 13px; }
.techlo-btn-lg { padding: 14px 28px; font-size: 16px; }
.techlo-btn-full { width: 100%; }

/* ── Dashboard Layout ── */
.techlo-dashboard {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 600px;
  gap: 0;
  background: var(--techlo-bg);
  border-radius: var(--techlo-radius);
  overflow: hidden;
  box-shadow: var(--techlo-shadow);
}

.techlo-sidebar {
  background: var(--techlo-text);
  padding: 32px 0;
  color: #fff;
}

.techlo-sidebar__avatar {
  text-align: center;
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 24px;
}

.techlo-sidebar__avatar img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--techlo-primary); object-fit: cover; }
.techlo-sidebar__name { font-weight: 700; font-size: 15px; margin: 12px 0 4px; }
.techlo-sidebar__role { font-size: 12px; opacity: .6; text-transform: uppercase; letter-spacing: .5px; }

.techlo-sidebar__nav { list-style: none; margin: 0; padding: 0; }
.techlo-sidebar__nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}
.techlo-sidebar__nav li a:hover,
.techlo-sidebar__nav li a.active { color: #fff; background: rgba(79,70,229,.3); border-left: 3px solid var(--techlo-primary); }

.techlo-main { padding: 32px; overflow-y: auto; }

/* ── Stats Cards ── */
.techlo-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.techlo-stat-card { background: var(--techlo-surface); border-radius: var(--techlo-radius); padding: 20px; text-align: center; box-shadow: var(--techlo-shadow); }
.techlo-stat-card__value { font-size: 32px; font-weight: 800; color: var(--techlo-primary); line-height: 1; }
.techlo-stat-card__label { font-size: 12px; color: var(--techlo-text-muted); margin-top: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

/* ── Progress Bar ── */
.techlo-progress { background: var(--techlo-border); border-radius: 100px; height: 8px; overflow: hidden; }
.techlo-progress__bar { height: 100%; background: linear-gradient(90deg, var(--techlo-primary), var(--techlo-secondary)); border-radius: 100px; transition: width .6s ease; }

/* ── Course List (My Courses) ── */
.techlo-my-courses { display: flex; flex-direction: column; gap: 16px; }
.techlo-my-course-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--techlo-surface);
  border-radius: var(--techlo-radius);
  padding: 16px;
  box-shadow: var(--techlo-shadow);
  text-decoration: none;
  color: var(--techlo-text);
  transition: box-shadow .2s;
}
.techlo-my-course-item:hover { box-shadow: var(--techlo-shadow-lg); }
.techlo-my-course-item__thumb { width: 120px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--techlo-border); }
.techlo-my-course-item__title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.techlo-my-course-item__progress { font-size: 13px; color: var(--techlo-text-muted); margin-bottom: 8px; }

/* ── Quiz ── */
.techlo-quiz-container { max-width: 720px; margin: 0 auto; }
.techlo-quiz-header { text-align: center; margin-bottom: 32px; }
.techlo-quiz-timer { background: var(--techlo-danger); color: #fff; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 18px; display: inline-block; }
.techlo-question-card { background: var(--techlo-surface); border-radius: var(--techlo-radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--techlo-shadow); }
.techlo-question-card__num { font-size: 12px; color: var(--techlo-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.techlo-question-card__text { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.techlo-option { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 2px solid var(--techlo-border); border-radius: 8px; cursor: pointer; margin-bottom: 8px; transition: all .15s; }
.techlo-option:hover { border-color: var(--techlo-primary); background: rgba(79,70,229,.04); }
.techlo-option.selected { border-color: var(--techlo-primary); background: rgba(79,70,229,.08); }
.techlo-option.correct { border-color: var(--techlo-secondary); background: rgba(16,185,129,.08); }
.techlo-option.wrong { border-color: var(--techlo-danger); background: rgba(239,68,68,.08); }

/* ── Certificate ── */
.techlo-certificate-preview {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--techlo-radius);
  padding: 48px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.techlo-certificate-preview::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 8px;
  pointer-events: none;
}
.techlo-certificate-preview__title { font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.techlo-certificate-preview__subtitle { font-size: 14px; opacity: .8; margin-bottom: 32px; }
.techlo-certificate-preview__name { font-size: 28px; font-weight: 700; border-bottom: 2px solid rgba(255,255,255,.5); display: inline-block; padding-bottom: 8px; margin-bottom: 24px; }
.techlo-certificate-preview__course { font-size: 16px; opacity: .9; }
.techlo-certificate-preview__serial { font-size: 12px; opacity: .6; margin-top: 24px; }

/* ── Notifications ── */
.techlo-notifications-bell { position: relative; cursor: pointer; }
.techlo-notifications-badge {
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--techlo-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.techlo-notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 340px;
  background: var(--techlo-surface);
  border-radius: var(--techlo-radius);
  box-shadow: var(--techlo-shadow-lg);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}
.techlo-notifications-dropdown.open { display: block; }

.techlo-notification-item { padding: 14px 16px; border-bottom: 1px solid var(--techlo-border); display: flex; gap: 12px; }
.techlo-notification-item:last-child { border-bottom: none; }
.techlo-notification-item.unread { background: rgba(79,70,229,.04); }
.techlo-notification-item__title { font-size: 13px; font-weight: 600; }
.techlo-notification-item__msg { font-size: 12px; color: var(--techlo-text-muted); margin-top: 2px; }

/* ── Gamification ── */
.techlo-xp-bar { background: var(--techlo-border); border-radius: 100px; height: 12px; position: relative; overflow: hidden; }
.techlo-xp-bar__fill { height: 100%; background: linear-gradient(90deg, #4F46E5, #F59E0B); border-radius: 100px; transition: width .8s ease; }
.techlo-rank-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: linear-gradient(135deg, #4F46E5, #7C3AED); color: #fff; border-radius: 100px; font-size: 13px; font-weight: 700; }
.techlo-streak { display: flex; align-items: center; gap: 8px; }
.techlo-streak__fire { font-size: 24px; }
.techlo-streak__count { font-size: 24px; font-weight: 800; color: #F59E0B; }

.techlo-leaderboard { background: var(--techlo-surface); border-radius: var(--techlo-radius); overflow: hidden; box-shadow: var(--techlo-shadow); }
.techlo-leaderboard__row { display: grid; grid-template-columns: 40px 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--techlo-border); }
.techlo-leaderboard__row:last-child { border-bottom: none; }
.techlo-leaderboard__rank { font-size: 14px; font-weight: 800; color: var(--techlo-text-muted); text-align: center; }
.techlo-leaderboard__row:nth-child(1) .techlo-leaderboard__rank { color: #F59E0B; }
.techlo-leaderboard__row:nth-child(2) .techlo-leaderboard__rank { color: #94A3B8; }
.techlo-leaderboard__row:nth-child(3) .techlo-leaderboard__rank { color: #CD7F32; }
.techlo-leaderboard__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.techlo-leaderboard__name { font-weight: 600; font-size: 14px; }
.techlo-leaderboard__points { font-size: 14px; font-weight: 700; color: var(--techlo-primary); }

/* ── Kids Zone ── */
.techlo-kids-zone { font-family: 'Nunito', 'Comic Sans MS', sans-serif; }
.techlo-kids-hero { background: linear-gradient(135deg, #FF6B6B, #4ECDC4); border-radius: 24px; padding: 48px; text-align: center; color: white; margin-bottom: 32px; }
.techlo-kids-hero h1 { font-size: 48px; font-weight: 800; margin-bottom: 12px; }
.techlo-age-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.techlo-age-card { border-radius: 20px; padding: 32px 20px; text-align: center; cursor: pointer; transition: transform .2s; color: white; font-weight: 700; font-size: 16px; }
.techlo-age-card:hover { transform: scale(1.05); }
.techlo-age-card .emoji { font-size: 48px; display: block; margin-bottom: 12px; }

/* ── Lesson Player ── */
.techlo-lesson-player { display: grid; grid-template-columns: 1fr 320px; gap: 0; min-height: 100vh; }
.techlo-lesson-content { padding: 32px; }
.techlo-lesson-sidebar { background: var(--techlo-text); padding: 0; overflow-y: auto; }
.techlo-lesson-sidebar__header { padding: 20px; font-weight: 700; color: #fff; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.1); }
.techlo-curriculum-section { border-bottom: 1px solid rgba(255,255,255,.1); }
.techlo-curriculum-section__title { padding: 12px 20px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.8); text-transform: uppercase; letter-spacing: .5px; cursor: pointer; }
.techlo-curriculum-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 13px; color: rgba(255,255,255,.6); text-decoration: none; cursor: pointer; transition: all .15s; }
.techlo-curriculum-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.techlo-curriculum-item.active { background: rgba(79,70,229,.3); color: #fff; border-left: 3px solid var(--techlo-primary); }
.techlo-curriculum-item.completed .techlo-curriculum-item__icon { color: var(--techlo-secondary); }

/* ── Video Player ── */
.techlo-video-wrapper { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--techlo-radius); overflow: hidden; }
.techlo-video-wrapper video,
.techlo-video-wrapper iframe { width: 100%; height: 100%; border: none; }

/* ── Search ── */
.techlo-search-wrap { position: relative; margin-bottom: 32px; }
.techlo-search-input { width: 100%; padding: 16px 20px 16px 52px; border: 2px solid var(--techlo-border); border-radius: 100px; font-size: 16px; outline: none; transition: border-color .2s; }
.techlo-search-input:focus { border-color: var(--techlo-primary); }
.techlo-search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--techlo-text-muted); font-size: 20px; }
.techlo-search-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: var(--techlo-surface); border-radius: 12px; box-shadow: var(--techlo-shadow-lg); z-index: 100; overflow: hidden; margin-top: 4px; }
.techlo-suggestion-item { padding: 12px 20px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.techlo-suggestion-item:hover { background: var(--techlo-bg); }

/* ── Verify Certificate ── */
.techlo-verify-container { max-width: 540px; margin: 0 auto; text-align: center; padding: 48px 24px; }
.techlo-verify-result { margin-top: 32px; padding: 32px; border-radius: var(--techlo-radius); }
.techlo-verify-result--valid { background: rgba(16,185,129,.08); border: 2px solid var(--techlo-secondary); }
.techlo-verify-result--invalid { background: rgba(239,68,68,.08); border: 2px solid var(--techlo-danger); }

/* ── Alerts ── */
.techlo-alert { padding: 14px 18px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.techlo-alert-success { background: rgba(16,185,129,.1); border-left: 4px solid var(--techlo-secondary); color: #065F46; }
.techlo-alert-danger { background: rgba(239,68,68,.1); border-left: 4px solid var(--techlo-danger); color: #7F1D1D; }
.techlo-alert-info { background: rgba(79,70,229,.1); border-left: 4px solid var(--techlo-primary); color: #3730A3; }
.techlo-alert-warning { background: rgba(245,158,11,.1); border-left: 4px solid var(--techlo-accent); color: #78350F; }

/* ── Breadcrumbs ── */
.techlo-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 0; margin: 0 0 24px; }
.techlo-breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 4px; color: var(--techlo-text-muted); }
.techlo-breadcrumbs a { color: var(--techlo-primary); text-decoration: none; font-size: 13px; }
.techlo-breadcrumbs li.active { font-size: 13px; color: var(--techlo-text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .techlo-dashboard { grid-template-columns: 1fr; }
  .techlo-sidebar { display: none; }
  .techlo-lesson-player { grid-template-columns: 1fr; }
  .techlo-lesson-sidebar { order: -1; max-height: 240px; }
  .techlo-courses-grid { grid-template-columns: 1fr; }
  .techlo-age-groups { grid-template-columns: repeat(2, 1fr); }
  .techlo-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── DRM Protection ── */
.techlo-protected-content { user-select: none; -webkit-user-select: none; }
