* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:  sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
}


.scan-section {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  min-width: 0;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 850px;
  z-index: 10;
}

.title-container {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  margin-right: 1rem;
}

.title {
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-btn {
  background: none;
  border: none;
  color: #b2a3fd;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.log-btn:hover {
  color: #fff;
  text-decoration: underline;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
}

.nav-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: monospace;
  padding: 0 0.2rem;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.nav-btn:hover {
  color: #b2a3fd;
}

.nav-btn:active {
  transform: scale(0.9);
}

.gen-indicator {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1px;
  color: #b2a3fd;
  min-width: 55px;
  text-align: center;
}

figure.scan-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 850px;
  margin: auto;
}

.scan-img {
  max-width: 100%;
  max-height: 45vh;
  object-fit: contain;
  border-radius: 2px;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.scan-img:hover {
  opacity: 0.9;
}

figcaption {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #d0d0d0;
  background-color: #171717;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-family:  monospace;
  text-align: left;
  word-break: break-all;
  width: 100%;
  max-height: 25vh;
  overflow-y: auto;
}

.audio-container {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  width: 100%;
  max-width: 850px;
  margin-bottom: 0.5rem;
}

.audio-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 0 1 220px;
}

.audio-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #555;
}

audio {
  width: 100%;
  height: 32px;
  border-radius: 16px;
  outline: none;
}

audio::-webkit-media-controls-panel {
  background-color: #1c1c1c;
}

.sidebar {
  width: 260px;
  height: 100vh;
  background-color: #161616;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  padding: 1rem 0;
  flex-shrink: 0;
}

.sidebar-heading {
  font-size: 0.7rem;
  text-transform: lowercase;
  letter-spacing: 1px;
  color: #b2a3fd;
  background: #121212;
  padding: 0 1rem 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0.5rem;
	text-shadow: -5px -5px 2px #b2a3fd41;
  animation: rotateHue 103s linear infinite;
}

@keyframes rotateHue {
  from {
    filter: hue-rotate(0deg);
  }
  to {
    filter: hue-rotate(360deg);
  }
}

.titles-list {
  list-style: none;
}

.titles-list li {
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: #888;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  word-break: break-all;
}

.titles-list li:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: #eee;
}

.titles-list li.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: #b2a3fd;
  font-weight: 500;
  border-left: 2px solid #b2a3fd;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #121212;
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: 2rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-title {
  font-size: 0.85rem;
  color: #777;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 400;
}

.modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color 0.15s ease;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  background-color: #171717;
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-body pre {
  font-family: monospace;
  font-size: 0.8rem;
  color: #b0b0b0;
  white-space: pre-wrap;
  word-break: break-all;
}

.img-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 10, 10, 0.96);
  z-index: 1001;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
}

.img-modal-overlay.open {
  display: flex;
}

.img-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  padding: 0 0.5rem;
}

.img-modal-title {
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #777;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-modal-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem 0.6rem;
}

.playback-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #888;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.ctrl-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.ctrl-btn.active {
  background: #b2a3fd;
  color: #121212;
}

.rate-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.2rem;
}

.rate-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 2px;
  background: #333;
  border-radius: 1px;
  outline: none;
}

.rate-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b2a3fd;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.rate-slider::-webkit-slider-thumb:hover {
  transform: scale(1.4);
}

.rate-label {
  font-size: 0.7rem;
  color: #666;
  font-family: monospace;
}

.ctrl-divider {
  width: 1px;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.1);
}

.img-modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 1rem 0;
}

.full-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: none;
  border-radius: 2px;
}
