.reader {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.header-trigger-zone {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  z-index: 9998;
  pointer-events: auto;

  &.inactive {
    pointer-events: none;
  }
}

.footer-trigger-zone {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  z-index: 9998;
  pointer-events: auto;

  &.inactive {
    pointer-events: none;
  }
}

.reader-content {
  position: relative;
  flex: 1;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.bookmark-indicator {
  position: absolute;
  top: 0;
  left: 12px;
  z-index: 10;
  width: 48px;
  height: 64px;
  background: none;
  pointer-events: none;
}

.navigation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  cursor: pointer;
  pointer-events: auto;
  background: transparent;
}

#foliate-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

::ng-deep foliate-view {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-text {
  color: #fff;
  font-size: 1.1rem;
  margin: 0;
  font-weight: 500;
}

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

foliate-view::part(head) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  font-family: inherit;
  min-height: 32px;
  box-sizing: border-box;
}

foliate-view::part(foot) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  border-top: 1px solid var(--border-color, #e0e0e0);
  font-family: inherit;
  min-height: 32px;
  box-sizing: border-box;
}
