/* ==========================================================================
   Booklet Shell & Page Container Styles
   ========================================================================== */

.booklet-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  background-color: var(--color-bg);
  overflow: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   Booklet Header
   -------------------------------------------------------------------------- */
.booklet-header {
  height: var(--header-height);
  background-color: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.home-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  border: 2px solid var(--color-border);
  font-size: 1.25rem;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-btn:hover {
  background-color: var(--color-surface-hover);
  border-color: var(--color-primary-light);
}

.header-title-container {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.header-title {
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.student-badge {
  background-color: var(--color-bg-alt);
  color: var(--color-primary-dark);
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.page-counter-badge {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--color-primary-dark);
  background: var(--color-bg);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Page Viewport (Dynamic Stage)
   -------------------------------------------------------------------------- */
.booklet-viewport {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.page-stage {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
}

/* Page Header / Prompt */
.page-hero {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.page-number-pill {
  display: inline-block;
  background-color: var(--color-primary-light);
  color: #FFFFFF;
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
}

.page-subtitle {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Booklet Bottom Navigation Bar
   -------------------------------------------------------------------------- */
.booklet-nav-bar {
  height: var(--footer-height);
  background-color: var(--color-surface);
  border-top: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  z-index: 100;
  flex-shrink: 0;
}

.nav-dots-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 var(--space-md);
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .header-title {
    max-width: 140px;
    font-size: var(--text-sm);
  }

  .booklet-viewport {
    padding: var(--space-sm) var(--space-md);
  }

  .booklet-nav-bar {
    padding: 0 var(--space-sm);
    height: 64px;
  }

  .nav-arrow-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 1.25rem;
  }

  .progress-container {
    display: none;
  }

  .progress-bar-mobile {
    display: block;
  }
}
