@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --book-width: 900px;
  --book-height: 560px;

  --dark: #061a28;
  --dark-2: #0b2d3e;

  --gold: #d8a94b;
  --gold-light: #f4d27d;

  --paper: #fffdf8;
  --text: #35434a;
}

/* ===============================
   RESET
================================ */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;

  display: flex;
  flex-direction: column;

  font-family: "Noto Sans Gujarati", "Poppins", sans-serif;

  background:
    linear-gradient(135deg, rgba(3, 19, 31, 0.95), rgba(8, 44, 61, 0.9)),
    url("./img/bg.png");

  background-size: cover;
  background-position: center;
  background-attachment: fixed;

  color: var(--text);

  overflow-x: hidden;
  overflow-y: auto;
}

/* ===============================
   BACKGROUND
================================ */

.background {
  position: fixed;
  inset: 0;

  pointer-events: none;

  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(34, 156, 174, 0.12),
      transparent 35%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(220, 174, 73, 0.12),
      transparent 40%
    );

  z-index: -1;
}

/* ===============================
   HEADER
================================ */

.header {
  height: 70px;

  padding: 0 7%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: white;

  background: rgba(255, 255, 255, 0.95);

  border-bottom: 1px solid rgba(0, 0, 0, 0.08);

  backdrop-filter: blur(15px);

  flex-shrink: 0;

  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 28px;
}

.logo {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.brand h1 {
  margin: 0;

  color: #a16b1c;

  font-size: 22px;

  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;

  color: #4f8a62;

  font-size: 12px;

  letter-spacing: 1px;

  opacity: 0.9;
}

/* ===============================
   MUSIC BUTTON
================================ */

.music-btn {
  width: 42px;
  height: 42px;

  border-radius: 50%;

  border: 1px solid rgba(216, 169, 75, 0.6);

  background: rgba(255, 255, 255, 0.6);

  color: var(--gold);

  font-size: 20px;

  cursor: pointer;

  transition: 0.3s;
}

.music-btn:hover {
  transform: scale(1.08);

  background: var(--gold);

  color: var(--dark);
}

/* ===============================
   STAGE
================================ */

.stage {
  position: relative;

  flex: 1;
  min-height: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 25px 80px;

  perspective: 1800px;

  overflow: hidden;
}

/* ===============================
   BOOK CONTAINER
================================ */

.book-container {
  position: relative;

  width: var(--book-width);
  height: var(--book-height);

  max-width: 100%;

  perspective: 1800px;

  filter: drop-shadow(0 30px 35px rgba(0, 0, 0, 0.45));
}

/* ===============================
   BOOK
================================ */

.book {
  position: relative;

  width: 100%;
  height: 100%;

  transform-style: preserve-3d;
}

/* ===============================
   SPREAD
================================ */

.spread {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  display: flex;

  opacity: 0;

  visibility: hidden;

  transform-style: preserve-3d;

  transform-origin: center;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;

  pointer-events: none;
}

/* ACTIVE */

.spread.active {
  opacity: 1;

  visibility: visible;

  pointer-events: auto;

  z-index: 5;
}

/* ===============================
   BOOK FLIP ANIMATION
================================ */

.spread.flip-next {
  animation: flipNext 0.8s cubic-bezier(0.65, 0.05, 0.36, 1) forwards;

  transform-origin: left center;

  z-index: 20;

  backface-visibility: hidden;
}

.spread.flip-prev {
  animation: flipPrev 0.8s cubic-bezier(0.65, 0.05, 0.36, 1) forwards;

  transform-origin: right center;

  z-index: 20;

  backface-visibility: hidden;
}

@keyframes flipNext {
  0% {
    transform: perspective(1800px) rotateY(0deg) scale(1);

    opacity: 1;
  }

  45% {
    transform: perspective(1800px) rotateY(-90deg) scale(0.98);

    opacity: 0.8;
  }

  100% {
    transform: perspective(1800px) rotateY(-180deg) scale(0.96);

    opacity: 0;
  }
}

@keyframes flipPrev {
  0% {
    transform: perspective(1800px) rotateY(0deg) scale(1);

    opacity: 1;
  }

  45% {
    transform: perspective(1800px) rotateY(90deg) scale(0.98);

    opacity: 0.8;
  }

  100% {
    transform: perspective(1800px) rotateY(180deg) scale(0.96);

    opacity: 0;
  }
}

/* ===============================
   COVER
================================ */

.cover-spread {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cover-page {
  position: relative;

  width: 50%;
  height: 100%;

  overflow: hidden;

  border-radius: 4px;

  box-shadow: 10px 15px 35px rgba(0, 0, 0, 0.4);

  background: #061b2a;
}

.cover-page img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  user-select: none;

  -webkit-user-drag: none;
}

/* COVER SHINE */

.cover-shine {
  position: absolute;

  inset: 0;

  pointer-events: none;

  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 75%
  );

  transform: translateX(-120%);

  animation: shine 5s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-120%);
  }

  45%,
  100% {
    transform: translateX(130%);
  }
}

/* ===============================
   LEFT & RIGHT PAGES
================================ */

.left-page,
.right-page {
  position: relative;

  width: 50%;
  height: 100%;

  overflow: hidden;

  background: var(--paper);

  flex-shrink: 0;
}

/* LEFT PAGE */

.left-page {
  border-radius: 5px 0 0 5px;

  box-shadow: inset -10px 0 20px rgba(0, 0, 0, 0.08);
}

/* RIGHT PAGE */

.right-page {
  border-radius: 0 5px 5px 0;

  box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.05);
}

/* CENTER BOOK LINE */

.left-page::after {
  content: "";

  position: absolute;

  top: 0;
  right: 0;

  width: 2px;
  height: 100%;

  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, 0.2),
    transparent
  );

  z-index: 5;
}

/* ===============================
   IMAGE PAGE
================================ */

.image-page {
  background: #111;
}

.image-page img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  user-select: none;

  -webkit-user-drag: none;
}

/* ===============================
   TEXT PAGE
================================ */

.text-page,
.final-page {
  padding: 38px 42px;

  overflow-y: auto;

  scrollbar-width: none;

  background: linear-gradient(90deg, #fffdf8, #faf7ef);
}

.text-page::-webkit-scrollbar,
.final-page::-webkit-scrollbar {
  display: none;
}

.page-symbol {
  font-size: 25px;

  margin-bottom: 6px;
}

.text-page h2,
.final-page h2 {
  margin: 0 0 16px;

  color: #9c671a;

  font-size: 25px;

  line-height: 1.4;
}

.text-page h3 {
  color: #a16b1c;

  font-size: 16px;

  text-align: center;
}

.text-page p,
.final-page p {
  margin: 0 0 12px;

  font-size: 14px;

  line-height: 1.9;

  color: #405057;
}

.big-text {
  font-size: 18px !important;

  font-weight: 700;

  color: #8f5d17 !important;
}

/* ===============================
   GOLD LINE
================================ */

.gold-line {
  width: 110px;
  height: 2px;

  margin: 18px auto;

  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ===============================
   AUTHOR
================================ */

.author-img {
  width: 105px;
  height: 105px;

  margin: 15px auto;

  overflow: hidden;

  border-radius: 50%;

  border: 3px solid rgba(216, 169, 75, 0.6);

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.author-img img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.author {
  text-align: center;

  font-weight: 700;
}

.instagram {
  display: block;

  text-align: center;

  color: #875b9d;

  font-size: 13px;

  font-weight: 700;

  text-decoration: none;
}

/* ===============================
   HIGHLIGHT BOX
================================ */

.highlight-box {
  margin: 16px 0;

  padding: 15px;

  border-left: 4px solid var(--gold);

  background: linear-gradient(90deg, rgba(216, 169, 75, 0.12), transparent);

  color: #805517;

  line-height: 1.8;

  font-size: 14px;
}

.highlight-box strong {
  display: block;

  margin-top: 5px;

  color: #9a6418;

  font-size: 15px;
}

/* ===============================
   QUOTE
================================ */

blockquote {
  margin: 16px 0;

  padding: 16px 18px;

  border-left: 4px solid var(--gold);

  background: rgba(216, 169, 75, 0.09);

  color: #8d5a13;

  font-size: 15px;

  font-weight: 700;

  line-height: 1.8;
}

/* ===============================
   SECTION LINE
================================ */

.section-line {
  width: 100px;
  height: 2px;

  margin: 18px auto;

  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ===============================
   BOTTOM MESSAGE
================================ */

.bottom-message {
  margin-top: auto;

  padding-top: 20px;

  text-align: center;

  color: #9b6518;

  font-weight: 700;

  font-size: 13px;
}

/* ===============================
   FINAL PAGE
================================ */

.final-page {
  text-align: center;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.final-page h1 {
  margin: 8px 0;

  color: #9b6518;

  font-size: 28px;
}

.final-page h3 {
  color: #59636a;

  font-size: 14px;

  line-height: 1.8;
}

.prayer {
  margin: 10px 0;
}

.prayer strong {
  display: block;

  margin-top: 15px;

  color: #9c6619;

  font-size: 15px;
}

/* ===============================
   NAV BUTTONS
================================ */

.nav-btn {
  position: absolute;

  top: 50%;

  transform: translateY(-50%);

  width: 50px;
  height: 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  border: 1px solid rgba(255, 255, 255, 0.2);

  background: rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(12px);

  color: white;

  font-size: 38px;

  cursor: pointer;

  z-index: 100;

  transition: 0.3s;
}

.nav-btn:hover {
  background: var(--gold);

  color: var(--dark);

  transform: translateY(-50%) scale(1.08);
}

.nav-btn.disabled {
  opacity: 0.25;

  pointer-events: none;
}

.prev {
  left: 5%;
}

.next {
  right: 5%;
}

/* ===============================
   CONTROLS
================================ */

.controls {
  min-height: 72px;

  padding: 8px 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 18px;

  color: white;

  background: rgba(0, 0, 0, 0.22);

  border-top: 1px solid rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(15px);

  flex-shrink: 0;

  z-index: 30;
}

.controls button {
  width: 38px;
  height: 38px;

  border-radius: 50%;

  border: 1px solid rgba(216, 169, 75, 0.6);

  background: transparent;

  color: var(--gold-light);

  font-size: 25px;

  cursor: pointer;

  transition: 0.3s;
}

.controls button:hover {
  background: var(--gold);

  color: var(--dark);
}

.progress-area {
  width: 250px;

  text-align: center;
}

#pageIndicator {
  display: block;

  margin-bottom: 7px;

  font-family: "Poppins", sans-serif;

  font-size: 11px;

  color: rgba(255, 255, 255, 0.8);
}

.progress-track {
  width: 100%;
  height: 4px;

  overflow: hidden;

  border-radius: 20px;

  background: rgba(255, 255, 255, 0.15);
}

#progressBar {
  width: 0%;
  height: 100%;

  border-radius: inherit;

  background: linear-gradient(90deg, #b8781e, #f4d27d);

  transition: width 0.4s ease;
}

.progress-area small {
  display: block;

  margin-top: 6px;

  font-size: 9px;

  opacity: 0.6;
}

/* ===============================
   COPYRIGHT FOOTER
================================ */

.copyright-footer {
  width: 100%;

  min-height: 38px;

  padding: 9px 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 10px;

  flex-wrap: wrap;

  color: rgba(255, 255, 255, 0.65);

  background: #04131e;

  border-top: 1px solid rgba(255, 255, 255, 0.08);

  font-family: "Poppins", sans-serif;

  font-size: 11px;

  text-align: center;

  flex-shrink: 0;

  z-index: 30;
}

.copyright-footer a {
  color: var(--gold-light);

  font-weight: 600;

  text-decoration: none;

  transition: 0.3s;
}

.copyright-footer a:hover {
  color: white;

  text-decoration: underline;
}

.footer-divider {
  color: var(--gold);

  font-size: 13px;
}

/* ===============================
   TABLET
================================ */

@media (max-width: 1050px) {
  :root {
    --book-width: 82vw;
    --book-height: 52vw;
  }

  .stage {
    padding: 25px 60px;
  }
}

/* ===============================
   MOBILE
================================ */

@media (max-width: 768px) {
  :root {
    --book-width: 94vw;
    --book-height: 62vh;
  }

  .header {
    height: 60px;

    padding: 0 16px;
  }

  .brand {
    gap: 8px;
  }

  .logo {
    height: 48px;
  }

  .brand-icon {
    font-size: 23px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    font-size: 7px;
  }

  .music-btn {
    width: 36px;
    height: 36px;

    font-size: 17px;
  }

  .stage {
    padding: 12px 5px;

    align-items: center;
  }

  /* HIDE SIDE NAVIGATION */

  .nav-btn {
    display: none;
  }

  /* KEEP BOTH PAGES */

  .spread {
    display: flex;
  }

  /* MOBILE TEXT */

  .text-page,
  .final-page {
    padding: 18px 16px;
  }

  .page-symbol {
    font-size: 18px;

    margin-bottom: 2px;
  }

  .text-page h2,
  .final-page h2 {
    font-size: 17px;

    margin-bottom: 8px;
  }

  .text-page h3 {
    font-size: 11px;
  }

  .text-page p,
  .final-page p {
    font-size: 10px;

    line-height: 1.7;

    margin-bottom: 7px;
  }

  .big-text {
    font-size: 13px !important;
  }

  .highlight-box {
    margin: 8px 0;

    padding: 8px;

    font-size: 10px;
  }

  .highlight-box strong {
    font-size: 11px;
  }

  blockquote {
    margin: 8px 0;

    padding: 9px;

    font-size: 10px;
  }

  .section-line,
  .gold-line {
    margin: 10px auto;
  }

  .author-img {
    width: 60px;
    height: 60px;

    margin: 8px auto;
  }

  .author,
  .instagram {
    font-size: 9px !important;
  }

  .final-page h1 {
    font-size: 18px;
  }

  .final-page h3 {
    font-size: 10px;
  }

  .prayer strong {
    font-size: 11px;
  }

  /* CONTROLS */

  .controls {
    min-height: 55px;

    padding: 5px 10px;

    gap: 12px;
  }

  .controls button {
    width: 34px;
    height: 34px;

    font-size: 22px;
  }

  .progress-area {
    width: 180px;
  }

  .progress-area small {
    display: none;
  }

  /* COPYRIGHT */

  .copyright-footer {
    min-height: 32px;

    padding: 6px 10px;

    gap: 5px;

    font-size: 8px;

    line-height: 1.5;
  }

  .footer-divider {
    font-size: 9px;
  }
}

/* ===============================
   VERY SMALL MOBILE
================================ */

@media (max-width: 400px) {
  :root {
    --book-width: 96vw;
    --book-height: 58vh;
  }

  .text-page,
  .final-page {
    padding: 14px 12px;
  }

  .text-page p,
  .final-page p {
    font-size: 9px;
  }

  .text-page h2 {
    font-size: 15px;
  }

  .highlight-box {
    font-size: 9px;
  }

  .highlight-box strong {
    font-size: 10px;
  }

  .copyright-footer {
    font-size: 7px;
  }
}

/* ===============================
   DISABLE SELECT
================================ */

img {
  user-select: none;
  -webkit-user-drag: none;
}

button {
  font-family: inherit;
}
