/* Amplite minimal theme variables */
:root{
  /* Slimmer bars */
  --topbar-h: 40px;
  --bottombar-h: 44px;

  --bg: #edf2f9;
  --fg: #212529;
  --muted: #6c757d;

  --bar-bg: #f8f9fa;
  --bar-border: #e5e7eb;
  --card-bg: #ffffff;
  --card-border: #dee2e6;

  /* Scrollbar (light defaults) */
  --scrollbar-bg: #f1f3f5;           /* track */
  --scrollbar-thumb: #c1c9d0;        /* thumb */
  --scrollbar-thumb-hover: #adb5bd;  /* hover */
  --scrollbar-thumb-active: #868e96; /* active */
  --scrollbar-w: 10px;               /* width */
}

.theme-dark{
  --bg: #121212;
  --fg: #e9ecef;
  --muted: #9aa0a6;

  --bar-bg: #1e1e1e;
  --bar-border: #2a2a2a;
  --card-bg: #1a1a1a;
  --card-border: #30363d;

  /* Scrollbar (dark overrides) */
  --scrollbar-bg: #1c1c1c;
  --scrollbar-thumb: #3a3f44;
  --scrollbar-thumb-hover: #4b5258;
  --scrollbar-thumb-active: #5c646b;
}

html, body{
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body{
  background-color: var(--bg);
  color: var(--fg);
  font-size: 1.05rem;
}

/* Scrollbar styling (WebKit + Firefox) */
/* Apply to all common scroll containers so theme switch updates them */
body, .scroll-column, .snap-container, .offcanvas, #contentWrap, #contentWrap .content-scroller{
  /* Firefox */
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
  scrollbar-width: thin;
}

/* WebKit-based browsers (Chrome, Edge, Safari, Opera) */
body::-webkit-scrollbar,
.scroll-column::-webkit-scrollbar,
.snap-container::-webkit-scrollbar,
.offcanvas::-webkit-scrollbar,
#contentWrap::-webkit-scrollbar,
#contentWrap .content-scroller::-webkit-scrollbar{
  width: var(--scrollbar-w);
  height: var(--scrollbar-w);
}

body::-webkit-scrollbar-track,
.scroll-column::-webkit-scrollbar-track,
.snap-container::-webkit-scrollbar-track,
.offcanvas::-webkit-scrollbar-track,
#contentWrap::-webkit-scrollbar-track,
#contentWrap .content-scroller::-webkit-scrollbar-track{
  background: var(--scrollbar-bg);
}

body::-webkit-scrollbar-thumb,
.scroll-column::-webkit-scrollbar-thumb,
.snap-container::-webkit-scrollbar-thumb,
.offcanvas::-webkit-scrollbar-thumb,
#contentWrap::-webkit-scrollbar-thumb,
#contentWrap .content-scroller::-webkit-scrollbar-thumb{
  background-color: var(--scrollbar-thumb);
  border-radius: 8px;
  border: 2px solid var(--scrollbar-bg);
}

body::-webkit-scrollbar-thumb:hover,
.scroll-column::-webkit-scrollbar-thumb:hover,
.snap-container::-webkit-scrollbar-thumb:hover,
.offcanvas::-webkit-scrollbar-thumb:hover,
#contentWrap::-webkit-scrollbar-thumb:hover,
#contentWrap .content-scroller::-webkit-scrollbar-thumb:hover{
  background-color: var(--scrollbar-thumb-hover);
}

body::-webkit-scrollbar-thumb:active,
.scroll-column::-webkit-scrollbar-thumb:active,
.snap-container::-webkit-scrollbar-thumb:active,
.offcanvas::-webkit-scrollbar-thumb:active,
#contentWrap::-webkit-scrollbar-thumb:active,
#contentWrap .content-scroller::-webkit-scrollbar-thumb:active{
  background-color: var(--scrollbar-thumb-active);
}

/* --- Added for Off_Canvas_Menu matching --- */
.border-200 {
  border-color: #edf2f9 !important;
}

.hover-bg-100:hover {
  background-color: #f8f9fa !important;
}

.badge-subtle-danger {
  color: #e63757;
  background-color: #fde2e7;
}

.fs-11 { font-size: 0.8rem !important; }
.fs-10 { font-size: 0.9rem !important; }
.fs-9 { font-size: 1.05rem !important; }
.fs-8 { font-size: 1.25rem !important; }

/* Accordion customization */
.accordion-button:not(.collapsed) {
  color: var(--bs-primary);
  background-color: rgba(13, 110, 253, 0.05);
  box-shadow: none;
}

.accordion-button::after {
  width: 0.8rem;
  height: 0.8rem;
  background-size: 0.8rem;
  transition: transform 0.2s ease-in-out;
}

.accordion-button:focus {
  border-color: transparent;
  box-shadow: none;
}

.accordion-item {
  background-color: transparent;
  transition: background-color 0.2s ease;
}

.hover-bg-100 {
  transition: background-color 0.2s ease;
}

.hover-bg-100:hover {
  background-color: rgba(0, 0, 0, 0.03) !important;
}

.theme-dark .hover-bg-100:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}
.accordion-sub-item {
  transition: background-color 0.2s ease;
  border-left: 3px solid transparent;
}

.accordion-sub-item:hover {
  border-left-color: var(--bs-primary);
}

.cursor-pointer {
  cursor: pointer;
}

.bg-light {
  background-color: #f8f9fa !important;
}

.rounded-soft {
  border-radius: 0.375rem !important;
}

/* Rounded Profile Images */
.avatar img.rounded-circle {
  object-fit: cover;
}
/* --- End of additions --- */

/* Bars */
.topbar, .bottombar{
  background-color: var(--bar-bg);
  z-index: 1050 !important;
}
.topbar{ min-height: var(--topbar-h); }
.bottombar{ min-height: var(--bottombar-h); }

.topbar.border-bottom{ border-bottom: 1px solid var(--bar-border) !important; }
.bottombar.border-top{ border-top: 1px solid var(--bar-border) !important; }

/* Slim navbar paddings and inner sizing */
.topbar.navbar, .bottombar.navbar{ padding-top: 0; padding-bottom: 0; }
.topbar .container-fluid, .topbar .container{ min-height: var(--topbar-h); }
.bottombar .container-fluid, .bottombar .container{ min-height: var(--bottombar-h); }
.topbar .navbar-brand{ padding: 0; font-size: 1rem; line-height: 1; }
/* Compact buttons in bottom bar */
.bottombar .btn, .bottombar .btn-sm, .bottombar .btn-group .btn{
  padding: .2rem .5rem;
  font-size: .95rem;
  line-height: 1.2;
}

/* Avoid content under fixed bars */
body{
  padding-top: var(--topbar-h);
  padding-bottom: var(--bottombar-h);
  height: 100%;
  height: 100dvh;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

/* The scrollable area between bars */
#contentWrap{
  height: calc(100vh - var(--topbar-h) - var(--bottombar-h));
  height: calc(100dvh - var(--topbar-h) - var(--bottombar-h));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
#contentWrap.no-scroll {
  overflow-y: hidden;
}
#contentWrap .content-scroller{
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Ensure flex children can fill height */
.no-scroll .content-scroller {
  height: 100%;
}

/* Cards in dark */
.card{
  background-color: var(--card-bg);
  border-color: var(--card-border);
  color: var(--fg);
}

/* Offcanvas and Backdrops */
.offcanvas, 
.offcanvas.show {
  background-color: var(--bar-bg);
  color: var(--fg);
  box-shadow: none !important;
  z-index: 1070 !important;
}

.offcanvas-backdrop,
.modal-backdrop.fade.show {
  z-index: 1060 !important;
}

.link-body{
  color: var(--fg);
  text-decoration: none;
}
.link-body:hover{
  text-decoration: underline;
}

/* Buttons readability tweaks in dark (keep minimal) */
.theme-dark .btn-outline-secondary{
  color: var(--fg);
  border-color: var(--card-border);
}
.theme-dark .btn-outline-secondary:hover{
  background-color: rgba(255,255,255,.05);
}
.theme-dark .btn-outline-primary{
  color: #91c2ff;
  border-color: #3676d1;
}

/* Independent scroll per column for Lesson_Loader */
.scroll-column{
  /* Viewport height minus fixed bars and row vertical padding (py-3 ≈ 2rem) */
  max-height: calc(100vh - var(--topbar-h) - var(--bottombar-h) - 2rem);
  max-height: calc(100dvh - var(--topbar-h) - var(--bottombar-h) - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%; /* Fill height in flex layout */
  -webkit-overflow-scrolling: touch;
}
/* Left list items highlight for Video_Story_Loader */
.lesson-item .card{ transition: border-color .2s, box-shadow .2s, background-color .2s; }
.lesson-item.active .card{
  border-color: #0d6efd;
  box-shadow: 0 0 0 .15rem rgba(13,110,253,.25);
  background-color: rgba(13,110,253,.03);
}
.lesson-item:hover .card{ border-color: #86b7fe; }


/* TikTok-like vertical snap container for Video_Loader */
.snap-container{
  height: 100%;
  max-height: calc(100vh - var(--topbar-h) - var(--bottombar-h));
  max-height: calc(100dvh - var(--topbar-h) - var(--bottombar-h));
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  position: relative;
  /* Smoother behavior and prevent scroll chaining/bounce */
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}
.snap-slide{
  height: calc(100vh - var(--topbar-h) - var(--bottombar-h));
  height: calc(100dvh - var(--topbar-h) - var(--bottombar-h));
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  display: flex;
  margin: 0;
  padding: 0;
}
.snap-slide .card{
  border: 0;
  border-radius: 0;
}
/* Right-side navigation arrows */
.snap-arrows{
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1030; /* below offcanvas/backdrop so offcanvas is on top */
}
.btn-circle{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}

/* Split layout inside each lesson slide */
.mobile-story-wrapper .snap-slide .lesson-video{ flex: 0 0 auto; }
.mobile-story-wrapper .snap-slide .lesson-text{ flex: 1 1 auto; min-height: 0; }
.mobile-story-wrapper .lesson-text .card,
.mobile-story-wrapper .lesson-text .card-body{ height: 100%; }
.mobile-story-wrapper .lesson-text .card-body{ overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }

/* Countdown overlay styles */
.mobile-story-wrapper .video-countdown{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  opacity: 1;
  transition: opacity .2s ease, visibility .2s ease;
}
.mobile-story-wrapper .video-countdown.hidden{ opacity: 0; visibility: hidden; }
.mobile-story-wrapper .video-countdown .countdown-number{ font-size: clamp(28px, 6vw, 56px); line-height: 1; }
.mobile-story-wrapper .video-countdown .countdown-label{ font-size: clamp(14px, 3vw, 18px); font-weight: 600; }
.mobile-story-wrapper .video-countdown .video-progress{ width: min(70%, 420px); height: 6px; background: rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; }
.mobile-story-wrapper .video-countdown .video-progress .fill{ height: 100%; width: 0%; background: #0d6efd; }

/* Use dynamic viewport units on supported browsers to avoid address bar jump on mobile */
@supports (height: 100dvh) {
  .snap-container{ height: calc(100dvh - var(--topbar-h) - var(--bottombar-h)); }
  .snap-slide{ height: calc(100dvh - var(--topbar-h) - var(--bottombar-h)); }
}


/* Mobile behavior for Video_Mobile_Story_Loader: slim numeric rail + swipe-to-open */
@media (max-width: 768px){
  .mobile-story-wrapper{ position: relative; --ms-subbar-h: 48px; --subbar-h: var(--ms-subbar-h); }
  .mobile-story-wrapper .ms-overlay{
    position: absolute;
    top: 0;
    left: 0; right: 0;
    bottom: 0;
    background: rgba(0,0,0,.25);
    display: none;
    z-index: 1065; /* above arrows */
  }
  .mobile-story-wrapper .ms-left{
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 44px !important; /* collapsed rail width */
    max-width: 44px !important;
    flex: 0 0 44px !important;
    background: var(--bar-bg);
    border-right: 1px solid var(--bar-border);
    z-index: 1030; /* below offcanvas/backdrop */
    transition: width .2s ease;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: .25rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-story-wrapper .ms-right{
    /* ensure content not covered by the fixed rail */
    margin-left: 44px !important;
    padding-left: 8px; /* small inset so content never touches the rail */
    width: auto !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    position: relative;
    overflow: hidden; /* prevent any inner absolute elements from sliding under the rail */
  }

  /* Snap area: fill the wrapper height */
  .mobile-story-wrapper .snap-container{
    height: 100%;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    scroll-padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }
  .mobile-story-wrapper .snap-slide{
    height: 100%;
  }

  /* Collapse left items to show only numbers */
  .mobile-story-wrapper .ms-left #storyList{ padding-left: 0; padding-right: 0; max-height: none; overflow: visible; }
  .mobile-story-wrapper .ms-left .lesson-item{ position: relative; height: 44px; display: flex; align-items: center; justify-content: center; }
  .mobile-story-wrapper .ms-left .lesson-item .card{ display: none; }
  .mobile-story-wrapper .ms-left .lesson-item::before{
    content: attr(data-number);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 999px;
    background: #0d6efd; color: #fff;
    font-weight: 600; font-size: .8rem;
    box-shadow: 0 2px 6px rgba(13,110,253,.35);
  }
  .mobile-story-wrapper .ms-left .lesson-item.active::before{
    background: #6610f2;
  }

  /* Expanded sidebar */
  .mobile-story-wrapper.sidebar-open .ms-overlay{ display: block; }
  .mobile-story-wrapper.sidebar-open .ms-left{ width: min(80vw, 320px) !important; max-width: min(80vw, 320px) !important; flex: 0 0 auto !important; }
  .mobile-story-wrapper.sidebar-open .ms-left .lesson-item{ height: auto; }
  .mobile-story-wrapper.sidebar-open .ms-left .lesson-item .card{ display: block; margin: .25rem; }
  .mobile-story-wrapper.sidebar-open .ms-left .lesson-item::before{ display: none; }
  .mobile-story-wrapper.sidebar-open .ms-right{ margin-left: 0; }
}


/* ========== Mobile Story (Video_Mobile_Story_Loader) layout ========== */
:root{
  /* Height of the sub navigation bar inside the content area */
  --subbar-h: 44px;
}

/* The extra subbar that appears under the top bar in this view */
.ms-subbar.navbar{
  min-height: var(--subbar-h);
  background-color: var(--bar-bg);
  border-bottom: 1px solid var(--bar-border);
}

/* Wrapper that must occupy the remaining viewport, excluding fixed bars and the subbar */
.mobile-story-wrapper{
  flex-grow: 1;
  min-height: 0; /* important for flex items to be able to shrink below their content size */
  overflow: hidden; /* prevent body from getting an extra scrollbar */
}
.mobile-story-wrapper > .row{ height: 100%; }
.mobile-story-wrapper .ms-left,
.mobile-story-wrapper .ms-right{ height: 100%; overflow: hidden; }

/* Left list: full height with its own vertical scroll */
.mobile-story-wrapper .scroll-column{
  height: 100%;
  max-height: none; /* override generic rule */
  overflow-y: auto;
  overflow-x: hidden;
}

/* Right snap area: take the full available height inside the wrapper */
.mobile-story-wrapper .snap-container{ height: 100%; }
.mobile-story-wrapper .snap-slide{ height: 100%; }

/* ========== LogIn Form Styles (Match Image 33) ========== */

.card {
  box-shadow: 0 7px 14px 0 rgba(65, 69, 88, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
  border-radius: 0.5rem;
}

.card-header.bg-circle-shape {
  position: relative;
  overflow: hidden;
  background-color: #2c7be5; /* Primary blue */
  border-radius: 0.5rem 0.5rem 0 0 !important;
  color: #fff;
}

.card-header.bg-circle-shape a {
  font-size: 1.5rem !important; /* fs-4 equivalent */
}

.bg-circle-shape::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -25%;
  width: 150%;
  height: 200%;
  background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15), transparent);
  border-radius: 50%;
  z-index: 0;
}

.divider-content-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 0.5rem;
  background-color: #fff; /* Match card background */
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  text-transform: capitalize;
}

.theme-dark .divider-content-center {
  background-color: var(--card-bg);
}

.mt-n3 {
  margin-top: -1.25rem !important;
}

/* Fix input group within the login card without changing HTML */
.card-body .input-group .form-control {
  border-right: 0;
}

.card-body .input-group .input-group-text {
  background-color: #fff !important;
  border-left: 0 !important;
  color: #adb5bd !important;
}

.card-body .input-group .form-control:focus {
  border-right: 0;
  box-shadow: none;
  border-color: #86b7fe;
}

.card-body .input-group .form-control:focus + .input-group-text {
  border-color: #86b7fe;
  border-left: 0;
}

/* Align checkbox row */
.card-body .row.pt-1.px-3 {
  align-items: center !important;
}

/* Fix for the Save My Username text wrapping/alignment */
.card-body .form-check-label {
  margin-bottom: 0;
  cursor: pointer;
}

.position-relative hr {
  margin: 1.5rem 0;
  opacity: 0.15;
}

.text-400 { color: #adb5bd !important; }
.text-600 { color: #4d5969 !important; }

.btn-reveal-trigger:hover .btn-reveal {
  color: #2c7be5 !important;
}

.btn-reveal {
  transition: all 0.2s ease-in-out;
  color: #4d5969;
}

/* Mobile scrollbar management */
@media (max-width: 768px) {
  /* Hide scrollbars for a cleaner look on mobile, they still work by swiping */
  *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  * {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
}

/* Custom Top Nav Bar Styles */
.top-nav-card {
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.top-nav-card .card-header {
  background-color: transparent !important;
  border-bottom: none !important;
  padding: 1rem 1.25rem 0.25rem 1.25rem;
}

.top-nav-card .card-body {
  padding: 0.5rem 1.25rem 1rem 1.25rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.top-nav-card .card-body::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.btn-top-nav {
  border: 1px solid #d8e2ef !important;
  background-color: #fff !important;
  color: #4d5969 !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 0.25rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease-in-out;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-top-nav:hover {
  background-color: #f9fafd !important;
  color: #2c7be5 !important;
  border-color: #b6c1d2 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-top-nav i {
  color: #5e6e82;
  font-size: 0.85rem;
}

.btn-top-nav:hover i {
  color: #2c7be5;
}

.btn-top-nav.active {
  background-color: #edf2f9 !important;
  border-color: #2c7be5 !important;
  color: #2c7be5 !important;
}

.btn-top-nav.active i {
  color: #2c7be5;
}












.bg-card-gradient {
  background-image: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
}

.avatar-4xl {
  height: 7rem;
  width: 7rem;
}

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

.bg-auth-circle-shape {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

.bg-auth-circle-shape-2 {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: -1;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-happy-wrap {
  word-break: break-word;
}

.z-1 {
  z-index: 1;
}
