/* Top header style */
.top_header {
  background-color: #1f272b;
  color: #fff;
  font-size: 13px;
  font-family: "Helvetica Neue", sans-serif;
  font-weight: 200;
}

/* Navbar */
#navbar {
  transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
  z-index: 1050;
}

#navbar.nav-scrolled {
  background-color: white !important;
  color: black !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Desktop navigation */
@media (min-width: 826px) {
  .custom-nav {
    display: flex !important;
  }

  .custom-hamburger {
    display: none !important;
  }

  #mobile-menu {
    display: none !important;
  }

  #navbar {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
  }
}

/* Mobile navigation */
@media (max-width: 825px) {
  .custom-nav {
    display: none !important;
  }

  .custom-hamburger {
    display: block !important;
  }

  #navbar {
    background-color: white !important;
    color: black !important;
  }

  #menu-toggle i {
    color: black !important;
  }
}

/* Mobile menu panel */
#mobile-menu {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  background-color: white;
  z-index: 40;
  transform-origin: top;
  transition: all 0.3s ease;
}

/* Sticky mobile header */
.mobile-header-sticky {
  position: sticky;
  top: 105px;
  z-index: 50;
  background-color: white;
}

/* Relative position fix for header offset */
@media (min-width: 640px) {
  .relative-position {
    top: -104px;
  }
}

/* Courses section offset */
.courses {
  margin-top: -104px;
}

@media(min-width: 640px) {
  .patch {
    margin-top: -104px;
  }
}

/* Sidebar */
@media (max-width: 768px) {
  #sidebar {
    display: block !important;
    position: fixed !important;
    top: 145px !important;
    left: 0;
    width: 100% !important;
    background-color: #F3F4F6;
    z-index: 999;
    max-height: 0;
    overflow-y: auto;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.2s ease-out;
  }

  #sidebar.show {
    max-height: 500px;
    opacity: 1;
  }

  #sidebar:not(.show) {
    max-height: 0;
    opacity: 0;
  }
}

/* Modal backdrop */
.modal {
  background: rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes fadeSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeSlideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

@keyframes fadeUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation utility classes */
.fade-up {
  animation: fadeUp 0.4s ease forwards;
}

.sidebar-fade-in {
  animation: fadeSlideIn 0.4s ease-out forwards;
}

.sidebar-fade-out {
  animation: fadeSlideOut 0.4s ease-in forwards;
}

/* Category active state */
.category-active {
  background-color: #FFC107;
  color: white;
}

/* Global font override */
.font {
  font-family: "Helvetica Neue", sans-serif;
}

/* Footer */
footer {
  font-family: "Helvetica Neue", sans-serif;
}

.carousel-track {
  transition: transform 0.5s ease-in-out;
}

.hover-up {
  transition: all 0.3s ease;
  transform: scale(1);
}

.hover-up:hover {
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Overlay background */
#popupOverlay {
  display: none;
  /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: overlayFadeIn 0.5s ease forwards;
}

/* Popup box */
#popupContent {
  position: relative;
  animation: popupZoomIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  opacity: 0;
  transform: scale(0.9);
  max-width: 90vw;
  max-height: 90vh;
}

/* The image */
#popupContent img {
  max-width: 100vw;
  max-height: 600px;
  /* 👈 limits tall images */
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  display: block;
  object-fit: contain;
  /* optional: makes sure it scales properly */
}



/* Close button */
#closePopup {
  position: absolute;
  top: 10px;
  right: 10px;
  background: black;
  color: white;
  border: none;
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.3s ease;
}

/* Animations */
@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popupZoomIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#imagePopupOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: overlayFadeIn 0.4s ease forwards;
}

#imagePopupContent {
  position: relative;
  animation: popupZoomIn 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  opacity: 0;
  transform: scale(0.9);
  max-width: 90vw;
  max-height: 90vh;
}

#imagePopupContent img {
  max-width: 90vw;
  max-height: 600px;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
  display: block;
  object-fit: contain;
}

#imagePopupClose {
  position: absolute;
  top: 10px;
  right: 10px;
  background: black;
  color: white;
  border: none;
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.3s ease;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popupZoomIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* continuous image scrolling */
.marquee-container {
  width: 100%;
  overflow: hidden;
  height: 100px;
}

.marquee-track {
  display: flex;
  flex-wrap: nowrap;
}

.marquee-track img {
  height: 80px;
  margin: 0 20px;
  flex-shrink: 0;
}

.course-text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* POPUP SLIDER */
.popup-slider{
  width: auto;
  max-width: 90vw;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

/* TRACK */
.popup-track{
  display: flex;
  animation: popupSlide 8s infinite;
}

/* EACH SLIDE */
.popup-slide{
  position: relative;
  width: 100%;
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* IMAGE */
.popup-slide img{
  display: block;
  width: auto;
  max-width: 90vw;
  max-height: 600px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.closePopup{
  position: absolute;
  top: 12px;
  right: 12px;   /* simple for mobile */
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,1);
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* POPUP CONTENT */
#popupContent{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* PAUSE ON HOVER */
.popup-track:hover{
  animation-play-state: paused;
}

/* SLIDE ANIMATION */
@keyframes popupSlide {

  0%{
    transform: translateX(0%);
  }

  45%{
    transform: translateX(0%);
  }

  50%{
    transform: translateX(-100%);
  }

  95%{
    transform: translateX(-100%);
  }

  100%{
    transform: translateX(0%);
  }
}

@media (min-width: 500px){
  .closePopup{
    right: calc(50% - 220px + 12px);
    /* assumes popup max-width = 700px */
  }
}