/* Components */

/* View Archive Button */
.view-archive-wrapper {
  text-align: center;
  margin-top: 40px;
}
.view-archive-btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--primary-text-over);
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition-standard), transform var(--transition-standard), box-shadow var(--transition-standard);
  box-shadow: 0 4px 12px rgba(var(--primary-color), 0.3); /* Use actual color if var not working for shadow */
}
.view-archive-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--primary-color), 0.4);
}
html.dark-mode .view-archive-btn {
    color: var(--primary-text-over); /* Ensure text color is correct for dark mode button */
}


/* Search Modal */
.search-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 1050; /* High z-index to be on top */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.search-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.search-modal-content {
  background-color: var(--bg-main);
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(var(--shadow-color-light-rgb), 0.25);
  width: 90%;
  max-width: 650px;
  position: relative;
  max-height: 85vh; /* Limit height and allow scroll */
  overflow-y: auto; /* Scroll for content overflow */
}
.search-modal-close {
  position: absolute;
  top: 0px; /* Adjust for better placement with padding */
  right: 0px; /* Adjust for better placement with padding */
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 36px; /* Consistent size */
  height: 36px; /* Consistent size */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1; /* Ensure icon is centered */
  transition: background-color 0.2s ease, color 0.2s ease;
}
.search-modal-close svg {
  width: 18px;
  height: 18px;
}
.search-modal-close:hover {
  color: var(--text-main);
  background-color: var(--bg-secondary); /* Subtle hover background */
}
html.dark-mode .search-modal-close:hover {
  background-color: var(--bg-card); /* Dark mode hover background */
}
.modal-search-input {
  width: 100%;
  padding: 10px 15px;
  font-size: 1.1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-top: 10px; /* Space from top or title */
  margin-bottom: 20px;
  background-color: var(--bg-secondary);
  color: var(--text-main);
  box-sizing: border-box; /* Include padding and border in width */
  line-height: 1.5;
}
.modal-search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.2); /* Focus ring, use actual color if var not working */
  outline: none;
}
.modal-search-results {
  max-height: calc(85vh - 120px); /* Adjust based on modal padding and input height */
  overflow-y: auto;
  text-align: left;
}
.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.search-result-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color); /* Use theme border color */
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item a {
  font-size: 1.1em;
  color: var(--text-link);
  text-decoration: none;
  font-weight: 600;
  display: block; /* Make entire item clickable */
}
.search-result-item a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.search-result-summary {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

/* Theme Toggle Button */
#theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-tertiary);
  padding: 8px 12px; /* Match .nav-item-button for consistency if desired */
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px; /* Match .nav-item-button */
  font-weight: 500; /* Match .nav-item-button */
  transition: color var(--transition-standard), border-color var(--transition-standard), background-color var(--transition-standard);
  margin-left: 20px; /* Space from other nav items */
  min-width: 90px; /* Ensure text fits */
  text-align: center;
  display: inline-flex; /* For icon alignment if added */
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#theme-toggle:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: var(--bg-secondary); /* Consistent hover with other nav buttons */
}
html.dark-mode #theme-toggle:hover {
  background-color: var(--bg-card);
}