/* ==========================================================================
   admin.css - Admin Dashboard & Parental Gate Styles
   Modern, sleek, glassmorphic admin drawer with rich form controls,
   file upload previews, dynamic story page builder, and shelf manager
   ========================================================================== */

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

:root {
  --admin-font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --admin-font-body: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#admin-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(8, 12, 22, 0.90);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#admin-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-window {
  width: 96vw;
  max-width: 1560px;
  height: 94vh;
  max-height: 94vh;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(59, 130, 246, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--admin-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transform: translateZ(0);
  backface-visibility: hidden;
  animation: adminFadeIn 0.25s ease-out;
  transition: all 0.25s ease;
}

.admin-window.is-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

@keyframes adminFadeIn {
  0% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Admin Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.admin-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.admin-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.admin-heading {
  font-family: var(--admin-font-heading);
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

.admin-subheading {
  font-family: var(--admin-font-body);
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

.admin-action-btn, .admin-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-action-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border-color: #3b82f6;
}

.admin-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-color: #ef4444;
}

/* Admin Navigation Tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.admin-tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  font-family: var(--admin-font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: all 0.2s ease;
  -webkit-font-smoothing: antialiased;
  text-shadow: none;
}

.admin-tab-btn.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Admin Content Body */
.admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: none;
}

.admin-tab-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.admin-tab-pane.active {
  display: flex;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  font-family: var(--admin-font-body);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: text;
  -webkit-font-smoothing: antialiased;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Image Upload & Preview Zone */
.cover-picker-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 4px;
}

.cover-preview-thumbnail {
  width: 90px;
  height: 130px;
  border-radius: 8px;
  background: #1e293b;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.cover-preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-options {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

.upload-file-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Page Builder for Admin Story Books */
.pages-builder-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-item-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.page-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-badge-num {
  font-family: var(--admin-font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #f59e0b;
  -webkit-font-smoothing: antialiased;
}

.btn-remove-page {
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-add-page {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px dashed #3b82f6;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--admin-font-heading);
  font-size: 14px;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

.btn-add-page:hover {
  background: rgba(59, 130, 246, 0.25);
}

/* Save Form Action Buttons */
.form-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary-save {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--admin-font-heading);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  -webkit-font-smoothing: antialiased;
}

.btn-primary-save:hover {
  transform: scale(1.03);
}

/* Manage Books Table / Grid */
.books-manage-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  gap: 16px;
}

.book-row-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.book-row-thumb {
  width: 44px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
}

.book-row-details {
  display: flex;
  flex-direction: column;
}

.book-row-title {
  font-family: var(--admin-font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

.book-row-meta {
  font-size: 12px;
  color: #94a3b8;
  font-family: var(--admin-font-body);
}

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

.btn-row-action {
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  transition: all 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

.btn-row-action:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
}

.btn-row-delete:hover {
  background: #ef4444;
  color: #fff;
}

/* Parental Gate Modal */
#parental-gate-modal .gate-card {
  background: #0f172a;
  border: 2px solid #3b82f6;
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(59, 130, 246, 0.3);
}

.gate-question {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: #fef08a;
  margin: 16px 0;
}

.gate-input {
  width: 140px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid #3b82f6;
  background: #1e293b;
  color: #ffffff;
  margin-bottom: 20px;
}

/* ==========================================================================
   ADVANCED WYSIWYG FREEFORM CANVAS CREATOR STYLES
   ========================================================================== */
.canvas-editor-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
  min-height: 700px;
  height: 100%;
  align-items: stretch;
}

@media (max-width: 960px) {
  .canvas-editor-layout {
    grid-template-columns: 1fr;
  }
}

.canvas-sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
  flex-shrink: 0;
  max-height: calc(94vh - 200px);
  overflow-y: auto;
}

.admin-window.is-fullscreen .canvas-sidebar {
  max-height: calc(100vh - 160px);
}

.canvas-stage-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  position: relative;
  min-width: 320px;
  overflow: auto;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.canvas-stage-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.canvas-badge-info {
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-font-smoothing: antialiased;
}

.canvas-badge-info span {
  color: #f59e0b;
}

.canvas-zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.canvas-zoom-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.canvas-zoom-btn:hover {
  background: #3b82f6;
  color: #fff;
}

.canvas-zoom-text {
  font-family: var(--admin-font-heading);
  font-size: 12px;
  font-weight: 700;
  color: #60a5fa;
  min-width: 44px;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

#canvas-editor-container {
  position: relative;
  display: inline-block;
  margin: 10px auto;
  transition: transform 0.15s ease-out;
  transform-origin: top center;
}

#canvas-stage {
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 8px #78350f, 0 0 0 12px #451a03;
  border-radius: 12px;
  user-select: none;
  overflow: hidden;
  transition: background-color 0.2s ease;
}

/* Subtle Grid Background when active */
#canvas-stage.grid-active {
  background-image: none !important;
}
#canvas-stage.grid-active::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background-image: linear-gradient(to right, rgba(86,62,139,.32) var(--grid-line-width, 1px), transparent var(--grid-line-width, 1px)), linear-gradient(to bottom, rgba(86,62,139,.32) var(--grid-line-width, 1px), transparent var(--grid-line-width, 1px));
  background-size: 20px 20px;
}

/* ==========================================================================
   DYNAMIC SNAPPING GUIDELINES (Magenta/Cyan Alignment Guides)
   ========================================================================== */
.canvas-guide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.canvas-snap-guide {
  position: absolute;
  pointer-events: none;
}

.canvas-snap-guide.guide-v {
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ec4899;
  box-shadow: 0 0 6px #ec4899;
  border-left: 1.5px dashed #f43f5e;
}

.canvas-snap-guide.guide-h {
  left: 0;
  right: 0;
  height: 2px;
  background: #ec4899;
  box-shadow: 0 0 6px #ec4899;
  border-top: 1.5px dashed #f43f5e;
}

/* ==========================================================================
   FREEFORM MANEUVERABLE ELEMENT & 8-POINT BOUNDING TRANSFORM BOX
   ========================================================================== */
.canvas-element-wrap {
  position: absolute;
  cursor: move;
  user-select: none;
  touch-action: none;
  box-sizing: border-box;
}

.canvas-element-wrap.selected {
  outline: 2px solid #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.canvas-element-wrap.editing-inline {
  outline: 2px dashed #f59e0b;
  cursor: text;
}

.canvas-text-node {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  user-select: none;
  word-break: break-word;
}

.canvas-element-wrap.editing-inline .canvas-text-node {
  user-select: text;
  outline: none;
}

.canvas-image-node {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* 8-Point Resize Handles */
.canvas-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 2px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.handle-n  { top: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.handle-e  { top: calc(50% - 5px); right: -6px; cursor: ew-resize; }
.handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.handle-s  { bottom: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.handle-w  { top: calc(50% - 5px); left: -6px; cursor: ew-resize; }

/* Rotation Stalk Handle */
.canvas-rotation-stalk {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 2px;
  height: 20px;
  background: #3b82f6;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 99;
}

.handle-rotation {
  position: absolute;
  top: -36px;
  left: calc(50% - 11px);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 105;
}

.handle-rotation:active {
  cursor: grabbing;
}

/* Quick Action Delete Badge */
.canvas-quick-action-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  z-index: 110;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.canvas-quick-action-badge:hover {
  transform: scale(1.15);
}

/* Shapes Buttons Grid */
.canvas-shapes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.canvas-shape-btn {
  padding: 8px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

.canvas-shape-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

/* Sticker Grid */
.canvas-sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.canvas-sticker-btn {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-bounce), background 0.15s ease;
}

.canvas-sticker-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.canvas-sticker-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Page Thumbnails Strip */
.canvas-page-thumb {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

.canvas-page-thumb.active {
  background: #f59e0b;
  color: #fff;
  border-color: #fef08a;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.4);
}

/* Toolbar active toggle button style */
.btn-toolbar-toggle.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
}

/* Crisp Section & Inspector Titles in Admin Sidebar */
.admin-section-heading {
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: -0.01em;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-inspector-heading {
  font-family: var(--admin-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #60a5fa;
  letter-spacing: -0.01em;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  margin-bottom: 8px;
}

/* ==========================================================================
   TODDLER CANVAS CREATOR - AUTOMATIC VS MANUAL MODE STYLES
   ========================================================================== */
.canvas-mode-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.canvas-mode-toggle-group {
  display: inline-flex;
  background: #090d16;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
}

.canvas-mode-pill-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--admin-font-heading);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.canvas-mode-pill-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.canvas-mode-pill-btn.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.canvas-mode-pill-btn.btn-auto.active {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(236, 72, 153, 0.45);
}

/* AI Automatic Storybook Panel */
.canvas-auto-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.25s ease;
}

.canvas-auto-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.canvas-auto-card.highlight {
  border-color: rgba(168, 85, 247, 0.4);
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.4) 0%, rgba(15, 23, 42, 0.65) 100%);
}

.auto-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #38bdf8;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.auto-quick-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auto-quick-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: #f59e0b;
}

.auto-page-chip {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.auto-page-chip.cover-chip {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
}

.auto-page-chip .chip-words {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-weight: 700;
}

.auto-page-chip .chip-words.warning {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Package availability active badge */
.package-avail-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}



