:root {
  --brand:       #185FA5;
  --brand-light: #E6F1FB;
  --brand-dark:  #0C447C;
  --surface:     #ffffff;
  --surface-2:   #F5F7FA;
  --border:      #DDE2EA;
  --text:        #0F1923;
  --text-2:      #4A5568;
  --text-3:      #8896A8;
  --nav-h:       60px;
  --radius:      8px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Navbar ── */
.nav {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
}

.nav__logo {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav__logo span { color: var(--brand); }

.nav__links {
  display: flex;
  gap: 4px;
  margin-left: 16px;
}
.nav__links a {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.nav__links a:hover { background: var(--surface-2); color: var(--text); }

.nav__right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav__right a {
  color: var(--text-2);
  border-radius: var(--radius);
  padding: 6px 12px;
  transition: background 0.15s, color 0.15s;
}

.nav__right a:hover {background: var(--surface-2); color: var(--text);}

.btn {
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }

.btn--primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* ── Content ── */
main { flex: 1; }

/* ── Footer ── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer p { font-size: 13px; color: var(--text-3); }
footer .foot-links { display: flex; gap: 20px; }
footer .foot-links a { font-size: 13px; color: var(--text-3); }
footer .foot-links a:hover { color: var(--text-2); }

/* ── Auth page wrapper ── */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 420px;
}

.auth-card legend {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}

/* ── Django form fields ── */
.auth-card p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-card label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}

.auth-card input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.auth-card input::placeholder { color: var(--text-3); }

/* help text / errors */
.auth-card ul {
  list-style: disc;
  padding-left: 18px;
}

.auth-card ul li {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 4px;
}

.errorlist li {
  color: #A32D2D !important;
}

/* ── Submit button ── */
.auth-card .auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-card .auth-submit:hover { background: var(--brand-dark); }

/* ── Footer hint ── */
.auth-hint {
  text-align: center;
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--text-3);
}

.auth-hint a {
  color: var(--brand);
  font-weight: 500;
}

.auth-hint a:hover { text-decoration: underline; }

/* ── Logged-out page ── */
.logout-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.logout-card p {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 20px;
}

.logout-card a {
  display: inline-block;
  padding: 8px 24px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}

.logout-card a:hover { background: var(--brand-dark); }

/* ── Navbar logout button ── */
.nav-logout-form {
  margin: 0;
  padding: 0;
}

.nav-logout-form button {
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, color 0.15s;
}

.nav-logout-form button:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ── Video post form page ── */
.video-form-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
}

.video-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 560px;
}

.video-form-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
}

/* fields */
.video-form-card p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.video-form-card label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}

.video-form-card input[type="text"],
.video-form-card textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.video-form-card textarea {
  min-height: 100px;
  resize: vertical;
}

.video-form-card input[type="text"]:focus,
.video-form-card textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

/* file inputs */
.video-form-card input[type="file"] {
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}

.video-form-card input[type="file"]::file-selector-button {
  padding: 6px 14px;
  margin-right: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s;
}

.video-form-card input[type="file"]::file-selector-button:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand);
}

/* submit */
.video-form-card .form-submit {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.video-form-card .form-submit:hover { background: var(--brand-dark); }

/* ── Videos page ── */
.videos-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* header row */
.videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.videos-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

/* grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.videos-empty {
  color: var(--text-3);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ── Video card ── */
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.video-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* thumbnail */
.video-card__thumb {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-3);
  overflow: hidden;
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.video-card:hover .video-card__thumb img {
  transform: scale(1.03);
}

.video-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-2);
}

/* duration badge */
.video-card__duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
}

/* body */
.video-card__body {
  padding: 14px 16px;
}

.video-card__meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* avatar */
.video-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.video-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 3px;
  transition: color 0.15s;
}

.video-card__title:hover { color: var(--brand); }

.video-card__teacher {
  font-size: 12.5px;
  color: var(--text-3);
}

.video-card__date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
}

/* ── Player page layout ── */
.player-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: flex-start;
}

/* ── Player ── */
.player-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.player-wrapper video {
  width: 100%;
  height: 100%;
}

/* ── Info below player ── */
.player-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 20px;
  line-height: 1.4;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-light);
  overflow: hidden;
  flex-shrink: 0;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-teacher {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.player-date {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.player-description {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ── Sidebar ── */
.player-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.sidebar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

/* suggested card */
.suggested-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.suggested-card__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}

.suggested-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.suggested-card__thumb:hover img { transform: scale(1.04); }

.suggested-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-2);
}

.suggested-card__title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.15s;
}

.suggested-card__title:hover { color: var(--brand); }

.suggested-card__teacher {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 800px) {
  .player-page {
    grid-template-columns: 1fr;
  }

  .player-sidebar {
    position: static;
  }
}


/* ── Courses page ── */
.courses-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.courses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.courses-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

/* grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.courses-empty {
  color: var(--text-3);
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ── Course card ── */
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.course-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* thumbnail */
.course-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.course-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.course-card:hover .course-card__thumb img {
  transform: scale(1.03);
}

.course-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-3);
}

/* body */
.course-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.course-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.15s;
}

.course-card__title:hover { color: var(--brand); }

.course-card__teacher {
  font-size: 12.5px;
  color: var(--text-3);
}

.course-card__desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* stats */
.course-card__stats {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.course-card__stats span {
  font-size: 12.5px;
  color: var(--text-3);
}

/* ── Course detail page ── */
.course-detail-page {
  max-width: 860px;
  margin: 0 auto;
  padding-bottom: 48px;
}

/* banner */
.course-banner {
  width: 100%;
  height: 260px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 32px;
}

.course-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-banner__placeholder {
  width: 100%;
  height: 100%;
  background: var(--brand-light);
}

/* body */
.course-detail-body {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* header section */
.course-detail-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.course-detail-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.course-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.course-detail-stats {
  display: flex;
  gap: 20px;
}

.course-detail-stats span {
  font-size: 13.5px;
  color: var(--text-3);
}

.course-detail-desc {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.7;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Video list ── */
.course-video-list__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.course-video-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.course-video-item__order {
  width: 28px;
  height: 28px;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.course-video-item__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s;
}

.course-video-item__title:hover { color: var(--brand); }

.course-video-item__duration {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}

/* ── Profile page ── */
.profile-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Profile card ── */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--brand-light);
  margin-bottom: 8px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-username {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.profile-email {
  font-size: 13.5px;
  color: var(--text-3);
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* ── Update form card ── */
.profile-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.profile-form-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

/* reuse auth-card field styles */
.profile-form-card p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.profile-form-card label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}

.profile-form-card input[type="text"],
.profile-form-card input[type="email"] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.profile-form-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.profile-form-card input[type="file"] {
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
}

.profile-form-card input[type="file"]::file-selector-button {
  padding: 6px 14px;
  margin-right: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s;
}

.profile-form-card input[type="file"]::file-selector-button:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand);
}

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.15s;
}

.forgot-link:hover { color: var(--brand); }

/* ── Inbox page ── */
.inbox-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

/* ── Left sidebar ── */
.inbox-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.inbox-sidebar__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.inbox-empty {
  font-size: 13.5px;
  color: var(--text-3);
  padding: 20px 16px;
}

/* conversation item */
.convo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
}

.convo-item:hover { background: var(--surface-2); }

.convo-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-light);
  flex-shrink: 0;
  overflow: hidden;
}

.convo-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.convo-item__info {
  flex: 1;
  overflow: hidden;
}

.convo-item__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.convo-item__preview {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ── Right: message area ── */
.inbox-main {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  overflow: hidden;
}

/* message list */
.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* individual message bubbles — you'll add these dynamically via JS */
.message-bubble {
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.message-bubble--sent {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message-bubble--received {
  background: var(--surface);
  color: var(--text);
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* input row */
.message-input-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.message-input-row input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.message-input-row input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.message-input-row input::placeholder { color: var(--text-3); }

.message-bubble {
    max-width: 60%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.message-bubble--mine {
    background-color: #185FA5;
    color: #ffffff;
    margin-left: auto;
}

.message-bubble--theirs {
    background-color: #F5F7FA;
    color: #0F1923;
    border: 1px solid #DDE2EA;
    margin-right: auto;
}

.nav__notify {
    position: relative;
}

.nav__badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #E53E3E;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1;
}

/* ===============================
   LIVE SESSION LAYOUT
   =============================== */
.live-container {
    display: flex;
    height: calc(100vh - 60px); /* full height minus navbar */
    background: #0f0f0f;
    gap: 0;
}

/* ===============================
   LEFT - VIDEO PANEL
   =============================== */
.video-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
    padding: 16px;
    gap: 12px;
    overflow: hidden;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a2a;
}

.session-info h2 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.host {
    color: #aaaaaa;
    font-size: 0.85rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.live {
    background: #ff4444;
    color: #ffffff;
    animation: pulse 2s infinite;
}

.status-badge.upcoming {
    background: #185FA5;
    color: #ffffff;
}

.status-badge.ended {
    background: #444444;
    color: #aaaaaa;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===============================
   VIDEO GRID
   =============================== */
#video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
    overflow: hidden;
    border-radius: 12px;
}

#video-grid > div {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    min-height: 200px;
    position: relative;
}

#local-player {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    min-height: 200px;
    border: 2px solid #185FA5;
}

/* ===============================
   CONTROLS
   =============================== */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 12px 0;
}

.controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #2a2a2a;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.controls button:hover {
    background: #185FA5;
}

.controls button.danger {
    background: #ff4444;
}

.controls button.danger:hover {
    background: #cc0000;
}

/* ===============================
   RIGHT - CHAT PANEL
   =============================== */
.chat-panel {
    width: 320px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    border-left: 1px solid #2a2a2a;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid #2a2a2a;
}

.chat-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ===============================
   CHAT MESSAGES
   =============================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: #222222;
    border-radius: 8px;
    border-left: 3px solid #185FA5;
}

.message .sender {
    font-size: 0.78rem;
    font-weight: 600;
    color: #185FA5;
}

.message .content {
    font-size: 0.88rem;
    color: #dddddd;
    line-height: 1.4;
    word-break: break-word;
}

.message .time {
    font-size: 0.72rem;
    color: #666666;
    align-self: flex-end;
}

.empty {
    color: #555555;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 20px;
}

/* ===============================
   CHAT INPUT
   =============================== */
.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #2a2a2a;
}

.chat-input input {
    flex: 1;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.88rem;
    outline: none;
    transition: border 0.2s;
}

.chat-input input:focus {
    border-color: #185FA5;
}

.chat-input input::placeholder {
    color: #555555;
}

.chat-input button {
    padding: 10px 16px;
    background: #185FA5;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input button:hover {
    background: #1a6fc0;
}

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 768px) {
    .live-container {
        flex-direction: column;
        height: auto;
    }

    .chat-panel {
        width: 100%;
        min-width: unset;
        height: 400px;
        border-left: none;
        border-top: 1px solid #2a2a2a;
    }
}

/* ===============================
   LIVES PAGE
   =============================== */
.lives-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* ===============================
   HEADER
   =============================== */
.lives-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lives-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111111;
    margin: 0 0 4px 0;
}

.lives-header p {
    color: #777777;
    font-size: 0.9rem;
    margin: 0;
}

.btn-create {
    padding: 10px 20px;
    background: #185FA5;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-create:hover {
    background: #1a6fc0;
}

/* ===============================
   SECTION
   =============================== */
.section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111111;
    margin: 0;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.live {
    background: #ff4444;
    animation: pulse 2s infinite;
}

.dot.upcoming {
    background: #185FA5;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===============================
   SESSIONS GRID
   =============================== */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ===============================
   SESSION CARD
   =============================== */
.session-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #eeeeee;
    transition: transform 0.2s, box-shadow 0.2s;
}

.session-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.session-card.live {
    border-left: 4px solid #ff4444;
}

.session-card.upcoming {
    border-left: 4px solid #185FA5;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge.live {
    background: #fff0f0;
    color: #ff4444;
}

.badge.upcoming {
    background: #f0f6ff;
    color: #185FA5;
}

.host {
    font-size: 0.8rem;
    color: #999999;
}

.session-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111111;
    margin: 0;
}

.description {
    font-size: 0.85rem;
    color: #777777;
    margin: 0;
    line-height: 1.5;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.course, .time {
    font-size: 0.78rem;
    color: #aaaaaa;
}

.btn-join {
    padding: 8px 16px;
    background: #185FA5;
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-join:hover {
    background: #1a6fc0;
}

.btn-remind {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #aaaaaa;
    border-radius: 8px;
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: not-allowed;
}

.empty {
    color: #aaaaaa;
    font-size: 0.9rem;
}

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 768px) {
    .lives-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sessions-grid {
        grid-template-columns: 1fr;
    }
}