/* ======================================================== */
/* ESTILIZAÇÃO COMPLETA: DESIGN BRANCO MODERNO (FLIPHTML5)   */
/* ======================================================== */

body {
  background-color: #fafbfc;
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sidebar & Navigation Items */
.sidebar-item {
  color: #64748b;
}
.sidebar-item:hover {
  background-color: rgba(15, 23, 42, 0.04);
  color: #0f172a;
}
.sidebar-item.active {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Pílulas de Formato e Filtro */
.format-pill {
  color: #475569;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
}
.format-pill:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}
.format-pill.active {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Cards de Nicho em Alta (Clean White System) */
.niche-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}
.niche-card:hover {
  transform: translateY(-3px);
  border-color: #10b981;
  box-shadow: 0 12px 28px -10px rgba(16, 185, 129, 0.2);
}
.niche-card.selected {
  border-color: #10b981;
  background-color: #f0fdf4;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* Design Original do Prompt Box (Diferenciado & Moderno) */
.prompt-box-unique {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 28px;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.6);
  transition: all 0.3s ease;
  position: relative;
}
.prompt-box-unique:focus-within {
  border-color: #6366f1;
  box-shadow: 0 24px 48px -12px rgba(99, 102, 241, 0.15), 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.prompt-inner-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Badge de Tendência */
.trend-badge {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

/* Botões de Ação do Painel de Edição */
.pos-btn.active, .align-btn.active, .photo-pos-btn.active {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15) !important;
}

/* Folhas A4 e Proporções Realistas para o E-book */
.ebook-page {
  box-sizing: border-box;
  margin: 0 auto;
  line-height: 1.6;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Proporção 9:16 (Celular / Reels / E-book Moderno Vertical) */
.ebook-page.ratio-9-16 {
  width: 100% !important;
  max-width: 440px !important;
  min-height: 780px !important;
  height: auto !important;
  border-radius: 24px !important;
  padding: 24px 20px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(245, 158, 11, 0.25) !important;
  box-sizing: border-box !important;
  position: relative !important;
}

#pageCover.ratio-9-16 {
  aspect-ratio: 9 / 16 !important;
  height: 782px !important;
  max-height: 782px !important;
  overflow: hidden !important;
}

/* Proporção A4 Padrão (Impressão / PDF Tradicional) */
.ebook-page.ratio-a4 {
  width: 210mm !important;
  max-width: 100% !important;
  min-height: 297mm !important;
  border-radius: 8px !important;
  padding: 40px !important;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6) !important;
}

/* Proporção 16:9 (Desktop / Apresentação de Slides) */
.ebook-page.ratio-16-9 {
  width: 100% !important;
  max-width: 840px !important;
  min-height: 472px !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 20px !important;
  padding: 36px 40px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
}

/* Regra Absoluta de Ocultação */
.hidden {
  display: none !important;
}

/* Capa com Foto e Tipografia Editorial Profissional (Editável) */
#pageCover {
  padding: 0 !important;
  overflow: hidden !important;
  background-color: #030712 !important;
  position: relative !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

#pageCover:not(.hidden) {
  display: flex !important;
}

.ebook-page:not(.hidden) {
  display: flex !important;
}

#pageCover img#coverPureImage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 1 !important;
}

#coverOverlayGradient {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.2) 40%, rgba(0,0,0,0.75) 100%) !important;
  z-index: 2 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease;
}

#coverContentWrapper {
  position: relative !important;
  z-index: 3 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

.cover-text-shadow {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 4px 20px rgba(0, 0, 0, 0.95);
}

.editable-cover-text {
  outline: none;
  transition: all 0.2s ease;
}

.editable-cover-text:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: text;
}

.editable-cover-text:focus {
  background-color: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 2px #f59e0b;
  border-radius: 6px;
}

.btn-pages.active {
  background: #10b981 !important;
  color: #020617 !important;
  font-weight: 800 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35) !important;
}

.aspect-choice.active {
  border-color: #f59e0b !important;
  background-color: rgba(245, 158, 11, 0.15) !important;
}

@media screen and (max-width: 900px) {
  .ebook-page.ratio-a4 {
    width: 100% !important;
    min-height: auto !important;
    padding: 24px !important;
  }
}

.pos-btn.active, .align-btn.active, .photo-pos-btn.active {
  background: #f59e0b !important;
  color: #020617 !important;
  font-weight: 800 !important;
  border-color: #f59e0b !important;
}

/* Botões Ativos de Visualização e Proporção */
.aspect-btn.active, .ratio-btn.active {
  background: #f59e0b !important;
  color: #020617 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35) !important;
  border-color: #f59e0b !important;
}

/* Tipografia Editorial Padrão EbookGPT / Best-Seller */
.font-cinzel {
  font-family: 'Cinzel', serif !important;
}

.font-garamond {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
}

.font-playfair {
  font-family: 'Playfair Display', Georgia, serif !important;
}

/* Papel Editorial Nobre para Miolo */
.paper-editorial {
  background-color: #fbf9f5 !important;
  color: #1a1e24 !important;
  background-image: radial-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 0) !important;
  background-size: 20px 20px !important;
}

/* Sumário Vertical EbookGPT */
.vertical-toc-sidebar {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  letter-spacing: 0.25em;
  font-family: 'Cinzel', serif;
}

.display-mode-btn.active {
  background: #6366f1 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35) !important;
  border-color: #6366f1 !important;
}

/* Temas Visuais */
.theme-dark-gold {
  background: radial-gradient(circle at top right, #292524, #0c0a09 80%) !important;
  color: #ffffff !important;
}
.theme-modern-indigo {
  background: radial-gradient(circle at top right, #1e1b4b, #030712 80%) !important;
  color: #ffffff !important;
}
.theme-emerald-green {
  background: radial-gradient(circle at top right, #064e3b, #022c22 80%) !important;
  color: #ffffff !important;
}
.theme-clean-minimal {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 2px solid #e2e8f0 !important;
}

/* ======================================================== */
/* DESIGN SYSTEM: APPLE iOS STYLE (GLASSMORPHISM & LIQUID)  */
/* ======================================================== */

.ios-glass {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.ios-glass-card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.5);
  border-radius: 28px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(16, 185, 129, 0.3);
  background: rgba(255, 255, 255, 0.95);
}

.ios-segmented-control {
  background: rgba(118, 118, 128, 0.12);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 3px;
  display: inline-flex;
  position: relative;
}

.ios-segment-btn {
  padding: 6px 18px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  background: transparent;
  cursor: pointer;
}

.ios-segment-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}

/* iOS Apple Button */
.ios-btn-apple {
  background: #000000;
  color: #ffffff;
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.3);
}

.ios-btn-apple:hover {
  background: #1c1c1e;
  transform: scale(1.02);
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.4);
}

.ios-btn-apple:active {
  transform: scale(0.98);
}

/* iOS Toggle Switch */
.ios-toggle {
  width: 48px;
  height: 28px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-toggle.checked {
  background-color: #34c759; /* Apple signature green */
}

.ios-toggle-dot {
  width: 22px;
  height: 22px;
  background-color: #ffffff;
  border-radius: 9999px;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ios-toggle.checked .ios-toggle-dot {
  transform: translateX(20px);
}

/* iOS Ambient Intelligence Glow */
.ios-ambient-glow {
  position: absolute;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  height: 600px;
  background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.12) 0%, rgba(16, 185, 129, 0.08) 35%, rgba(244, 114, 182, 0.06) 65%, transparent 80%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* Apple-style floating mockup badge */
.ios-pill-badge {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-radius: 9999px;
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.animate-float-gentle {
  animation: floatGentle 5s ease-in-out infinite;
}

