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

body {
  font-family: 'Inter', sans-serif;
  user-select: none;
}

/* Chế độ đọc sách: Khóa chiều cao đúng 100vh để không bao giờ phải cuộn trang */
body.book-reading-mode {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body.book-reading-mode main {
  flex: 1 1 0%;
  min-height: 0;
  padding: 6px 12px !important;
}

/* Khung chứa tổng của Flipbook (hiển thị 1 trang vừa khít màn hình) */
#book-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  position: relative;
  padding: 0 64px;
}

#book-container.hidden {
  display: none !important;
}

/* ==========================================
   STRICT VISIBILITY & ROLE SEPARATION GUARDS
   Ngăn chặn triệt để xung đột giữa .hidden và .flex/.grid của Tailwind CDN
   và khóa cứng mọi phần tử Quản trị (.admin-only) ở chế độ Người dùng
   ========================================== */
.hidden,
[hidden] {
  display: none !important;
}

body:not(.setup-mode-active) .admin-only {
  display: none !important;
}

body:not(.admin-session-active) .admin-session-only {
  display: none !important;
}

@media (max-width: 767px) {
  #current-book-badge {
    display: none !important;
  }
}

.resp-sm-inline,
.resp-md-inline,
.resp-lg-inline {
  display: none;
}

@media (min-width: 640px) {
  .resp-sm-inline {
    display: inline;
  }
}

@media (min-width: 768px) {
  .resp-md-inline {
    display: inline;
  }
}

@media (min-width: 1024px) {
  .resp-lg-inline {
    display: inline;
  }
}

/* NÚT LẬT TRANG NỔI 2 BÊN SÁCH (Floating Nav Buttons - Không dùng hiệu ứng GPU) */
.floating-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid #475569;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  transition: background-color 0.15s ease, color 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.floating-nav-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #818cf8;
}

.floating-nav-btn.prev {
  left: 8px;
}

.floating-nav-btn.next {
  right: 8px;
}

/* Khóa cử chỉ lật khi đang ở chế độ vẽ nét hoặc biên soạn */
#book-container.drawing-active .stf__block,
#book-container.editor-active .stf__block {
  pointer-events: none !important;
  user-select: none;
}

#book-container.drawing-active .drawing-canvas {
  pointer-events: auto !important;
  touch-action: none !important;
  z-index: 50 !important;
  cursor: crosshair !important;
}

#book-container.editor-active .editor-draw-layer {
  pointer-events: auto !important;
  touch-action: none !important;
  z-index: 45 !important;
}

/* Đưa lớp điểm chạm âm thanh & ô mục tiêu sticker nổi lên trên lớp kéo vẽ khi ở chế độ Biên soạn để bấm xóa dễ dàng */
#book-container.editor-active .hotspots-overlay,
#book-container.editor-active .sticker-dropzones-container {
  z-index: 55 !important;
  pointer-events: none !important;
}

#book-container.editor-active .audio-hotspot,
#book-container.editor-active .sticker-target-zone {
  pointer-events: auto !important;
}

#book-container.editor-active .btn-delete-hotspot,
#book-container.editor-active .btn-delete-dropzone {
  z-index: 60 !important;
  pointer-events: auto !important;
}

#book-container.editor-active .sticker-layer {
  pointer-events: none !important;
}

#book-container.drawing-active .page,
#book-container.editor-active .page {
  pointer-events: auto !important;
  touch-action: none !important;
}

#book-container.drawing-active .hotspots-overlay,
#book-container.drawing-active .sticker-layer {
  pointer-events: none !important;
}

.floating-nav-btn:disabled,
.floating-nav-btn.disabled {
  opacity: 0.25 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* Căn giữa cho cuốn sách (luôn cố định khung 1 trang) */
#flipbook {
  margin: 0 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

#flipbook .stf__wrapper {
  width: 100% !important;
  height: 100% !important;
  padding-bottom: 0 !important;
}

/* Định dạng từng trang sách */
.page {
  background-color: #ffffff;
  position: relative;
  overflow: hidden;
}

/* Ảnh trang sách: Khớp 100% kích thước khung lật đã tính theo tỉ lệ thật */
.page img.page-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* ==========================================
   AUDIO HOTSPOTS STYLING
   ========================================== */
.audio-hotspot {
  z-index: 20;
}

.hotspot-box {
  background: rgba(99, 102, 241, 0.15);
  border: 2px dashed rgba(129, 140, 248, 0.7);
}

.hotspot-box.playing {
  background: rgba(16, 185, 129, 0.25) !important;
  border: 2px solid rgba(52, 211, 153, 0.9) !important;
}

.hotspot-box.playing span {
  background: #10B981 !important;
}

/* ==========================================
   STICKERS STYLING & SNAPPING
   ========================================== */
.sticker-target-zone {
  border: 2px dashed rgba(245, 158, 11, 0.7);
  background-color: rgba(245, 158, 11, 0.1);
}

.placed-sticker {
  user-select: none;
}

.placed-sticker.snapped {
  outline: 2px solid #10b981;
  border-radius: 12px;
}

/* ==========================================
   DRAWING CANVAS (ADMIN BASE LAYER + USER LAYER)
   ========================================== */
.sticker-dropzones-container {
  z-index: 15;
}

.hotspots-overlay {
  z-index: 20;
}

.sticker-layer {
  z-index: 25;
}

.admin-drawing-canvas {
  z-index: 28;
  width: 100% !important;
  height: 100% !important;
  left: 0;
  top: 0;
  pointer-events: none !important;
  touch-action: none;
}

.drawing-canvas {
  z-index: 30;
  width: 100% !important;
  height: 100% !important;
  left: 0;
  top: 0;
  touch-action: none;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #0f172a;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #4f46e5;
  border-radius: 9999px;
}

/* Trang đang được chọn thao tác trong chế độ 2 trang */
.page.active-target-page {
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.5);
}

/* Nút xóa trong Editor Mode */
.btn-delete-hotspot,
.btn-delete-dropzone {
  cursor: pointer;
  pointer-events: auto !important;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-delete-hotspot:hover,
.btn-delete-dropzone:hover {
  transform: scale(1.18);
}

/* ==========================================
   NATIVE MODAL DIALOGS (Admin Login & Reset)
   ========================================== */
dialog:modal {
  overscroll-behavior: contain;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  max-width: min(28rem, calc(100vw - 2rem));
  width: 100%;
}

dialog::backdrop {
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  overflow: hidden;
  overscroll-behavior: contain;
}

/* ==========================================================================
   THEME SWITCHER (SUN / MOON) & LIGHT THEME SYSTEM (DEFAULT: LIGHT)
   ========================================================================== */
.theme-switcher .theme-option-btn {
  color: #94a3b8;
}

.theme-switcher .theme-option-btn:hover {
  color: #f8fafc;
}

.theme-switcher .theme-option-btn[data-theme-option="dark"].is-active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}

.theme-switcher .theme-option-btn[data-theme-option="light"].is-active {
  background: #ffffff;
  color: #b45309;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.theme-switcher .theme-option-btn[data-theme-option="light"].is-active i {
  color: #f59e0b;
}

/* ---------------- GIAO DIỆN SÁNG (LIGHT MODE) ---------------- */
html[data-theme="light"] body {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%) !important;
  color: #0f172a !important;
}

/* Header & Thương hiệu */
html[data-theme="light"] header {
  background-color: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(10px);
  border-bottom-color: #e2e8f0 !important;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] #btn-home h1 {
  background-image: linear-gradient(to right, #4f46e5, #7c3aed, #db2777) !important;
}

html[data-theme="light"] #app-role-subtitle.text-slate-400 {
  color: #64748b !important;
}

html[data-theme="light"] #app-role-subtitle.text-amber-300 {
  color: #b45309 !important;
}

html[data-theme="light"] #app-role-subtitle.text-emerald-300 {
  color: #047857 !important;
}

/* Huy hiệu sách đang mở & Trạng thái trên Header */
html[data-theme="light"] #current-book-badge {
  background-color: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: #3730a3 !important;
}

html[data-theme="light"] #current-book-badge > i {
  color: #4f46e5 !important;
}

html[data-theme="light"] #btn-header-publish-toggle.text-emerald-300 {
  background-color: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
  color: #047857 !important;
}

html[data-theme="light"] #btn-header-publish-toggle.text-emerald-300:hover {
  background-color: #d1fae5 !important;
}

html[data-theme="light"] #btn-header-publish-toggle.text-amber-200 {
  background-color: #fffbeb !important;
  border-color: #fbbf24 !important;
  color: #b45309 !important;
}

html[data-theme="light"] #btn-header-publish-toggle.text-amber-200:hover {
  background-color: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

html[data-theme="light"] #editor-mode-badge {
  background-color: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}

/* Cụm nút công cụ tương tác trên Header */
html[data-theme="light"] #interactive-controls {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] #btn-toggle-hotspots {
  color: #4f46e5 !important;
}

html[data-theme="light"] #btn-toggle-hotspots:hover {
  background-color: #e0e7ff !important;
  color: #3730a3 !important;
}

html[data-theme="light"] #btn-toggle-draw:not(.bg-indigo-600),
html[data-theme="light"] #btn-toggle-stickers:not(.bg-indigo-600),
html[data-theme="light"] #btn-toggle-editor:not(.bg-amber-600) {
  background-color: #ffffff !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] #btn-toggle-draw:not(.bg-indigo-600):hover,
html[data-theme="light"] #btn-toggle-stickers:not(.bg-indigo-600):hover,
html[data-theme="light"] #btn-toggle-editor:not(.bg-amber-600):hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] #btn-toggle-draw:not(.bg-indigo-600) i {
  color: #d97706 !important;
}

html[data-theme="light"] #btn-toggle-stickers:not(.bg-indigo-600) i {
  color: #059669 !important;
}

html[data-theme="light"] #btn-toggle-editor:not(.bg-amber-600) i {
  color: #7c3aed !important;
}

html[data-theme="light"] #btn-reset-user-work {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}

html[data-theme="light"] #btn-reset-user-work:hover {
  background-color: #e11d48 !important;
  color: #ffffff !important;
}

/* Nút Lưu / Tủ sách / Theme Switcher / Admin Controls */
html[data-theme="light"] #btn-save-book-changes:not(.bg-emerald-600):not(.bg-emerald-700\/80) {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] #btn-save-book-changes:not(.bg-emerald-600):not(.bg-emerald-700\/80):hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-theme="light"] #btn-show-library {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

html[data-theme="light"] #btn-show-library:hover {
  background-color: #eef2ff !important;
  border-color: #a5b4fc !important;
  color: #3730a3 !important;
}

html[data-theme="light"] #btn-show-library i {
  color: #6366f1 !important;
}

html[data-theme="light"] .theme-switcher {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .theme-switcher .theme-option-btn {
  color: #64748b;
}

html[data-theme="light"] .theme-switcher .theme-option-btn:hover {
  color: #0f172a;
}

html[data-theme="light"] #btn-preview-user {
  background-color: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
  color: #047857 !important;
}

html[data-theme="light"] #btn-preview-user:hover {
  background-color: #d1fae5 !important;
}

html[data-theme="light"] #btn-admin-logout {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] #btn-admin-logout:hover {
  background-color: #e11d48 !important;
  border-color: #e11d48 !important;
  color: #ffffff !important;
}

/* Thanh công cụ Vẽ (Drawing Sub-Toolbar) */
html[data-theme="light"] #drawing-toolbar {
  background-color: #ffffff !important;
  border-bottom-color: #c7d2fe !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] #drawing-toolbar > div:first-child {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] #drawing-toolbar [data-draw-tool]:not(.bg-indigo-600) {
  color: #334155 !important;
}

html[data-theme="light"] #drawing-toolbar [data-draw-tool]:not(.bg-indigo-600):hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] #drawing-toolbar [data-draw-tool="highlighter"]:not(.bg-indigo-600) i {
  color: #d97706 !important;
}

html[data-theme="light"] #drawing-toolbar [data-draw-tool="eraser"]:not(.bg-indigo-600) i {
  color: #e11d48 !important;
}

html[data-theme="light"] #drawing-toolbar [data-color].ring-white {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #4f46e5 !important;
}

html[data-theme="light"] #drawing-toolbar span.text-slate-400 {
  color: #475569 !important;
}

html[data-theme="light"] #draw-size-slider {
  background-color: #cbd5e1 !important;
}

html[data-theme="light"] #draw-size-val {
  color: #1e293b !important;
}

html[data-theme="light"] #drawing-toolbar .border-slate-700 {
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] #btn-draw-undo,
html[data-theme="light"] #btn-draw-redo {
  background-color: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] #btn-draw-undo:hover,
html[data-theme="light"] #btn-draw-redo:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] #btn-draw-clear {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}

html[data-theme="light"] #btn-draw-clear:hover {
  background-color: #ffe4e6 !important;
}

/* Kệ sách, Thẻ sách, Hộp Upload & Màn hình Loading */
html[data-theme="light"] #library-section h2 {
  color: #0f172a !important;
}

html[data-theme="light"] #library-section h2 i {
  color: #4f46e5 !important;
}

html[data-theme="light"] #library-subtitle {
  color: #475569 !important;
}

html[data-theme="light"] #library-admin-stats .text-emerald-300 {
  background-color: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
  color: #047857 !important;
}

html[data-theme="light"] #library-admin-stats .text-amber-300 {
  background-color: #fffbeb !important;
  border-color: #fbbf24 !important;
  color: #b45309 !important;
}

html[data-theme="light"] .book-library-card {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] .book-library-card:hover {
  border-color: #6366f1 !important;
  box-shadow: 0 16px 32px rgba(79, 70, 229, 0.14) !important;
}

html[data-theme="light"] .book-library-card.is-draft-card {
  border-color: #f59e0b !important;
}

html[data-theme="light"] .book-cover-wrap {
  background-color: #f1f5f9 !important;
}

html[data-theme="light"] .book-cover-fade {
  background-image: linear-gradient(to top, rgba(15, 23, 42, 0.5) 0%, transparent 55%) !important;
  opacity: 1 !important;
}

html[data-theme="light"] .book-card-title {
  color: #0f172a !important;
}

html[data-theme="light"] .book-library-card:hover .book-card-title {
  color: #4f46e5 !important;
}

html[data-theme="light"] .book-library-card .text-indigo-400 {
  color: #4f46e5 !important;
}

html[data-theme="light"] .book-library-card .btn-toggle-publish-card.bg-slate-800 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .book-library-card .btn-toggle-publish-card.bg-slate-800:hover {
  background-color: #fffbeb !important;
  border-color: #f59e0b !important;
  color: #b45309 !important;
}

html[data-theme="light"] .book-library-card .btn-delete-book {
  background-color: rgba(255, 255, 255, 0.92) !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .book-library-card .btn-delete-book:hover {
  background-color: #e11d48 !important;
  border-color: #e11d48 !important;
  color: #ffffff !important;
}

html[data-theme="light"] #empty-library-state {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] #empty-library-state h3 {
  color: #0f172a !important;
}

html[data-theme="light"] #empty-library-state p {
  color: #475569 !important;
}

html[data-theme="light"] #btn-refresh-library {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

html[data-theme="light"] #btn-refresh-library:hover {
  background-color: #eef2ff !important;
  border-color: #a5b4fc !important;
  color: #3730a3 !important;
}

html[data-theme="light"] #upload-box {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.07) !important;
}

html[data-theme="light"] #upload-box:hover {
  border-color: #6366f1 !important;
  background-color: #fafaff !important;
}

html[data-theme="light"] #upload-box h2 {
  color: #0f172a !important;
}

html[data-theme="light"] #upload-box p {
  color: #475569 !important;
}

html[data-theme="light"] #upload-box strong.text-amber-300 {
  color: #b45309 !important;
}

html[data-theme="light"] #upload-box strong.text-emerald-300 {
  color: #047857 !important;
}

html[data-theme="light"] #loading {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] #loading-status {
  color: #0f172a !important;
}

html[data-theme="light"] #loading > div.bg-slate-800 {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] #progress-text {
  color: #4f46e5 !important;
}

/* Khung đọc sách & Nút lật nổi 2 bên */
html[data-theme="light"] #flipbook {
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
  border: 1px solid #cbd5e1;
}

html[data-theme="light"] .floating-nav-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .floating-nav-btn:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

/* Khay Hình dán (Sticker Dock) */
html[data-theme="light"] #sticker-dock {
  background-color: #ffffff !important;
  border-left-color: #e2e8f0 !important;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] #sticker-dock .border-slate-800 {
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] #sticker-dock h3 {
  color: #059669 !important;
}

html[data-theme="light"] #sticker-dock-subtitle,
html[data-theme="light"] #sticker-count-badge {
  color: #64748b !important;
}

html[data-theme="light"] #btn-close-sticker-dock {
  color: #64748b !important;
}

html[data-theme="light"] #btn-close-sticker-dock:hover {
  color: #0f172a !important;
}

html[data-theme="light"] #sticker-upload-status {
  background-color: #eef2ff !important;
  border-color: #c7d2fe !important;
  color: #3730a3 !important;
}

html[data-theme="light"] #btn-clear-sticker-assets {
  color: #e11d48 !important;
}

html[data-theme="light"] .sticker-tray-item {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .sticker-tray-item:hover {
  background-color: #eef2ff !important;
  border-color: #6366f1 !important;
}

html[data-theme="light"] .sticker-tray-item span {
  color: #1e293b !important;
}

html[data-theme="light"] .sticker-tray-item .btn-remove-dock-sticker {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}

html[data-theme="light"] .sticker-tray-item .btn-remove-dock-sticker:hover {
  background-color: #e11d48 !important;
  border-color: #e11d48 !important;
  color: #ffffff !important;
}

html[data-theme="light"] #sticker-dock-items > div.col-span-2 {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}

html[data-theme="light"] .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #94a3b8;
}

html[data-theme="light"] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

/* Footer Điều hướng dưới cùng */
html[data-theme="light"] footer#controls {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-top-color: #e2e8f0 !important;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] #btn-prev,
html[data-theme="light"] #btn-next {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] #btn-prev:hover,
html[data-theme="light"] #btn-next:hover {
  background-color: #eef2ff !important;
  border-color: #a5b4fc !important;
  color: #4f46e5 !important;
}

html[data-theme="light"] footer#controls > div:nth-child(2) {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] footer#controls span.text-slate-400 {
  color: #475569 !important;
}

html[data-theme="light"] #page-input {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] #total-pages {
  color: #0f172a !important;
}

html[data-theme="light"] #btn-sound-toggle.text-indigo-400 {
  color: #4f46e5 !important;
}

html[data-theme="light"] #btn-fullscreen {
  color: #475569 !important;
}

html[data-theme="light"] #btn-fullscreen:hover {
  color: #0f172a !important;
}

/* Hộp thoại Dialog, Modal Biên soạn, Modal Xóa sách, Mini Player & Toast */
html[data-theme="light"] dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

html[data-theme="light"] dialog > div,
html[data-theme="light"] #delete-book-modal > div,
html[data-theme="light"] #hotspot-modal > div {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18) !important;
}

html[data-theme="light"] dialog h1,
html[data-theme="light"] #delete-book-modal h3,
html[data-theme="light"] #hotspot-modal h3 {
  color: #0f172a !important;
}

html[data-theme="light"] #hotspot-modal h3 i {
  color: #4f46e5 !important;
}

html[data-theme="light"] dialog p.text-slate-400,
html[data-theme="light"] #delete-modal-book-meta,
html[data-theme="light"] #hotspot-modal label.text-slate-400 {
  color: #475569 !important;
}

html[data-theme="light"] dialog strong.text-slate-200 {
  color: #0f172a !important;
}

html[data-theme="light"] dialog label,
html[data-theme="light"] #hotspot-modal label.text-slate-300 {
  color: #334155 !important;
}

html[data-theme="light"] dialog input,
html[data-theme="light"] #hotspot-modal input[type="text"],
html[data-theme="light"] #hotspot-modal select {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] dialog .border-slate-800,
html[data-theme="light"] #delete-book-modal .border-slate-800,
html[data-theme="light"] #hotspot-modal .border-slate-700,
html[data-theme="light"] #hotspot-modal .border-slate-700\/80 {
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] #hotspot-modal .bg-slate-900 {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

html[data-theme="light"] #hotspot-modal #tab-type-audio:not(.bg-indigo-600),
html[data-theme="light"] #hotspot-modal #tab-type-sticker:not(.bg-amber-600) {
  color: #475569 !important;
}

html[data-theme="light"] #btn-cancel-admin-login,
html[data-theme="light"] #reset-work-dialog button[value="cancel"],
html[data-theme="light"] #app-confirm-cancel-btn,
html[data-theme="light"] #btn-cancel-delete-book,
html[data-theme="light"] #btn-cancel-hotspot {
  background-color: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] #btn-cancel-admin-login:hover,
html[data-theme="light"] #reset-work-dialog button[value="cancel"]:hover,
html[data-theme="light"] #app-confirm-cancel-btn:hover,
html[data-theme="light"] #btn-cancel-delete-book:hover,
html[data-theme="light"] #btn-cancel-hotspot:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] #btn-close-admin-dialog,
html[data-theme="light"] #modal-close {
  color: #64748b !important;
}

html[data-theme="light"] #btn-close-admin-dialog:hover,
html[data-theme="light"] #modal-close:hover {
  color: #0f172a !important;
}

html[data-theme="light"] #delete-modal-book-name {
  color: #4f46e5 !important;
}

html[data-theme="light"] #delete-book-modal .text-rose-200\/90 {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #9f1239 !important;
}

html[data-theme="light"] #audio-mini-player {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-color: #c7d2fe !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
}

html[data-theme="light"] #mini-player-title {
  color: #0f172a !important;
}

html[data-theme="light"] #mini-player-time {
  color: #64748b !important;
}

html[data-theme="light"] #audio-mini-player .bg-slate-700 {
  background-color: #e2e8f0 !important;
}

html[data-theme="light"] #mini-player-stop {
  background-color: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] #mini-player-stop:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .app-toast {
  background-color: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .app-toast-success {
  border-color: #6ee7b7 !important;
  color: #065f46 !important;
}

html[data-theme="light"] .app-toast-error {
  border-color: #fda4af !important;
  color: #9f1239 !important;
}

html[data-theme="light"] .app-toast-info {
  border-color: #c7d2fe !important;
  color: #1e293b !important;
}
