* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(0, 180, 255, 0.18), transparent 35%),
    linear-gradient(135deg, #07111f, #0b1628 55%, #020617);
  color: #ffffff;
  overflow: hidden;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 290px;
  height: 100vh;
  padding: 22px 16px;
  background: rgba(2, 8, 23, 0.94);
  border-right: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow: 8px 0 35px rgba(0, 0, 0, 0.35);
  z-index: 20;
  overflow-y: auto;
}

.sidebar h1 {
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.25;
  color: #e0f2fe;
}

.page-status {
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(30, 64, 175, 0.25);
  color: #bfdbfe;
  text-align: center;
  font-weight: bold;
}

.go-page {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.go-page input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: #0f172a;
  color: white;
}

.go-page button,
.download-side {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: white;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}

.download-side {
  display: block;
  text-align: center;
  margin-bottom: 16px;
}

.thumbs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumb {
  padding: 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s;
}

.thumb:hover,
.thumb.active {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.18);
}

.thumb img {
  width: 100%;
  border-radius: 6px;
  background: white;
  display: block;
}

.thumb span {
  display: block;
  margin-top: 6px;
  text-align: center;
  font-size: 13px;
  color: #cbd5e1;
}

.viewer {
  margin-left: 290px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px 30px;
  position: relative;
}

.book {
  width: 900px;
  height: 640px;
  filter: drop-shadow(0 25px 60px rgba(0, 0, 0, 0.55));
}

.page {
  background: #ffffff;
  overflow: hidden;
  border-radius: 4px;
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  display: block;
}

.loading {
  position: absolute;
  z-index: 10;
  padding: 18px 26px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  font-size: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.floating-controls {
  position: fixed;
  right: 28px;
  bottom: 28px;
  display: flex;
  gap: 12px;
  z-index: 30;
}

.floating-controls button,
.floating-controls a,
.menu-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: white;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.menu-toggle {
  display: none;
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 40;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .menu-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .viewer {
    margin-left: 0;
    padding: 75px 10px 90px;
  }

  .book {
    width: 96vw;
    height: 68vh;
  }

  .floating-controls {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 18px;
  }
}