.layout {
  display: flex;
  min-height: 100vh;
}

body, .layout {
  background-color: #f6f7fb;
}

.layout .content {
  background-color: #f6f7fb;
}

.navbar-logo {
  height: 65px;
  margin-left: 30px;
}

/* sidebar */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background-color: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.secondary-sidebar {
  position: fixed;
  padding-top: 110px;
  background-color: #012960;
  width: 200px;
  height: 100vh;
  z-index: 0;
  top: 0;
}

/* sidebar nav links */
.base-link,
.base-link.btn {
  display: block;
  width: 90%;
  padding: 10px;
  text-align: left;
  font-weight: bold;
  font-size: large;
  color: #707080;
  background-color: transparent;
  cursor: pointer;
  padding-left: 5px;
  border-radius: 15px;
}

.base-link:hover,
.base-link:focus {
  background-color: #f5f6f8;
  color: black;
}

.base-link.active {
  background-color: #f5f6f8;
  color: black;
}

.base-link.btn {
  border-radius: 15;
}

.secondary-link,
.secondary-link.btn {
  display: block;
  width: 100%;
  padding: 15px;
  margin-left: 15px;
  text-align: left;
  font-weight: bold;
  font-size: large;
  color: white;
  background-color: transparent;
  cursor: pointer;
  padding-left: 30px;
}

.secondary-link:hover,
.secondary-link:focus {
  background-color: white;
  color: #012960;
}

.secondary-link.active {
  background-color: white;
  color: #012960;
}

.secondary-link.btn {
  border-radius: 0;
}

/* containers */
.content {
  width: calc(100vw - 220px);
  flex: 0 0 calc(100vw - 220px);
  margin-left: 220px;
  min-width: 0;
  display: block;
  box-sizing: border-box;
}

.content.with-margin {
  margin-left: 220px;
}

.main-content {
  margin: 0 auto;
  padding: 50px clamp(24px, 4vw, 56px) 120px;
  width: 100%;
  max-width: 1280px;
  min-width: 0;
  box-sizing: border-box;
}

.curriculum-main-content,
.main-content.centered-page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 2.5rem 3rem;
}

.content.with-margin .main-content {
  margin-left: 0;
  width: 100%;
}

.global-status-updates {
  position: fixed;
  z-index: 1100;
  top: 18px;
  left: calc(220px + (100vw - 220px) / 2);
  width: min(560px, calc(100vw - 220px - 48px));
  transform: translateX(-50%);
  pointer-events: none;
}

.global-status-updates .alert {
  box-shadow: 0 8px 30px rgba(15, 23, 42, .14);
  pointer-events: auto;
}

/* Shared polish and responsive overflow protection. */
.class-card,
.class-card * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.unit-overview p,
.unit-overview .fw-semibold {
  overflow-wrap: anywhere;
}

.unit-overview img {
  object-fit: contain !important;
  padding: 4px;
  background: #f8fafc;
}

.primary-sidebar {
  overflow-y: auto;
  padding-bottom: 28px;
  scrollbar-width: thin;
}

.primary-sidebar form:last-child {
  margin-bottom: 24px;
}

.word-list,
.fill-drop-bank {
  border-radius: 10px;
}

.word-list {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  color: #312e81;
  background: #fff;
  border: 2px solid #8b5cf6;
  font-weight: 700;
  cursor: grab;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.word-list:hover,
.word-list:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(91, 33, 182, .18);
}

.word-list.dragging {
  opacity: .45;
}

.fill-drop-bank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 105px;
  min-height: 42px;
  margin: 3px;
  padding: 3px;
  border: 2px dashed #93a4c7;
  background: #fff;
  vertical-align: middle;
  transition: border-color .15s ease, background .15s ease;
}

.fill-drop-bank.drag-over {
  border-color: #4f46e5;
  background: #eef2ff;
}

.fill-drop-bank.has-word {
  border-style: solid;
  border-color: #6366f1;
  background: #eef2ff;
}

.alert {
  overflow-wrap: anywhere;
}

.alert-stack {
  display: grid;
  gap: .5rem;
}

@keyframes live-pulse {
  0%, 100% { transform: scale(.9); opacity: .55; }
  50% { transform: scale(1.65); opacity: 0; }
}

.live-pulse {
  animation: live-pulse 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .live-pulse { animation: none; }
}

@media (max-width: 900px) {
  .sidebar {
    width: 180px;
  }

  .navbar-logo {
    max-width: 135px;
    height: auto;
    margin-left: 18px;
  }

  .main-content:not(.curriculum-main-content):not(.centered-page) {
    margin: 0 auto !important;
    padding: 32px 24px 96px !important;
    width: 100%;
  }

  .content,
  .content.with-margin {
    width: calc(100vw - 180px);
    flex-basis: calc(100vw - 180px);
    margin-left: 180px;
  }

  .content.with-margin .main-content {
    width: 100%;
    margin-left: 0 !important;
  }
}

.main-content.register-container {
  padding-top: 0;
  padding-bottom: 0;

  display: grid;
  place-items: center;
  min-height: 100vh;
}

.lesson-container {
  min-height: 200px;
}

.lesson-title {
  background-color: #012960;
  color: white;
  width: 100%;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

/* unit  */

.unit-container {
  display: grid;
  grid-template-columns: 1fr;
}

.unit-card {
  position: relative;
  height: 150px;
  overflow: hidden;
  cursor: pointer;
  margin: 15px;
}

.unit-bar {
    background-color: black;
    margin-left: 25px;
    height: 75%;
    width: 8px;
    border-radius: 30px;
}

.progress-bar {
    width: 90%;
    height: 8px;
    border-radius: 30px;
    background-color: black;
}

.unit-front,
.unit-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: row;
  /* justify-content: center;
  align-items: center; */
}

.unit-front {
  background: white;
  z-index: 2;
  opacity: 1;
}


.unit-back {
  z-index: 1;
  opacity: 0;
  background-color: #012960;
  padding: 12px;
  pointer-events: none;
  text-align: center;
}

.unit-card:hover .unit-front {
  /* opacity: 0; */
  background-color: #f6f7fb;
  pointer-events: none;
}

.unit-card:hover .unit-back {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
}

/* class container  */
.classroom-toolbar {
  margin-inline: 15px;
}

.class-container {
  display: flex;
  flex-wrap: wrap;
}

.class-card {
  background-color: white;
  transition: background-color 0.3s ease;
  margin: 15px;
  margin-top: 30px;
}

.class-card:hover {
  background-color: #012960;
  color: white;
}

/* Lesson list styles */

.lesson-list {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  margin: 0;
  padding: 0;
}

.lesson-item {
  margin-bottom: 5px;
}

.lesson-link {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-weight: 600;
  color: white;
  background-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.2s ease;
  text-decoration: none;
  border-radius: 5px;
}

.lesson-link:hover {
  background-color: white;
  color: #012960;
}

.assessment-link {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-weight: 600;
  color: #012960;
  background-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.2s ease;
  text-decoration: none;
  border-radius: 5px;
}

.assessment-link:hover {
  background-color: #012960;
  color: white;
}

/* doc cards */

.doc-card {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.doc-card:hover {
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
    transform: translateY(-3px);
}

/* .register-container {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 0px);
  min-height: 90vh;
} */

/* Existing scroll-container styles */
.image-scroll-container {
  height: 80vh;
  overflow-y: scroll;
  padding: 1rem;
  background-color: black;
  border: 1px solid black;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.page-image {
  display: block;
  margin: 2rem auto;
  height: 90vh;
  object-fit: contain;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: white;
}

.slideshow-container {
  position: relative;
  display: flex;
  align-items: center;       
  justify-content: center;   
  width: 100%;
  max-height: 90vh;
  background-color: black;
  overflow: hidden;
}

.slideshow-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: none;
  background-color: black;
}

/* Fullscreen mode layout */
.slideshow-container.fullscreen-mode {
  width: 100vw;
  height: 100vh;
}

.slideshow-container.fullscreen-mode .slideshow-image {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

/* Navigation buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  background-color: rgba(255, 255, 255, 0.6);
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  z-index: 10;
}

#prev-btn { left: 10px; }
#next-btn { right: 10px; }

.fullscreen-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 1.5rem;
  background-color: rgba(255, 255, 255, 0.6);
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.featured-resource {
  width: 100%;
  margin: 0.5rem;
  box-sizing: border-box;
  border: 2px solid #E5E7EB;
}

.featured-resource:hover {
  border: 2px solid #6161f6;
}

.resource-btn:hover {
  background-color: lightgray;
}

.search-container:focus-within {
  border: 2px solid #bbbbbd;
  box-shadow: 0px 0px 2px;
}

.search-bar:focus {
  outline: none;
  box-shadow: none;
}

.dropdown-container:focus-within {
  border: 2px solid #bbbbbd;
  box-shadow: 0px 0px 2px;
}

select:focus {
  outline: none;
  box-shadow: none;
}

.custom-carousel-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.custom-carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 50%;
  scroll-snap-align: start;
  display: flex;
}
