/* Horizontal nav with images (top) */
nav.horizontal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding: 10px;
  justify-content: center;
}

.horizontal-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 500px;
  flex: 1 1 80px;
  box-sizing: border-box;
  user-select: none;
  transition: all 0.3s ease;
}

.horizontal-nav .nav-item img {
  width: 150px;
  height: 120px;
  padding: 20px;
  box-sizing: content-box;
  transition: background-color 0.3s ease, transform 0.2s ease;
  background-color: #E6E6E6;
  cursor: pointer;
}

.horizontal-nav .nav-item img:hover {
  background-color: yellow;
  transform: scale(1.1);
}

.horizontal-nav .nav-item.selected img {
  background-color: yellow !important;
}

.horizontal-nav .nav-label {
  margin-top: 6px;
  font-size: 14px;
  color: #333;
  text-align: center;
  font-weight: bold;
  font-family: DT-demi, Arial, sans-serif;
}

.horizontal-nav .nav-label-p {
  margin-top: 6px;
  font-size: 14px;
  color: #333;
  text-align: center;
  font-family: DT-light, Arial, sans-serif;
}

.horizontal-nav {
  .nav-link {
    padding: 0;

  }
}

/* Container for two vertical navs side by side */
.vertical-navs-container {
  display: flex;
  gap: 40px;
  max-width: 900px;
  margin: 30px auto;
  padding: 0 10px;
  box-sizing: border-box;
  justify-content: center;
  flex-wrap: wrap;
}

/* Each vertical nav */
nav.vertical-nav {
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
  padding: 15px;
  /*min-width: 200px;*/
  /* flex: 1 1 300px;*/
  box-sizing: border-box;
}

.vertical-navs-container {
  display: flex;
  gap: 40px;
  max-width: 1050px;
  /*900px;*/
  margin: 30px auto;
  padding: 0 10px;
  box-sizing: border-box;
  justify-content: center;
  flex-wrap: nowrap;
  /* Prevent wrapping */
  align-items: flex-start;
  /* Align navs to top, so height changes don't affect each other */
}

nav.vertical-nav {
  display: flex;
  flex-direction: column;
  background-color: #E6E6E6;
  padding: 15px;
  /*min-width: 500px;*/
  width: 1050px;
  /* Fixed width */
  /* max-width: 300px; */
  /* Fixed width */
  box-sizing: border-box;
  height: auto;
}


nav.vertical-nav h3 {
  margin-top: 0;
  font-size: 18px;
  margin-bottom: 12px;
  color: #444;
  padding-bottom: 6px;
}

/* Right vertical nav links */
nav.vertical-nav#verticalNav2 a {
  text-decoration: none;
  color: #333;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  font-size: 16px;
  display: block;
}


.vertical-nav {
  .nav-link {
    &:hover {
      background-color: transparent;
      font-weight: bold;
    }

    &.active {
      font-weight: bold;
      background-color: transparent;
    }

  }

  .open-accordion-link {
    &:hover {
      background-color: transparent;
      font-weight: bold;
    }

    &.active {
      font-weight: bold;
      background-color: transparent;
    }
  }

  #contactsupport {
    &:hover {
      background-color: transparent;
      font-weight: bold;
    }
  }

  #adminsearch {
    &:hover {
      background-color: transparent;
      font-weight: bold;
    }
  }

  #orgsearch {
    &:hover {
      background-color: transparent;
      font-weight: bold;
    }
  }
}



/* Accordion styles for left vertical nav */
#verticalNav1 .accordion-item {
  border-top: 1px solid #ddd;
}

#verticalNav1 .accordion-header {
  padding: 10px 12px;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 4px;
  margin-bottom: 6px;
}

#verticalNav1 .toggle-icon {
  font-weight: bold;
  font-size: 18px;
  transition: transform 0.3s ease;
  user-select: none;
}

#verticalNav1 .accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease;
  padding: 0 12px;
  font-size: 16px;
  color: #555;
  background-color: white;
  border-radius: 0 0 4px 4px;
  margin: 0;
  font-family: DT-light, Arial, sans-serif;
}

#verticalNav1 .accordion-item.active .accordion-content {
  max-height: 100%;
  padding: 10px 12px;
}

#verticalNav1 .accordion-item.active .toggle-icon {
  transform: rotate(45deg);
  /* plus to minus */
}

/* Content area */
#contentArea {
  margin: 20px auto 40px;
  max-width: 600px;
  padding: 20px;
  border: 2px solid #ccc;
  border-radius: 10px;
  background-color: #fafafa;
  min-height: 100px;
  box-sizing: border-box;
  font-size: 16px;
  color: #222;
  display: none;
  word-wrap: break-word;
}

/* Responsive */
@media (max-width: 700px) {
  .vertical-navs-container {
    flex-direction: column;
    gap: 20px;
  }

  nav.vertical-nav {
    min-width: 100%;
  }
}

@media (max-width: 800px) {

  /*700*/
  .vertical-navs-container {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  nav.vertical-nav {
    min-width: 100%;
    max-width: 100%;
  }
}


@media (max-width: 480px) {
  nav.horizontal-nav {
    gap: 15px;
    padding: 8px;
  }

  .horizontal-nav .nav-item {
    flex: 1 1 40%;
    max-width: none;
  }

  .horizontal-nav .nav-item img {
    max-width: 80px;
  }

  .horizontal-nav .nav-label {
    font-size: 12px;
  }

  #contentArea {
    font-size: 14px;
    padding: 15px;
  }
}

#verticalNav1 .accordion-header:hover {
  background-color: #E6E6E6;
  color: black;
}

#verticalNav1 .accordion-item.active .accordion-header {
  background-color: #E6E6E6;
  color: black;
  font-weight: bold;
  border-radius: 4px 4px 0 0;
}

#verticalNav1 .accordion-item.active .toggle-icon {
  color: black;
  /* change plus/minus icon color when open */
}

nav.vertical-nav#verticalNav2 a {
  text-decoration: underline;
  text-underline-offset: 4px;
  /* Move the underline lower */
  display: inline-block;
  /* Shrink to fit content */
  cursor: default;
  /* No pointer cursor on empty space */
  pointer-events: none;
}

nav.vertical-nav#verticalNav2 a .text-content {
  pointer-events: auto;
  cursor: pointer;
  /* Pointer cursor only when hovering span */
}

.search-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 0;
}

.search-container input[type="text"] {
  width: 100%;
  padding: 10px 10px 10px 35px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;

  background-color: #E6E6E6;
  /* subtle background */
  background-image: url('/userguides/assets/images/search-icon.svg');
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: 10px center;
}

.search-container label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 1.2em;
  text-align: center;
}

.file-list {
  margin-top: 5px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  display: none;
}

.file-list.show {
  display: block;
}

.file-list li {
  list-style: none;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.file-list li:last-child {
  border-bottom: none;
}

.file-list li:hover {
  background: #f0f8ff;
}

.file-list a {
  text-decoration: none;
  color: #333;
}

/* Overlay styles */
#page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

.navigatelink {
  color: #007A93;
  font-weight: bold;
}

#verticalNav1 {
  flex: 2 1 0;
}

#verticalNav2 {
  flex: 1 1 0;

}

@media (max-width: 320px) {
  .horizontal-nav .nav-item {
    flex: 1 1 0%;
    max-width: none;
  }

  nav.vertical-nav {
    /*min-width: 70%;*/
    width: 0;
  }

}

.video-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start;
  padding: 0 10px;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

.video-item {
  width: calc(33.333% - 16px);
  max-width: 400px;
  min-width: 280px;
  margin-bottom: 24px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .video-item {
    width: calc(50% - 16px);
    min-width: auto;
  }
}

@media (max-width: 600px) {
  .video-item {
    width: 100%;
    min-width: auto;
  }
}

.video-launcher {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  box-sizing: border-box;
  text-align: center;
}

.video-launcher a.open-popup {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.video-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(14px, 1.5vw, 18px);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: clamp(8px, 1vw, 12px) clamp(16px, 2vw, 24px);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.3s ease;
  z-index: 2;
  pointer-events: auto;
}

.play-button:hover {
  background: rgba(0, 0, 0, 0.8);
}

.video-title {
  margin-top: 8px;
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: bold;
  color: #333;
  text-align: center;
  cursor: default;
  word-wrap: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 999;
}

/* Popup Box */
.popup {
  background-color: white;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.popup p {
  margin-bottom: 20px;
  font-size: 18px;
}

/* Buttons Container */
.popup-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Make form and button flex items with equal width */
.popup-buttons form,
.popup-buttons button {
  flex: 1 1 45%;
}

/* Buttons inside form and standalone buttons fill their container */
.popup-buttons form button,
.popup-buttons button {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#confirmLogout {
  background-color: #000;
  color: white;
  transition: background-color 0.3s ease;
}

#confirmLogout:hover {
  background-color: #333;
}

#cancelLogout {
  background-color: #ccc;
  transition: background-color 0.3s ease;
}

#cancelLogout:hover {
  background-color: #aaa;
}


@media (max-width: 480px) {
  .popup {
    padding: 15px;
  }

  .popup-buttons form,
  .popup-buttons button {
    flex: 1 1 100%;
  }
}

#loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  display: none;
}

#loading-spinner.active {
  display: flex;
}

.spinner {
  border: 6px solid #ccc;
  border-top: 6px solid #007bff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}