/* ============================================================
   pages.css — styles for the screens added in the Laravel migration.
   Uses the design tokens from style.css (colors, radii, fonts); nothing in
   style.css is overridden except where noted.
   ============================================================ */

/* ============================================================
   LAYOUT FIX: the header is position:fixed in style.css (the homepage hero is 100vh,
   so it never overlapped). On every other page the header must take up space,
   otherwise the page content starts underneath it.
   ============================================================ */
body:not(.home-body) .site-header { position: sticky; top: 0; }
html { scroll-padding-top: 110px; }
[id] { scroll-margin-top: 110px; }
main { min-height: 50vh; }

/* ---- links & cards ---- */
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: var(--radius-md); }
.avatar-initials {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--navy); color: #fff; font-family: var(--font-main); font-weight: 700; font-size: .72rem;
  width: 28px; height: 28px; flex: 0 0 auto;
}
.avatar-initials.avatar-lg { width: 100%; height: 100%; font-size: 1.6rem; }
.cat-img { width: 28px; height: 28px; object-fit: contain; }
a.cat-tab, a.cat-card, a.btn-primary, a.btn-secondary, a.btn-outline, a.btn-login, a.btn-signup, a.plan-btn, a.btn-follow, a.see-all {
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
a.cat-card { display: block; color: inherit; }
a.spotlight-play { display: flex; align-items: center; justify-content: center; color: #fff; }
.btn-outline.danger { color: #b42318; border-color: #b42318; }
.btn-outline.small, .btn-primary.small { padding: 6px 14px; font-size: .82rem; }
form button.btn-signup, form button.btn-outline, form button.btn-primary { cursor: pointer; }
.mobile-auth-buttons form { display: contents; }

/* ---- navbar additions ---- */
.nav-avatar {
  display: flex; align-items: center; justify-content: center; background: var(--gradient-main);
  color: #fff; font-family: var(--font-main); font-weight: 700; border-radius: 50%; width: 40px; height: 40px;
}
.profile-dropdown form { margin: 0; }
.dropdown-logout {
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer; width: 100%;
  font: inherit; color: inherit;
}
.dropdown-logout { font-size: .85rem; color: var(--gray-100); transition: var(--transition); }
.dropdown-logout:hover { color: var(--saffron); padding-left: 4px; }
.search-box { position: relative; }
.search-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 260px; z-index: 1100;
  background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.search-suggest[hidden] { display: none; }
.suggest-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--navy); text-decoration: none; font-size: .9rem; }
.suggest-item small { color: var(--gray-300); }
.suggest-item:hover, .suggest-item.active { background: var(--dark-2); }

/* ---- generic page hero / sections ---- */
.page-hero { background: var(--gradient-navy); color: #fff; padding: 56px 0 36px; }
.page-hero.compact { padding: 36px 0 24px; }
.page-title { font-family: var(--font-main); font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 0 0 6px; }
.page-sub { color: var(--gray-300); margin: 0 0 16px; }
.page-hero .page-sub { color: rgba(255, 255, 255, .8); }
.result-gap { margin-top: 36px; }
.crumbs { font-size: .85rem; color: var(--gray-300); margin-bottom: 12px; }
.crumbs a { color: var(--navy); text-decoration: none; }
.notice { background: #FFF7ED; border: 1px solid var(--saffron-lt); color: #7A3E06; padding: 10px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: .92rem; }
.notice.error { background: #FEF3F2; border-color: #F04438; color: #912018; }
.muted { color: var(--gray-300); }

/* ---- empty / error states ---- */
.state-box { text-align: center; padding: 48px 20px; background: var(--white); border: 1px dashed var(--gray-100); border-radius: var(--radius-lg); margin: 16px 0; }
.state-box .state-emoji { font-size: 2.2rem; }
.state-box h3 { font-family: var(--font-main); margin: 8px 0; color: var(--navy); }
.state-box p { color: var(--gray-300); margin: 0 0 16px; }
.state-box.state-error { border-color: #F04438; }

/* ---- filter bar & pager ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; align-items: center; }
.filter-bar input[type=search], .filter-bar select {
  padding: 10px 14px; border: 1px solid var(--gray-100); border-radius: var(--radius-sm);
  background: var(--white); font: inherit; min-width: 160px; flex: 1 1 160px;
}
.filter-bar input[type=search] { flex: 2 1 240px; }
.search-page-form { max-width: 640px; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 32px 0 8px; }
.pager a, .pager span { padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--gray-100); background: var(--white); color: var(--navy); text-decoration: none; font-weight: 600; }
.pager .current { background: var(--saffron); border-color: var(--saffron); color: #fff; }

/* ---- course details ---- */
.course-hero { padding: 36px 0; background: var(--dark-2); }
.course-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; }
.course-hero-media img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); aspect-ratio: 16 / 9; object-fit: cover; }
.course-title { font-family: var(--font-main); color: var(--navy); font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 8px 0; }
.course-title.small { font-size: 1.4rem; }
.course-progress { margin: 14px 0; font-size: .9rem; color: var(--gray-300); }
.card-progress-bar.big { position: static; height: 8px; border-radius: 4px; margin-bottom: 6px; background: var(--gray-100); }
.course-body { display: block; }
.course-desc { color: #334155; line-height: 1.7; margin: 8px 0 24px; }
.lessons-title { margin-top: 28px; display: flex; align-items: baseline; gap: 12px; }
.lessons-title small { font-size: .8rem; color: var(--gray-300); font-weight: 500; }
.spotlight-cta form { display: inline; }
.spotlight-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.review-list { display: grid; gap: 12px; margin: 12px 0 20px; }
.review { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-md); padding: 14px; }
.review small { color: var(--gray-300); }
.rate-form { display: grid; gap: 10px; max-width: 480px; background: var(--white); padding: 18px; border: 1px solid var(--gray-100); border-radius: var(--radius-md); }
.rate-form select, .rate-form textarea, .profile-form input, .profile-form select {
  padding: 10px 12px; border: 1px solid var(--gray-100); border-radius: var(--radius-sm); font: inherit; width: 100%;
}

/* episodes: style.css was written for a dark modal (white text); on our light panels use navy */
.course-episodes h4 { color: var(--navy); }
.ep-info strong { color: var(--navy); }
.ep-info span { color: var(--gray-300); font-size: .8rem; }
.ep-num { color: var(--gray-300); font-weight: 700; min-width: 26px; }
.ep-status { margin-left: auto; font-size: .85rem; color: var(--navy); white-space: nowrap; }
.episode-item { background: var(--white); border-color: var(--gray-100); }
.episode-item:hover { border-color: var(--saffron); }
.episode-item.active-ep { border-color: var(--saffron); background: rgba(244, 121, 32, .08); }
/* episodes list (reuses the original modal's episode styles; link version) */
.episodes-list { display: flex; flex-direction: column; gap: 8px; }
a.episode-item { text-decoration: none; color: inherit; }
.episode-item.is-locked { opacity: .65; }

/* ---- player ---- */
.player-section { padding: 28px 0 8px; background: var(--dark-2); }
.player-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.video-player-wrapper { background: #000; border-radius: var(--radius-lg); overflow: hidden; }
.video-player-wrapper .video-player { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; }
.player-video, .player-embed { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--white); }
.player-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin: 16px 0 6px; }
.player-nav { display: flex; gap: 8px; }
.player-side .course-episodes { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 16px; max-height: 70vh; overflow: auto; }

/* ---- auth pages ---- */
.auth-body main { background: var(--dark-2); }
.auth-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-page .auth-modal-content { animation: none; box-shadow: var(--shadow-card); }
.auth-heading { font-family: var(--font-main); color: var(--navy); font-size: 1.35rem; text-align: center; margin: 0 0 6px; }
.auth-sub { text-align: center; color: var(--gray-300); margin: 0 0 20px; font-size: .92rem; }
.auth-fineprint { font-size: .78rem; color: var(--gray-300); text-align: center; margin: 0; }
.auth-fineprint a { color: var(--navy); }
.mobile-field { display: flex; align-items: stretch; border: 1px solid var(--gray-100); border-radius: var(--radius-sm); overflow: hidden; background: var(--white); }
.mobile-prefix { padding: 0 12px; display: flex; align-items: center; background: var(--dark-2); color: var(--navy); font-weight: 600; }
.mobile-field input { border: 0 !important; flex: 1; }
.otp-input { text-align: center; letter-spacing: .5em; font-size: 1.4rem; font-weight: 700; }
.field-error { color: #B42318; font-size: .82rem; }
.otp-actions { display: flex; justify-content: space-between; margin-top: 16px; }
.link-btn { background: none; border: 0; color: var(--navy); font-weight: 600; cursor: pointer; font: inherit; text-decoration: underline; }
.link-btn:disabled { color: var(--gray-500); cursor: not-allowed; text-decoration: none; }
.btn-primary:disabled { opacity: .6; cursor: wait; }

/* ---- student area ---- */
.student-section { padding: 28px 0 56px; background: var(--dark-2); }
.student-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.student-nav { display: flex; flex-direction: column; gap: 4px; background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 10px; position: sticky; top: 130px; }
.student-nav a { padding: 10px 14px; border-radius: var(--radius-sm); color: var(--navy); text-decoration: none; font-weight: 600; font-size: .92rem; }
.student-nav a:hover { background: var(--dark-2); }
.student-nav a.active { background: var(--gradient-main); color: #fff; }
.panel { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tile span { color: var(--gray-300); font-size: .82rem; }
.tile strong { font-family: var(--font-main); font-size: 1.7rem; color: var(--navy); }
.tile .tile-text { font-size: 1.05rem; }
.tile small { color: var(--gray-300); }
.profile-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--gray-100); background: var(--white); border-radius: 999px; cursor: pointer; font: inherit; color: var(--navy); font-weight: 600; }
.chip.active { border-color: var(--saffron); box-shadow: var(--shadow-glow); }
.chip small { color: var(--gray-300); font-weight: 500; }
.profile-card summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.profile-card .pc-name { font-weight: 700; color: var(--navy); }
.profile-form { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.profile-form .form-actions, .form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; grid-column: 1 / -1; }
.form-actions form { display: inline; }
.watchlist-item { display: flex; flex-direction: column; gap: 8px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cert-card img { width: 100%; border-radius: var(--radius-sm); aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 10px; }
.cert-card dl, .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0; font-size: .9rem; }
.cert-card dt, .kv dt { color: var(--gray-300); }
.cert-card dd, .kv dd { margin: 0; font-weight: 600; color: var(--navy); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.status-pill { padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--dark-2); color: var(--navy); }
.status-pill.active { background: rgba(0, 132, 61, .12); color: var(--green); }
.coupon-row { display: flex; gap: 8px; margin: 12px 0 4px; }
.coupon-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--gray-100); border-radius: var(--radius-sm); font: inherit; }
.coupon-msg { font-size: .82rem; color: var(--gray-300); min-height: 1.2em; margin: 0 0 8px; }
.plan-buy .plan-btn { width: 100%; }
.delete-steps { line-height: 1.8; margin: 12px 0 18px; padding-left: 20px; }

/* ---- toast variants ---- */
.toast.toast-error { background: #B42318; }

/* ---- responsive ---- */
@media (max-width: 992px) {
  .course-hero-grid, .player-grid { grid-template-columns: 1fr; }
  .student-grid { grid-template-columns: 1fr; }
  .student-nav { flex-direction: row; overflow-x: auto; position: static; }
  .student-nav a { white-space: nowrap; }
  .player-side .course-episodes { max-height: none; }
}
@media (max-width: 600px) {
  .page-hero { padding: 40px 0 24px; }
  .filter-bar > * { flex: 1 1 100%; }
  .otp-actions { flex-direction: column; gap: 10px; align-items: center; }
}
