/* Positioning for the microphone button */
#voiceSearchBtn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  padding: 15px;
  border-radius: 50%;
  border: none;
  background-color: #007bff;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  cursor: pointer;
}

/*Word document*/
h1, h2, h3, h4, h5, h6 {
  cursor: pointer;
  background: #f0f0f0;
  padding: 10px;
}

.section-content {
  padding-left: 20px;
  display: block;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
}

td, th {
  border: 1px solid black;
  padding: 8px;
}
/* end Word document*/


/* Styling for the search results overlay */
#voiceSearchResults {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255,255,255,0.95);
  overflow-y: auto;
  z-index: 999;
  padding: 20px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(255, 0, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

#micWidget.listening {
  animation: pulse 1.5s infinite;
  border-radius: 50%;
  background-color: red !important; /* Optional highlight */
}


html {
  scroll-padding-top: 150px;
}

canvas {
  border: 1px solid black;
  display: block;
  margin: 20px auto;
}

#voiceBtn.listening {
  background-color: red;
  color: white;
  animation: pulse 1s infinite;
}

#voiceHint {
  display: block;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

mark {
  background-color: yellow;
  color: black;
}

:root {
  --bg-color: #fff;
  --text-color: #000;
  --highlight-color: yellow;
  --active-color: #e0f0ff;
  --accent-color: #007BFF;
  --button-bg: #007BFF;
  --button-text: #fff;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

header {
  position: relative;
  z-index: 10;
}

.catalogButton {
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.main__content--alt {
  margin-bottom: 0;
  width: 100% !important;
  float: left !important;
  clear: left !important;
  padding-top: 20px !important;
}

#searchContainer {
  position: fixed;
  top: 380px;
  width: 90%;
  z-index: 18;
  background: var(--bg-color);
  /*border-bottom: 1px solid #ccc;*/
  padding: 1rem;
}

#searchContainer.sticky {
   position: fixed;
   top: 95px; /* Adjusted based on header height */
   left: 0;
   right: 0;
   background-color: white;
   z-index: 999;
   width: 100%;
   padding: 1rem;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


#catalog {
  margin-top: 100px;
}

#searchInput {
  width: 90%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
}

#controls {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

#searchCount {
  margin-left: auto;
  font-size: 1.3rem;
  background: var(--highlight-color);
}

#suggestions {
  position: absolute;
  background: var(--bg-color);
  /*border: 1px solid #ccc;*/
  max-height: 200px;
  overflow-y: auto;
  width: calc(90% - 2rem);
  z-index: 9999;
}

.suggestion-item {
  padding: 0.5rem;
  cursor: pointer;
}

  .suggestion-item:hover,
  .suggestion-item.selected {
    background: var(--accent-color);
    color: var(--button-text);
  }

.suggestion-item.selected-suggestion {
  background-color: lightgray;
}

.suggestion-item mark {
  background-color: yellow;
}

.selected-suggestion {
  background-color: #d1ecf1;
  border-left: 4px solid #17a2b8;
}

.suggestion-item.highlighted {
  background-color: #f8f9fa;
  cursor: pointer;
}

.suggestion-item.active {
  background-color: #f8f9fa;
  cursor: pointer;
}


#catalogList {
  padding: 3rem;
}

  #catalogList li {
    margin-bottom: 0.4rem;
  }

.highlight {
  background: var(--highlight-color);
}

.active-match {
  background: var(--active-color);
  border-left: 4px solid var(--accent-color);
  padding-left: 6px;
}

  .active-match.selected-suggestion {
    background-color: #d1ecf1;
    border-left: 4px solid var(--accent-color);
    padding-left: 6px;
  }

#backToTop {
  position: fixed;
  bottom: 40px;
  right: 20px;
  z-index: 1000;
  background: var(--accent-color);
  color: var(--button-text);
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

  #backToTop.show {
    opacity: 1;
    visibility: visible;
  }

  #backToTop:hover {
    background-color: #555;
  }

/* VERY Small devices */
@media (max-width: 389.98px) {
  .catalogButton {
    flex: 1 1 auto;
    font-size: 0.75rem;
  }
}


/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
  /* Styles for very small phones */
  #controls {
    /*flex-direction: column;*/
    align-items: flex-start;
  }

  #catalogList {
    display: block;
    margin: 0;
    list-style: none;
    margin-top: 250px;
  }

  .catalogButton, #searchCount {
    /*width: 100%;*/
  }

  #suggestions {
    max-height: 150px;
    font-size: 0.9rem;
  }

  #searchContainer {
    position: fixed;
    width: auto;
    top: 320px;
  }

  h1 {
    font-size: 2rem;
    margin: 4rem
  }
}



/* Small devices (phones in landscape or small tablets) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .catalogButton {
    flex: 1 1 auto;
    font-size: 0.85rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Styles for tablets */
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* Styles for desktops */
  #searchContainer {
    position: fixed;
    top: 360px;
    z-index: 18;
    background: var(--bg-color);
    padding: 1rem;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  /* Styles for large screens */
}


@media (min-width: 1200px) and (max-width: 390px) {
  #searchContainer {
    position: fixed;
    width: auto;
    top: 160px;
  }
}
