/* ==========================================================================
   CAPABILITY PROFILE FLIPBOOK (HỒ SƠ NĂNG LỰC KỸ THUẬT SỐ)
   Hồ Kim Tâm | IDAKE Ecosystem - Enterprise Architecture & Software Engineering
   Responsive 100dvh • 3D PageFlip • Light Theme Default • 1/2/4 Per-Page Layouts
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400;1,600&family=Cinzel:wght@600;700;800&display=swap");

:root {
  /* Light theme base variables */
  --bg-main: #f1f5f9;
  --bg-pattern: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  --bg-cover: #0b1329;
  --bg-cover-gradient: linear-gradient(145deg, #0b1329 0%, #172554 50%, #0f172a 100%);
  --paper-color: #ffffff;
  --paper-subtle: #f8fafc;
  --paper-border: #e2e8f0;
  
  /* Typography & Accents */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --corporate-blue: #1e40af;
  --corporate-accent: #2563eb;
  --corporate-cyan: #0284c7;
  --corporate-emerald: #059669;
  --gold-primary: #d4af37;
  --gold-light: #fef08a;
  --gold-dark: #b45309;
  --gold-gradient: linear-gradient(135deg, #d4af37 0%, #fef08a 50%, #b45309 100%);
  
  /* Shadows & Radius */
  --shadow-book: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 10px 20px -5px rgba(15, 23, 42, 0.15);
  --shadow-cover: 0 30px 60px -15px rgba(11, 19, 41, 0.45);
  --radius-card: 8px;
  --radius-btn: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
    var(--bg-pattern);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  font-family: "Montserrat", sans-serif;
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

/* App Viewport (Locked 100dvh, 0 scrollbars) */
.app-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 8px 12px;
  position: relative;
}

/* Top Header Bar */
.book-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1180px;
  height: 42px;
  padding: 0 10px;
  z-index: 10;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-monogram {
  min-width: 58px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--bg-cover);
  border: 1.5px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--gold-primary);
  box-shadow: 0 2px 8px rgba(11, 19, 41, 0.2);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-names {
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.brand-role {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--corporate-blue);
  background: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.btn-download-pdf-top {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--paper-border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-download-pdf-top:hover {
  background: var(--bg-cover);
  color: #ffffff;
  border-color: var(--bg-cover);
}

/* Stage Area for 3D Book */
.book-stage {
  flex: 1 1 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 0;
  perspective: 2000px;
}

#flipbook {
  position: relative;
  display: block;
  margin: auto;
  box-shadow: var(--shadow-book);
  border-radius: 4px;
}

/* Base Page Styling */
.page {
  background-color: var(--paper-color);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.02);
}

.page-content {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Decorative Framing for Interior Pages */
.inner-border {
  width: 100%;
  height: 100%;
  border: 1px solid var(--paper-border);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: #ffffff;
  border-radius: 4px;
}

.inner-border::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  pointer-events: none;
}

/* Spine Shadow Overlay */
.page:nth-child(even) .inner-border {
  box-shadow: inset -8px 0 16px -8px rgba(0, 0, 0, 0.05);
}

.page:nth-child(odd) .inner-border {
  box-shadow: inset 8px 0 16px -8px rgba(0, 0, 0, 0.05);
}

/* Hardcovers: Front and Back */
.page-cover {
  background: var(--bg-cover-gradient) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-cover);
  border-radius: 4px;
}

.cover-front-content {
  width: 100%;
  height: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  position: relative;
  background: radial-gradient(circle at 50% 30%, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
}

.cover-front-content::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  pointer-events: none;
}

.cover-header-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-top: 10px;
}

.cover-emblem {
  width: 110px;
  height: 85px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid var(--gold-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.25);
}

.cover-emblem-text {
  font-family: "Cinzel", serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 1.5px;
}

.cover-emblem-sub {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-top: 2px;
}

.cover-main-title {
  font-family: "Cinzel", "Playfair Display", serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.cover-divider {
  width: 80px;
  height: 2px;
  background: var(--gold-gradient);
  margin: 10px auto;
  border-radius: 2px;
}

.cover-subtitle {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cover-tagline {
  font-size: 12px;
  font-style: italic;
  color: #94a3b8;
  max-width: 320px;
  line-height: 1.4;
  margin: 0 auto;
}

.cover-footer {
  margin-bottom: 8px;
}

.cover-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.cover-org {
  font-size: 11px;
  font-weight: 500;
  color: #cbd5e1;
  margin-top: 2px;
}

.cover-edition {
  font-size: 9px;
  letter-spacing: 2px;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Interior Pages Typography */
.page-top-num {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--paper-border);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

/* In-Page Mini Layout Switcher */
.page-mini-layout {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.page-num-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--corporate-blue);
  background: var(--paper-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--paper-border);
}

.mini-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f1f5f9;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid var(--paper-border);
}

.btn-mini-layout {
  background: transparent;
  border: none;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  width: 20px;
  height: 18px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-mini-layout:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-mini-layout.active {
  background: var(--bg-cover);
  color: var(--gold-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.page-title {
  font-family: "Montserrat", sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.page-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--corporate-blue);
  margin-bottom: 8px;
}

/* Photo Area with 1, 2, 4 Layout Presets */
.page-photos {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  margin: 6px 0;
  position: relative;
  transition: all 0.3s ease;
}

.photo-slot {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--paper-border);
  background: var(--paper-subtle);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-slot:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  border-color: var(--corporate-accent);
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.photo-slot img[src*="avatar"] {
  object-position: center 18%;
}

.photo-slot .zoom-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  pointer-events: none;
}

.photo-slot:hover .zoom-hint {
  opacity: 1;
  transform: scale(1);
}

/* Slot Caption Overlay */
.slot-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, transparent 100%);
  color: #ffffff;
  padding: 10px 10px 6px;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}

/* Layout 1: Single Hero Image */
.page-photos[data-layout="1"] {
  display: flex;
}

.page-photos[data-layout="1"] .photo-slot:nth-child(1) {
  display: block;
}

.page-photos[data-layout="1"] .photo-slot:nth-child(n+2) {
  display: none !important;
}

/* Layout 2: Dual Images (Stacked or Side-by-Side) */
.page-photos[data-layout="2"] {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.page-photos[data-layout="2"] .photo-slot:nth-child(1),
.page-photos[data-layout="2"] .photo-slot:nth-child(2) {
  display: block;
}

.page-photos[data-layout="2"] .photo-slot:nth-child(n+3) {
  display: none !important;
}

/* Layout 4: 2x2 Gallery Grid */
.page-photos[data-layout="4"] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
}

.page-photos[data-layout="4"] .photo-slot {
  display: block;
}

/* Clean & Punchy Bullet Points (Zero Rambling) */
.page-bullets {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 4px 0;
}

.bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 10.5px;
  line-height: 1.35;
  color: #334155;
}

.bullet-icon {
  color: var(--corporate-accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.bullet-item strong {
  color: var(--text-main);
  font-weight: 700;
}

.page-highlight-stat {
  background: var(--paper-subtle);
  border-left: 3px solid var(--gold-primary);
  padding: 4px 8px;
  border-radius: 0 4px 4px 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--corporate-blue);
  margin: 3px 0;
  letter-spacing: 0.2px;
}

.page-quote {
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-main);
  background: var(--paper-subtle);
  border-left: 3px solid var(--corporate-blue);
  padding: 5px 8px;
  margin: 4px 0;
  border-radius: 0 4px 4px 0;
}

.page-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 3px 0;
}

.pill-tag {
  font-size: 9.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--corporate-blue);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--paper-border);
}

.page-bot-num {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: 4px;
}

/* Back Cover Styling */
.cover-back-content {
  width: 100%;
  height: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  position: relative;
  background: radial-gradient(circle at 50% 70%, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
}

.cover-back-content::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  pointer-events: none;
}

.back-title {
  font-family: "Cinzel", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 1.5px;
  margin-top: 6px;
}

.back-tagline {
  font-size: 11.5px;
  color: #94a3b8;
  max-width: 320px;
  line-height: 1.4;
  margin: 6px auto;
  font-style: italic;
}

.contact-card {
  width: 100%;
  max-width: 330px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e2e8f0;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}

.contact-row:hover {
  color: var(--gold-primary);
}

.contact-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.qr-section {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0;
}

.qr-frame {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.qr-frame img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-text {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  text-align: left;
}

.back-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 330px;
}

.btn-back-primary {
  flex: 1;
  background: var(--gold-gradient);
  color: #0f172a;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease;
}

.btn-back-primary:hover {
  transform: translateY(-1px);
}

.btn-back-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-back-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Floating Bottom Controls Toolbar */
.book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 30px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
  z-index: 20;
  margin-bottom: 2px;
}

.control-btn {
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: #e2e8f0;
  color: var(--corporate-blue);
}

.control-btn:active {
  transform: scale(0.94);
}

.control-btn.active {
  background: var(--bg-cover);
  color: var(--gold-primary);
}

.page-indicator {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  min-width: 75px;
  text-align: center;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--paper-border);
  margin: 0 2px;
}

/* Settings Modal */
.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.settings-modal.active {
  display: flex;
}

.settings-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--paper-border);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--paper-subtle);
  border-bottom: 1px solid var(--paper-border);
}

.settings-title {
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.settings-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--paper-subtle);
  border-radius: 8px;
  border: 1px solid var(--paper-border);
}

.page-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-row-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--corporate-blue);
}

.page-row-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.page-row-btns {
  display: flex;
  gap: 4px;
}

.page-row-btn {
  background: #ffffff;
  border: 1px solid var(--paper-border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-row-btn.active {
  background: var(--bg-cover);
  color: var(--gold-primary);
  border-color: var(--bg-cover);
}

.settings-footer {
  padding: 14px 20px;
  background: var(--paper-subtle);
  border-top: 1px solid var(--paper-border);
  display: flex;
  justify-content: space-between;
}

.btn-reset-layouts {
  background: #ffffff;
  border: 1px solid var(--paper-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-save-layouts {
  background: var(--bg-cover);
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary);
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 41, 0.95);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-caption {
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  margin-top: 14px;
  text-align: center;
}

/* Responsive adjustments for mobile screens */
@media (max-width: 768px) {
  .page-content {
    padding: 10px 12px;
  }
  .inner-border {
    padding: 10px 12px;
  }
  .page-title {
    font-size: 15px;
  }
  .page-subtitle {
    font-size: 10px;
    margin-bottom: 6px;
  }
  .page-quote {
    font-size: 9.5px;
    line-height: 1.35;
    padding: 4px 8px;
    margin: 4px 0 2px;
  }
  .pill-tag {
    font-size: 8.5px;
    padding: 1px 5px;
  }
  .page-bot-num {
    margin-top: 2px;
    font-size: 9px;
  }
  .cover-main-title {
    font-size: 20px;
  }
  .cover-subtitle {
    font-size: 11px;
  }
  .cover-emblem {
    width: 70px;
    height: 70px;
    margin: 10px 0;
  }
  .cover-emblem-text {
    font-size: 20px;
  }
  .page-bullets {
    gap: 4px;
    margin-top: 4px;
  }
  .bullet-item {
    font-size: 10px;
    line-height: 1.35;
    gap: 5px;
  }
  .bullet-icon {
    font-size: 10px;
  }
  .page-highlight-stat {
    font-size: 9.5px;
    padding: 3px 6px;
    margin: 4px 0 2px;
  }
}

@media (max-width: 500px) {
  .brand-role {
    display: none;
  }
  .header-tag {
    display: none;
  }
  .brand-names {
    font-size: 12px;
  }
  .btn-download-pdf-top span {
    font-size: 11px;
  }
}

/* Print Stylesheet for Instant PDF Generation */
@media print {
  html, body, .app-container {
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
  }
  
  .book-header, .book-controls, .settings-modal, .lightbox-modal {
    display: none !important;
  }
  
  .book-stage {
    display: block !important;
    perspective: none !important;
  }
  
  #flipbook {
    box-shadow: none !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page {
    page-break-after: always !important;
    page-break-inside: avoid !important;
    width: 100% !important;
    height: 100vh !important;
    display: block !important;
  }
}
