#swipe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999; /* Ensure it is above other elements */
    background-color: transparent; /* Fully transparent */
}

a {
    color: inherit !important;
    text-decoration: none !important;
}
a:hover {
    color: inherit !important;
    text-decoration: none !important;
}

p, h2, label, option, button {
    font-family: "Montserrat", sans-serif;
}


#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #333;
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: top 0.3s;
  z-index: 10002;
}

#navbar.hidden {
  top: -60px; /* Adjust based on navbar height */
}

@media (max-width: 991px) {
    #navbar.hidden {
        top: 0;
    }

    #viewer.spreads {
        margin-top: 65px;
    }
}

#brand {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0; /* Important for truncation to work properly */
}

#brand-logo {
  height: 24px;
  margin-right: 10px;
}

#brand-name {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%; /* Ensures it doesn't exceed the available space */
}

#nav-items {
    display: flex;
    align-items: center;
    margin-left: auto; /* Pushes nav items to the right */
}

.nav-item {
  cursor: pointer;
  padding: 0 10px;
  color: #f5f5f5;
}

.nav-item:hover {
  color: #ddd;
}


.dark-mode {
  background-color: #333;
  color: #f5f5f5;
}


#dark-mode-toggle {
  cursor: pointer;
}

#toc {
  position: fixed;
  left: 0;
  top: 0;
  width: 300px;
  height: 100%;
  background-color: #f5f5f5;
  color: black;
  box-shadow: -2px 0 5px rgba(0,0,0,0.5);
  z-index: 10003;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#toc.open {
  transform: translateX(0);
}

#toc h2 {
  margin-top: 0;
  padding: 16px;
}

#tocClose {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
}

#settings-panel {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -10%);
  background: white;
  border: 1px solid #ccc;
  padding: 20px;
  width: 80%;
  max-width: 600px;
  z-index: 10001;
  display: none;
}

#settings-panel h2 {
  margin-top: 0;
}

#settings-panel div {
  margin-bottom: 10px;
}

#settings-panel button#settingsClose, #end-of-sample-popup button#close-popup {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
}

#tocOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
}


body.dark-mode #settings-panel, body.dark-mode #toc {
  background: #444;
  color: #ddd;
  border: 1px solid #666;
}

body.dark-mode #settings-panel button#settingsClose, body.dark-mode #toc button#tocClose{
  color: #ddd;
}


#end-of-sample-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 20px;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 10002;
}

#end-of-sample-popup.visible {
    display: block;
    opacity: 1;
}

#end-of-sample-popup button {
    margin: 10px;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

#end-of-sample-popup button:hover {
    background: #0056b3;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}
.loading img {
    width: 50px; /* Adjust the size as needed */
    height: 50px;
}
.loading.hidden {
    display: none;
}
