/* Modernized visual system */
:root {
  --ui-bg: #f3f6fb;
  --ui-surface: #ffffff;
  --ui-border: #e4eaf4;
  --ui-text: #1f2a37;
  --ui-muted: #6b7280;
  --ui-brand: #1aa5a8;
  --ui-brand-dark: #147f81;
  --ui-brand-soft: #7be1e3;
  --ui-focus: #93c5fd;
  --ui-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --plyr-color-main: #1aa5a8;
}

/* Page wrapper – same as landing page for consistent layout */
#before_login.blogin {
  min-height: 100vh;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: "Segoe UI", "Inter", "Roboto", Arial, sans-serif;
  padding-bottom: 20px;
}

/* Centered page layout – same as landing page (no content stuck to left) */
.ctcontnfluid {
  width: min(1140px, calc(100% - 24px));
  max-width: 1140px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Keep inner content centered on non-landing pages */
.ctcontnfluid > .row {
  justify-content: center;
}

div.catcontainer,
div.vlist {
  margin: 0 auto;
  width: 100%;
  max-width: none;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  padding: 16px;
}

div.vlist {
  max-width: 1100px;
}

.ctcontnfluid > .row,
#audiopage .row {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.ctcontnfluid .pagination {
  justify-content: center;
}

.ctcontnfluid .education-topbar-wrap {
  max-width: none;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#audiopage img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 12px;
}

/* Audio index: ensure category cards show image and text */
#audiopage #cat_list .audio-category-card .nlg,
#audiopage #cat_list .audio-category-card .ntext {
  visibility: visible;
  opacity: 1;
}
#audiopage #cat_list .audio-category-card .nlg img,
#audiopage #cat_list .audio-category-card .nlg a img {
  width: 100%;
  min-height: 120px;
  height: auto;
  object-fit: cover;
  background: #e2e8f0;
  visibility: visible;
  opacity: 1;
}
#audiopage #cat_list .audio-category-card .audio-category-name,
#audiopage #cat_list .audio-category-card .ntext h5 {
  color: #111827 !important;
  font-size: 1rem !important;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  visibility: visible;
  opacity: 1;
}
#audiopage #cat_list .audio-category-card .ntext a {
  color: #0f766e;
  text-decoration: none;
}
#audiopage #cat_list .audio-category-card .ntext a:hover {
  text-decoration: underline;
}
#audiopage #cat_list .audio-category-card .ntextbody p {
  color: #475569;
  visibility: visible;
}

div.math {
  margin-bottom: 14px;
}

div.item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 11px;
  background: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

div.item:hover {
  transform: translateY(-1px);
  border-color: #d8e2f0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

div.item > div.nlg {
  width: 32%;
  min-width: 170px;
}

.thumb-category-label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

/* Category name on video list thumbnails */
.video-thumb-wrap {
  position: relative;
  width: 100%;
}

.video-thumb-wrap .video-thumb-player {
  width: 100% !important;
  display: block;
}

.thumb-category-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7));
  background-color: rgba(15, 118, 110, 0.9);
  border-radius: 6px;
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

div.item > div.nlg > img,
div.nlg > a > img {
  width: 100%;
  height: 146px;
  object-fit: cover;
  border-radius: 10px;
}

div.item > div.ntext {
  width: 68%;
}

div.nhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

div.nhead h5,
div.nhead h6 {
  margin: 0;
}

div.nhead h5 {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
  color: #111827;
}

div.nhead h6 {
  font-size: 12px;
  color: var(--ui-muted);
}

div.ntextbody {
  margin-top: 10px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}

.nheadbyinr {
  margin-left: 10px;
}

.vidtitle {
  max-width: 480px;
}

.learnbutton {
  border: 0;
  background: linear-gradient(135deg, #22aeb0, #1f89ea);
  color: #fff;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  align-self: center;
  margin-left: auto;
  box-shadow: 0 6px 14px rgba(31, 137, 234, 0.28);
}

.learnbutton:hover {
  background: linear-gradient(135deg, #1d9d9f, #1c78cb);
}

#video_list div.nlg {
  width: 220px;
}

#video_list .math {
  margin-bottom: 14px;
}

.cont_detail {
  margin: 14px 0 4px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.main-video-section {
  max-width: 860px;
  margin: 0 auto 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

#current-video-title {
  text-align: center;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.1px;
}

#playerEpwNbtnTNFDO video {
  width: 100%;
  max-height: 430px;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.plyr {
  border-radius: 10px;
  overflow: hidden;
}

.plyr--video {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.plyr--audio {
  width: 100%;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: #f8fbff;
}

/* YouTube-style: main video left, More Videos right */
.video-page-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  margin: 14px auto 0;
  max-width: 1040px;
}

.video-main-col {
  flex: 1;
  min-width: 0;
}

.audio-page-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  margin: 14px auto 0;
  max-width: 1040px;
}

.audio-main-col {
  flex: 1;
  min-width: 0;
}

.main-audio-section {
  max-width: 860px;
  margin: 0 auto 24px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  position: relative;
  z-index: 1;
}

.main-audio-section img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin-top: 8px;
}

#current-audio-title {
  text-align: center;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.1px;
  margin: 0 0 8px 0;
}

.audio-sidebar-col {
  width: 360px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.audio-sidebar-heading {
  margin: 0 0 12px 0;
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
}

.audio-sidebar-col .video-sidebar-list {
  gap: 12px;
}

.audio-sidebar-col .sidebar-video-item {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  background: #fff;
}

.audio-sidebar-col .sidebar-video-thumb {
  width: 100%;
  height: 100px;
  min-height: 100px;
  flex-shrink: 0;
}

.audio-sidebar-col .sidebar-video-title {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#note_list {
  margin-top: 20px;
  position: relative;
  z-index: 2;
}

#note_list .audiomath {
  margin-bottom: 20px;
  scroll-margin-top: 80px;
}

#note_list .audiomath:last-child {
  margin-bottom: 0;
}

#note_list .audiomath .item {
  align-items: center;
}

#note_list .audiomath .item > div.nlg {
  flex: 0 1 320px;
  max-width: 100%;
  min-width: 0;
  position: relative;
  contain: layout style;
}

#note_list .audiomath .item > div.ntext {
  flex: 1 1 280px;
  min-width: 0;
}

#note_list .audio-item-thumb {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#note_list .audio-card-thumb {
  width: 100%;
  height: auto;
  min-height: 120px;
  object-fit: cover;
  border-radius: 10px;
  background: #e2e8f0;
  display: block;
}

#note_list .audio-player-wrap {
  width: 100%;
}

#note_list .audio-item-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

#note_list .audiomath .item > div.nlg .plyr,
#note_list .audiomath .item > div.nlg audio.audio {
  position: relative;
  z-index: 0;
}

#note_list audio.audio,
#note_list .plyr--audio {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  background: #f8fbff;
}

.audio-main-col .cont_detail {
  margin: 0 auto 16px;
  max-width: 860px;
  padding: 0 20px;
}

.video-sidebar-col {
  width: 360px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.video-sidebar-heading {
  margin: 0 0 12px 0;
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
}

.video-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-video-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  text-decoration: none;
  color: #1a1a1a;
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.sidebar-video-item:hover {
  background: #ebf4ff;
  color: #0f766e;
  transform: translateX(1px);
}

.sidebar-thumb-wrap {
  display: flex;
  flex-direction: column;
  width: 168px;
  flex-shrink: 0;
}

.sidebar-video-thumb {
  width: 168px;
  height: 94px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1aa5a8 0%, #1f89ea 100%);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding: 8px;
}

.sidebar-thumb-category {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category name overlay on sidebar video thumbnails */
.sidebar-thumb-category-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  background-color: rgba(15, 118, 110, 0.9);
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-video-preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(0.95);
}

.sidebar-thumb-title {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.98);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 86%;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.sidebar-video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.46));
  z-index: 1;
}

.sidebar-play-icon {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.95);
  font-size: 19px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.sidebar-video-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vlist > h3,
.vlist > p.text-muted {
  text-align: center;
}

@media (max-width: 992px) {
  .video-page-layout {
    flex-direction: column;
  }
  .video-sidebar-col {
    width: 100%;
  }
  .audio-page-layout {
    flex-direction: column;
  }
  .audio-sidebar-col {
    width: 100%;
  }
}

.home-category-grid {
  margin-left: 0;
  margin-right: 0;
}

.home-category-col {
  display: flex;
}

.home-category-col > a,
.home-category-col > div {
  display: block;
  width: 100%;
}

.home-category-card {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.home-category-image {
  width: 100%;
  height: 168px;
  object-fit: cover;
  background: #f7f7f7;
}

.home-category-title {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  color: #111827;
}

.education-topbar-wrap {
  margin-bottom: 14px;
  position: sticky;
  top: 12px;
  z-index: 40;
}

.education-topbar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  background: linear-gradient(120deg, var(--ui-brand), #25b8bb);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(20, 127, 129, 0.28);
  overflow: visible;
  backdrop-filter: blur(6px);
}

.education-topbar .top-item {
  position: relative;
  flex: 1;
  min-height: 42px;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  transition: background-color 0.2s ease;
}

.education-topbar .top-item:last-child {
  border-right: 0;
}

.education-topbar .top-item > a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.education-topbar .top-item > a:hover {
  background: rgba(0, 0, 0, 0.12);
}

.education-topbar .caret-down {
  margin-left: 4px;
  font-size: 12px;
}

.education-topbar .top-dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 80;
  min-width: 230px;
  max-height: 380px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
}

.education-topbar .has-dropdown:hover .top-dropdown {
  display: block;
}

.education-topbar .top-dropdown li a {
  display: block;
  padding: 8px 12px;
  color: #1f1f1f;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 8px;
}

.education-topbar .top-dropdown li a:hover {
  background: #e7f7f7;
  color: var(--ui-brand-dark);
}

.education-topbar .select-item {
  max-width: 190px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.education-topbar .select-item:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.education-topbar .select-item select {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  text-align-last: center;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.education-topbar .select-item select:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.education-topbar .select-item select:focus {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 2px var(--ui-focus);
}

.education-topbar .select-item select option {
  color: #1d1d1d;
  background: #fff;
}

.ctcontnfluid .pagination .page-link {
  border-radius: 10px;
  border-color: var(--ui-border);
  color: #334155;
  margin: 0 4px;
}

.ctcontnfluid .pagination .page-item.active .page-link {
  background: linear-gradient(120deg, var(--ui-brand), #25b8bb);
  border-color: transparent;
  color: #fff;
}

@media (max-width: 991px) {
  .education-topbar {
    flex-wrap: wrap;
  }

  .education-topbar .top-item {
    flex: 1 1 33.33%;
    min-width: 150px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  }
}

@media (max-width: 767px) {
  div.item {
    flex-direction: column;
  }

  div.item > div.nlg,
  div.item > div.ntext {
    width: 100%;
    min-width: 0;
  }

  .video-sidebar-col {
    width: 100%;
  }

  .sidebar-video-thumb {
    width: 124px;
    height: 74px;
  }
}
