/* ===== E-Kitab At-Tartil - Premium Flipbook Style ===== */
/* White-Green Theme with Elegant Design */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  /* Primary: Green */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  /* Neutral */
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-book: 0 30px 60px -15px rgba(20, 83, 45, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--green-50);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ===== Skeleton Loading ===== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(90deg,
      #f0f0f0 0%,
      #e8e8e8 20%,
      #f0f0f0 40%,
      #f0f0f0 100%);
  background-size: 1000px 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: inherit;
}

.skeleton-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* ===== Book Selection View ===== */
.view-selection {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, var(--green-100) 0%, transparent 70%),
    radial-gradient(ellipse at bottom, var(--green-100) 0%, transparent 70%),
    linear-gradient(180deg, var(--white) 0%, var(--green-50) 100%);
  position: relative;
}

/* Decorative Background */
.view-selection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 280px;
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 50%, var(--green-600) 100%);
  clip-path: ellipse(90% 100% at 50% 0%);
  z-index: 0;
}

.view-selection::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 280px;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  clip-path: ellipse(90% 100% at 50% 0%);
  z-index: 0;
}

/* Selection Header */
.selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--green-100);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--white);
  background: var(--white);
  object-fit: cover;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--green-800);
  letter-spacing: -0.03em;
}

.brand-text span {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-weight: 500;
}

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--green-600) 0%, var(--green-500) 100%);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
  transition: all var(--transition-normal);
}

.btn-home:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.45);
}

.btn-home:active {
  transform: translateY(-1px);
}

.btn-home span {
  display: none;
}

@media (min-width: 640px) {
  .selection-header {
    padding: 1rem 2rem;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .brand-text h1 {
    font-size: 1.375rem;
  }

  .btn-home span {
    display: inline;
  }
}

/* Selection Main */
.selection-main {
  flex: 1;
  padding: 2.5rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.selection-title {
  text-align: center;
  margin-bottom: 2rem;
}

.selection-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.selection-title p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

@media (min-width: 640px) {
  .selection-main {
    padding: 3rem 2rem;
  }

  .selection-title h2 {
    font-size: 2.25rem;
  }

  .selection-title p {
    font-size: 1.125rem;
  }
}

/* Books Grid */
.books-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.02),
    0 20px 40px rgba(20, 83, 45, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

@media (min-width: 540px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2rem;
  }
}

@media (min-width: 900px) {
  .books-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
    padding: 2rem 1.5rem;
  }
}

/* Book Item */
.book-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--green-100);
  transition: all var(--transition-slow);
  width: 100%;
}

.book-item:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(20, 83, 45, 0.2);
  border-color: var(--green-300);
}

.book-item:active {
  transform: translateY(-6px) scale(0.98);
}

.book-3d {
  position: relative;
  width: 100%;
  perspective: 600px;
}

.book-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-100);
  transform: rotateY(-8deg);
  transform-origin: left center;
  transition: all var(--transition-slow);
  box-shadow:
    4px 4px 15px rgba(0, 0, 0, 0.15),
    -2px 0 5px rgba(0, 0, 0, 0.05);
}

/* Skeleton for book cover */
.book-cover-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      #f0f0f0 0%,
      #e0e0e0 50%,
      #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.book-cover-wrap.loaded::before {
  opacity: 0;
}

.book-item:hover .book-cover-wrap {
  transform: rotateY(-18deg) scale(1.03);
  box-shadow:
    8px 8px 25px rgba(0, 0, 0, 0.2),
    -4px 0 10px rgba(0, 0, 0, 0.08);
}

.book-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow), opacity 0.3s ease;
  opacity: 0;
}

.book-cover-wrap.loaded img {
  opacity: 1;
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  width: 0px;
  height: 100%;
  background: linear-gradient(to right, var(--green-900), var(--green-700), var(--green-800));
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  transform: translateX(-100%) rotateY(90deg);
  transform-origin: right center;
  box-shadow: inset 2px 0 6px rgba(0, 0, 0, 0.3);
}

.book-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--green-700);
  letter-spacing: -0.01em;
}

/* Selection Footer */
.selection-footer {
  padding: 1.5rem;
  text-align: center;
  background: var(--white);
  border-top: 1px solid var(--green-100);
  position: relative;
  z-index: 1;
}

.selection-footer p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.selection-footer p:last-child {
  margin-bottom: 0;
}

.selection-footer a {
  color: var(--green-600);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.selection-footer a:hover {
  color: var(--green-700);
  text-decoration: underline;
}

/* ===== Reader View Animations ===== */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.view-reader {
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-reader.closing {
  animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.6, 1);
}

/* ===== Flipbook Reader View ===== */
.view-reader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #e8f5e9 0%, #f0fdf4 50%, #e8f5e9 100%);
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Reader Toolbar */
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid var(--green-100);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--green-700);
  background: var(--green-50);
  border: 2px solid var(--green-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

/* Ripple effect on click */
.toolbar-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--green-300) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.toolbar-btn:active::before {
  transform: scale(2.5);
  opacity: 0.4;
  transition: transform 0s, opacity 0s;
}

.toolbar-btn:hover {
  background: var(--green-100);
  border-color: var(--green-300);
  color: var(--green-800);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.15);
}

.toolbar-btn:active {
  transform: translateY(0) scale(0.92);
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.1);
}

.toolbar-center {
  text-align: center;
  flex: 1;
}

.toolbar-title {
  display: block;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--green-800);
  letter-spacing: -0.02em;
}

.toolbar-page {
  display: block;
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-weight: 500;
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

/* Reader Main */
.reader-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

/* Navigation Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--green-700);
  background: var(--white);
  border: 2px solid var(--green-200);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  transition: all var(--transition-fast);
  z-index: 5;
}

.nav-arrow:hover:not(:disabled) {
  background: var(--green-50);
  border-color: var(--green-400);
  color: var(--green-800);
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 15px 35px rgba(22, 163, 74, 0.25);
}

.nav-arrow:active:not(:disabled) {
  transform: translateY(-50%) scale(0.95);
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-prev {
  left: 1rem;
}

.nav-next {
  right: 1rem;
}

@media (min-width: 768px) {
  .nav-arrow {
    display: flex;
    width: 60px;
    height: 60px;
  }

  .nav-prev {
    left: 2rem;
  }

  .nav-next {
    right: 2rem;
  }
}

/* ===== Cover View (Centered Single Cover) ===== */
.cover-view {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.cover-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: coverFadeIn 0.4s ease;
}

@keyframes coverFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cover-image {
  width: auto;
  height: auto;
  max-width: min(85vw, 350px);
  max-height: calc(100vh - 280px);
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.07),
    0 10px 20px rgba(0, 0, 0, 0.1),
    0 30px 60px rgba(20, 83, 45, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  background: #f5f5f5;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.cover-image.loaded {
  opacity: 1;
}

/* Cover image skeleton */
.cover-wrapper::before {
  content: '';
  position: absolute;
  width: min(85vw, 350px);
  height: calc(min(85vw, 350px) * 1.4);
  max-height: calc(100vh - 280px);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg,
      #f0f0f0 0%,
      #e0e0e0 50%,
      #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.cover-wrapper.loaded::before {
  opacity: 0;
}

.start-reading-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--green-600) 0%, var(--green-500) 100%);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
  transition: all var(--transition-normal);
  cursor: pointer;
}

/* Mobile: smaller button */
@media (max-width: 767px) {
  .start-reading-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    gap: 0.5rem;
  }

  .start-reading-btn svg {
    width: 16px;
    height: 16px;
  }
}

.start-reading-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.5);
}

.start-reading-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.start-reading-btn svg {
  flex-shrink: 0;
}

/* ===== Flipbook Container ===== */
.flipbook-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.flipbook {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* PageFlip Library Styling */
.flipbook .stf__parent {
  border-radius: var(--radius-lg);
  overflow: visible;
  box-shadow: var(--shadow-book);
}

.flipbook .stf__wrapper {
  box-shadow: none;
}

.flipbook .stf__block {
  background: var(--white);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.flipbook .page-content {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Skeleton for flipbook pages */
.flipbook .page-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      #f8f8f8 0%,
      #e8e8e8 50%,
      #f8f8f8 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.flipbook .page-content.loaded::before {
  opacity: 0;
}

.flipbook .page-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
  opacity: 0;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 2;
}

.flipbook .page-content.loaded img {
  opacity: 1;
}

/* Reader Footer */
.reader-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-top: 1px solid var(--green-100);
  flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-50);
  border: 2px solid var(--green-200);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

/* Mobile: smaller footer buttons */
@media (max-width: 767px) {
  .footer-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
  }

  .reader-footer {
    gap: 0.625rem;
    padding: 0.75rem 1rem;
  }
}

.footer-btn:hover:not(:disabled) {
  background: var(--green-100);
  border-color: var(--green-300);
  color: var(--green-800);
  transform: translateY(-2px);
}

.footer-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-nav label {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Mobile: hide label, smaller select */
@media (max-width: 767px) {
  .page-nav label {
    display: none;
  }

  .page-nav {
    gap: 0.5rem;
  }
}

.page-nav select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--green-800);
  background: var(--white);
  border: 2px solid var(--green-300);
  border-radius: var(--radius-lg);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2315803d'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.125rem;
  min-width: 120px;
  transition: all var(--transition-fast);
}

/* Mobile: smaller select */
@media (max-width: 767px) {
  .page-nav select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.8125rem;
    min-width: 100px;
    background-size: 1rem;
  }
}

.page-nav select:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.mobile-nav {
  display: flex;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
}

/* ===== Fullscreen Mode ===== */
.view-reader:fullscreen,
.view-reader:-webkit-full-screen {
  background: linear-gradient(180deg, #dcfce7 0%, #f0fdf4 50%, #dcfce7 100%);
}

.view-reader:fullscreen .reader-toolbar,
.view-reader:-webkit-full-screen .reader-toolbar,
.view-reader:fullscreen .reader-footer,
.view-reader:-webkit-full-screen .reader-footer {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.view-reader:fullscreen:hover .reader-toolbar,
.view-reader:-webkit-full-screen:hover .reader-toolbar,
.view-reader:fullscreen:hover .reader-footer,
.view-reader:-webkit-full-screen:hover .reader-footer {
  opacity: 1;
}

/* ===== Focus Styles ===== */
button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--green-400);
  outline-offset: 2px;
}

/* ===== Touch Optimizations ===== */
@media (hover: none) {
  .book-item:hover {
    transform: none;
  }

  .book-item:active {
    transform: scale(0.97);
  }

  .book-item:active .book-cover-wrap {
    transform: rotateY(-12deg);
  }

  .nav-arrow:hover:not(:disabled) {
    transform: translateY(-50%);
  }
}

/* ===== Loading State ===== */
.flipbook:empty::after {
  content: 'Memuat...';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 280px;
  height: 380px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  color: var(--green-600);
  font-weight: 600;
  font-size: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}