/*
 * GOLPOOGRO - Immersive 3D Book Reader Shell Stylesheet
 * Luxury magazine bindings, deep leather casings, tactile page spreads & ambient lights
 */

:root {
  --reader-paper-bg: #fdfaf2; /* Deep high-grade classic ivory paper */
  --reader-paper-text: #2c251d; /* Warm dynamic dark charcoal text */
  --reader-spine-gradient: linear-gradient(to right, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.55) 48%, rgba(0,0,0,0.7) 50%, rgba(0,0,0,0.55) 52%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0.15) 100%);
  --reader-velvet-dark: #070708;
  --reader-gold-accent: var(--accent-gold, #3b82f6);
}

/* Immersive 3D Reading Backdrop */
.reader-immersive-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--reader-velvet-dark);
  background-image: radial-gradient(circle at 50% 40%, #151417 0%, #030204 100%);
  z-index: 11000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
  display: flex;
  flex-direction: column;
}

.reader-immersive-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Reader Core Frame Layout */
.reader-layout-header {
  height: 64px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  z-index: 10;
}

.reader-title-label {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--reader-gold-accent);
}

.reader-author-label {
  font-size: 0.75rem;
  color: var(--lux-text-secondary);
}

/* Tool belt container (bookmarking, zoom, font controls, annotations toggler, fullscreen) */
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.reader-tool-btn:hover {
  background: rgba(var(--accent-gold-rgb, 59, 130, 246), 0.2);
  border-color: var(--reader-gold-accent);
  color: var(--reader-gold-accent);
  transform: translateY(-2px);
}

.reader-tool-btn.active {
  background: var(--reader-gold-accent);
  color: #000;
}

/* Hardcover physical casing */
.physical-book-stage {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2000px;
  padding: 30px;
  overflow: hidden;
  position: relative;
}

.physical-hardcover-wrapper {
  width: 100%;
  max-width: 950px;
  height: calc(100vh - 180px);
  min-height: 480px;
  max-height: 650px;
  background: linear-gradient(135deg, #1e1b18 0%, #0d0c0b 100%);
  border-radius: 12px;
  border: 4px solid #100f0e;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.85), 
              0 0 100px rgba(var(--accent-gold-rgb, 59, 130, 246), 0.05),
              inset 0 1px 0 rgba(255,255,255,0.1);
  padding: 8px; /* Hardcover rim spacing */
  display: flex;
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(0deg);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Physical inner book pages spread block */
.physical-double-spread {
  flex-grow: 1;
  background-color: var(--reader-paper-bg);
  /* Elegant realistic noise/paper texture and page border lighting */
  background-image: linear-gradient(to right, rgba(0,0,0,0.03) 0%, transparent 4%, transparent 96%, rgba(0,0,0,0.04) 100%);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  user-select: text;
}

/* Middle Spine divider crease shadow */
.physical-middle-spine {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100px;
  height: 100%;
  background: var(--reader-spine-gradient);
  transform: translateX(-50%) translateZ(1px);
  pointer-events: none;
  z-index: 100;
  opacity: 0.9;
}

/* Pages text column containers */
.reader-page-container {
  padding: 40px 50px 30px 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  height: 100%;
  overflow-y: hidden;
  transition: opacity 0.3s;
}

/* Fine-tune padding to keep spine gutter looking completely natural */
.reader-page-container.left {
  padding-right: 60px;
  border-right: 1px solid rgba(0, 0, 0, 0.08); /* Crease border line */
}

.reader-page-container.right {
  padding-left: 60px;
}

/* Real-looking physical page curl/shading layers */
.reader-page-container::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50px;
  height: 100%;
  pointer-events: none;
}

.reader-page-container.left::after {
  right: 0;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.04));
}

.reader-page-container.right::after {
  left: 0;
  background: linear-gradient(to left, transparent, rgba(0,0,0,0.04));
}

/* High-quality literature typography */
.reader-page-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--reader-paper-text);
  text-align: justify;
  text-justify: inter-word;
  padding: 0 4px;
}

.reader-page-text p {
  margin-top: 0;
  margin-bottom: 1.25em;
  text-indent: 1.5em; /* Traditional book indentation */
}

.reader-page-text p:first-of-type {
  text-indent: 0; /* No indent on chapter start draft */
}

/* Chapter dropcap effect */
.reader-page-text p.dropcap::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 3.2rem;
  line-height: 0.85;
  padding-top: 4px;
  padding-right: 8px;
  padding-left: 3px;
  font-weight: bold;
  color: var(--reader-gold-accent);
}

/* Page bottom headers or page counters */
.reader-page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: rgba(44, 37, 29, 0.5);
  border-top: 1px solid rgba(44, 37, 29, 0.08);
  padding-top: 12px;
  margin-top: 12px;
}

/* Bottom navigation deck metrics tracking */
.reader-navigation-footer {
  height: 64px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: #fff;
  z-index: 10;
}

/* Progress slider */
.reader-progress-rack {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-grow: 1;
  max-width: 500px;
  margin: 0 20px;
}

.reader-progress-slider {
  flex-grow: 1;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

.reader-progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--reader-gold-accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--lux-gold-glow);
  transition: transform 0.2s;
}

.reader-progress-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Right-side private notes sidebar drawer */
.reader-annotations-drawer {
  position: absolute;
  top: 64px;
  right: -320px;
  width: 320px;
  height: calc(100vh - 128px);
  background: #111012;
  border-left: 1px solid var(--lux-border);
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  z-index: 100;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.reader-annotations-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--reader-gold-accent);
  font-family: var(--font-serif);
}

.drawer-body {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  color: #fff;
}

/* Bookmark corner ribbon */
.bookmark-corner-ribbon {
  position: absolute;
  top: 0;
  right: 24px;
  width: 24px;
  height: 40px;
  background: rgba(var(--accent-gold-rgb, 59, 130, 246), 0.2);
  border: 1px dashed var(--reader-gold-accent);
  border-top: none;
  cursor: pointer;
  z-index: 200;
  transition: all 0.3s;
}

.bookmark-corner-ribbon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -1px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 8px solid var(--reader-velvet-dark); /* cut standard wedge */
}

.bookmark-corner-ribbon.active {
  background: var(--reader-gold-accent);
  border-style: solid;
  height: 55px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Keyboard arrows hints hud */
.keyboard-guide-hud {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
  font-family: var(--font-mono);
  display: flex;
  gap: 12px;
}
