/* Paradox Book Custom Styles */

/* Book Container */
.book-container {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 0 30px var(--primary-color), 0 0 60px rgba(0, 255, 255, 0.3);
  min-height: 100vh;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  padding-bottom: 60px;
}

/* Chapter Navigation */
.chapter-navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(255, 215, 0, 0.3);
}

.nav-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.nav-btn {
  background: rgba(0, 0, 0, 0.6);
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-size: 14px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.nav-btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: -1;
}

.nav-btn:hover {
  color: var(--dark-bg);
  box-shadow: var(--button-hover-shadow);
  transform: translateY(-3px);
}

.nav-btn:hover:before {
  width: 100%;
}

.chapter-select {
  padding: 8px 12px;
  border: 1px solid var(--primary-color);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--primary-color);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chapter-select:hover {
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* Chapter Content */
.chapter {
  display: none;
  animation: chapterFadeIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 40px 30px;
  max-width: 800px;
  margin: 0 auto;
}

.chapter.active {
  display: block;
}

@keyframes chapterFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Chapter Title */
.chapter-title {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9));
  border-left: 5px solid var(--primary-color);
  border-bottom: 1px solid var(--primary-color);
  padding: 30px;
  margin: 0 0 40px 0;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.chapter-title:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.chapter-title:hover:before {
  opacity: 1;
}

.chapter-title h1 {
  color: var(--primary-color);
  border: none;
  margin: 0;
  font-size: 2.2em;
  text-shadow: var(--glow-shadow);
  position: relative;
  z-index: 1;
}

.chapter-subtitle {
  font-size: 1.2em;
  opacity: 0.9;
  font-style: italic;
  margin-top: 10px;
  color: var(--light-text);
  position: relative;
  z-index: 1;
}

/* Chapter Content */
.chapter-content {
  color: var(--light-text);
  line-height: 1.8;
  text-align: left;
}

.chapter-content p {
  margin-bottom: 1.5em;
  font-size: 1.1em;
}

/* Chapter Transition with Sigil */
.chapter-transition {
  position: relative;
  margin: 60px 0;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.transition-sigil {
  width: 80px;
  height: 80px;
  position: relative;
  z-index: 2;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.transition-sigil:hover {
  transform: scale(1.2) rotate(10deg);
  cursor: zoom-in;
}

.transition-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 215, 0, 0.3) 20%, 
    var(--primary-color) 50%, 
    rgba(255, 215, 0, 0.3) 80%, 
    transparent 100%);
  z-index: 1;
}

/* Reflection Prompts */
.reflection-prompt {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--secondary-color);
  border-radius: 15px;
  padding: 25px;
  margin: 40px 0;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.reflection-prompt:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(111, 66, 193, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.reflection-prompt:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px rgba(111, 66, 193, 0.6);
  border-color: var(--secondary-color);
}

.reflection-prompt:hover:before {
  opacity: 1;
}

.reflection-prompt h3 {
  color: var(--secondary-color);
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.reflection-prompt p {
  color: var(--light-text);
  position: relative;
  z-index: 1;
}

.reflection-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  background: var(--secondary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-text);
  font-size: 16px;
  z-index: 2;
}

/* Journal Overlay */
.journal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.journal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.journal-container {
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--secondary-color);
  border-radius: 15px;
  padding: 30px;
  position: relative;
  overflow-y: auto;
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 30px rgba(111, 66, 193, 0.5);
}

.journal-overlay.active .journal-container {
  transform: translateY(0);
  opacity: 1;
}

.journal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--secondary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.journal-close:hover {
  background: var(--secondary-color);
  color: var(--light-text);
  transform: rotate(90deg);
}

.journal-title {
  color: var(--secondary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(111, 66, 193, 0.3);
}

.journal-content {
  margin-bottom: 20px;
}

.journal-textarea {
  width: 100%;
  min-height: 200px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(111, 66, 193, 0.5);
  border-radius: 10px;
  padding: 15px;
  color: var(--light-text);
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  resize: vertical;
  transition: all 0.3s ease;
}

.journal-textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 15px rgba(111, 66, 193, 0.3);
}

.journal-save {
  background: var(--secondary-color);
  color: var(--light-text);
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  transition: all 0.3s ease;
}

.journal-save:hover {
  background: #8a5cf6;
  transform: translateY(-3px);
  box-shadow: 0 0 15px rgba(111, 66, 193, 0.5);
}

/* Highlight System */
.highlight-controls {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
  transform: translateX(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.highlight-controls.active {
  transform: translateX(0);
  opacity: 1;
}

.highlight-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--primary-color);
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.highlight-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.highlight-yellow {
  background-color: rgba(255, 215, 0, 0.2);
}

.highlight-purple {
  background-color: rgba(111, 66, 193, 0.2);
}

.highlight-blue {
  background-color: rgba(0, 255, 255, 0.2);
}

/* Note System */
.note-indicator {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: super;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  color: var(--dark-bg);
  cursor: pointer;
  transition: all 0.3s ease;
}

.note-indicator:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px var(--primary-color);
}

.note-popup {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  padding: 15px;
  width: 250px;
  z-index: 95;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.note-popup.active {
  opacity: 1;
  visibility: visible;
}

.note-content {
  color: var(--light-text);
  font-size: 14px;
  margin-bottom: 10px;
}

.note-edit {
  background: transparent;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
  transition: all 0.3s ease;
}

.note-edit:hover {
  color: #ffd700;
}

/* Zoomable Sigils */
.sigil-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sigil-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sigil-container {
  position: relative;
  width: 90%;
  max-width: 800px;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sigil-image {
  max-width: 100%;
  max-height: 100%;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.sigil-overlay.active .sigil-image {
  transform: scale(1);
  opacity: 1;
}

.sigil-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sigil-close:hover {
  background: var(--primary-color);
  color: var(--dark-bg);
  transform: rotate(90deg);
}

.sigil-caption {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--light-text);
  font-size: 16px;
  opacity: 0.8;
}

/* Cover Page */
.cover-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.8));
  position: relative;
  overflow: hidden;
}

.cover-sigil {
  width: 180px;
  height: 180px;
  margin-bottom: 40px;
  position: relative;
  animation: pulse 3s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); }
  to { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8)); }
}

.cover-title {
  font-size: 3.5rem;
  margin-bottom: 20px;
  color: var(--primary-color);
  text-shadow: var(--glow-shadow);
  text-align: center;
  letter-spacing: 2px;
}

.cover-subtitle {
  font-size: 1.3rem;
  margin-bottom: 30px;
  color: var(--light-text);
  text-align: center;
  max-width: 700px;
  line-height: 1.6;
}

.cover-author {
  font-size: 1.1rem;
  color: var(--light-text);
  opacity: 0.8;
  margin-top: 20px;
  text-align: center;
}

.start-reading {
  margin-top: 50px;
}

/* Table of Contents */
.toc {
  max-width: 700px;
  margin: 50px auto;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 15px;
  padding: 30px;
}

.toc-title {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8rem;
  text-shadow: var(--glow-shadow);
}

.toc-item {
  padding: 12px 15px;
  margin: 8px 0;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  color: var(--light-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-item:hover {
  background: rgba(255, 215, 0, 0.1);
  border-left-color: var(--primary-color);
  transform: translateX(5px);
}

.toc-item-number {
  color: var(--primary-color);
  font-weight: 600;
  margin-right: 10px;
}

.toc-item-title {
  flex-grow: 1;
}

/* Voice Playback */
.voice-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

.voice-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.voice-btn:hover {
  background: var(--secondary-color);
  color: var(--light-text);
  transform: scale(1.1);
}

.voice-progress {
  flex-grow: 1;
  height: 4px;
  background: rgba(111, 66, 193, 0.3);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.voice-progress-bar {
  height: 100%;
  background: var(--secondary-color);
  width: 0;
  transition: width 0.1s linear;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .chapter {
    padding: 30px 20px;
  }
  
  .chapter-title {
    padding: 20px;
    margin: 0 0 30px 0;
  }
  
  .chapter-title h1 {
    font-size: 1.8em;
  }
  
  .chapter-transition {
    margin: 40px 0;
    height: 100px;
  }
  
  .transition-sigil {
    width: 60px;
    height: 60px;
  }
  
  .cover-title {
    font-size: 2.5rem;
  }
  
  .cover-subtitle {
    font-size: 1.1rem;
  }
  
  .nav-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .chapter {
    padding: 20px 15px;
  }
  
  .chapter-title h1 {
    font-size: 1.5em;
  }
  
  .chapter-subtitle {
    font-size: 1em;
  }
  
  .transition-sigil {
    width: 50px;
    height: 50px;
  }
  
  .cover-title {
    font-size: 2rem;
  }
  
  .cover-sigil {
    width: 120px;
    height: 120px;
  }
  
  .journal-container {
    padding: 20px;
  }
}
