/* General body and background */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #121212;
  color: #333;
  min-height: 100vh;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('https://raw.githubusercontent.com/Moyra01/TheLitroverse/main/background.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(0, 0, 0, 0.65);
  background-blend-mode: multiply;
  z-index: -1;
}

/* Navigation */
nav {
  position: relative;
  z-index: 10;
  padding: 10px 20px;
  background: transparent;
}

.menu button#menuBtn {
  font-size: 1.5rem;
  cursor: pointer;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  transition: background-color 0.3s;
}

.menu button#menuBtn:hover {
  background: rgba(255,255,255,1);
}

.dropdown-content {
  position: absolute;
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  top: 40px;
  left: 20px;
  z-index: 20;
  width: 220px;
}

/* Books */
.books-container {
  max-width: 900px;
  margin: 40px auto 60px;
  position: relative;
  z-index: 5;
  padding: 0 16px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 30px;
}

@media (max-width: 600px) {
  .books-grid {
    grid-template-columns: 1fr;
  }
}

.book-card {
  background: #fafafa;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 16px;
  text-align: center;
  position: relative;
  transition: box-shadow 0.2s;
  min-height: 370px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.book-card:not(.disabled):hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  cursor: pointer;
}

.book-image {
  width: 100%;
  max-width: 250px;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 14px;
  filter: blur(0px);
  transition: filter 0.2s;
  background: #ddd;
}

.book-card.disabled .book-image {
  filter: blur(8px) grayscale(85%);
}

.book-card.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.not-published {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  font-size: 1.3em;
  font-weight: bold;
  color: #ff8800;
  background: rgba(255,255,255,0.85);
  border-radius: 0 0 12px 12px;
  padding: 8px 0;
  z-index: 2;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  user-select: text;
}

.modal-content {
  background: #fff;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  box-sizing: border-box;
  padding: 32px 16px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (max-width: 600px) {
  .modal-content {
    padding: 18px 2vw 14px;
  }
}

.close {
  position: absolute;
  right: 16px;
  top: 12px;
  font-size: 2rem;
  cursor: pointer;
  background: transparent;
  border: none;
  color: #333;
}

#chapterContent {
  flex-grow: 1;
  overflow-y: auto;
  white-space: normal;
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 16px;
  text-align: justify;
  color: #222;
  outline: none;
  padding: 0;
}

/* Reader controls always stay at the bottom */
.reader-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid #ccc;
  padding-top: 10px;
  margin-bottom: 0;
  background: #fff;
  z-index: 10;
}

/* Make ad container always visible within modal */
#adContainer {
  margin: 20px 0;
  display: none;
  text-align: center;
}

button {
  cursor: pointer;
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #888;
  background-color: #fafafa;
  transition: background-color 0.3s ease;
}

button:hover:not(:disabled) {
  background-color: #ddd;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

#continueBtn {
  align-self: center;
  margin-top: 8px;
}
