/* Reader Footer Navigation Styles */

/* Global Mobile Scroll Bar Hiding */
@media (max-width: 768px) {
  * {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
  }

  *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Ensure black background for all mobile areas */
  html,
  body {
    background: #000000 !important;
  }

  /* Mobile viewport black background */
  body.reader-mode {
    background: #000000 !important;
    min-height: 100vh !important;
  }

  /* Fix any white corner areas around footer */
  .reader-footer {
    background: #000000 !important;
  }
}

/* Floating Header Styles */
.floating-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  background: black; /* Changed from transparent to black */
  transition:
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
  will-change: transform;
  width: calc(100% - 40px);
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

.floating-header.hidden {
  transform: translateX(-50%) translateY(-100%);
  opacity: 0;
}

.floating-header-content {
  padding: 15px 0;
}

.floating-header-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.floating-header-image {
  max-height: 80px;
  width: auto;
  object-fit: contain;
  transition: max-height 0.3s ease;
  margin-bottom: 3px;
}

.floating-header-text {
  width: 100%;
  background: transparent;
  position: relative;
}

.floating-header-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 10px;
}

.floating-header-title {
  margin: 0;
  padding: 0;
  font-size: 1.5rem;
  color: fuchsia;
  background: transparent;
  text-align: left;
  flex: 1;
  line-height: 1.2;
  font-family: inherit; /* Use same font family as chapter indicator */
  font-weight: bold; /* Make title bold */
}

.floating-header-chapter {
  background: transparent;
  text-align: right;
  flex-shrink: 0;
  margin-top: 0;
}

.floating-header-chapter .chapter-indicator {
  color: fuchsia;
  font-size: 0.9rem;
  opacity: 0.9;
  font-family: inherit; /* Ensure same font family */
  font-weight: bold; /* Make chapter indicator bold */
}

/* Dark theme support for floating header - all themes use fuchsia text */
body.reader-mode[data-theme="dark"] .floating-header,
body.reader-mode[data-theme="sepia"] .floating-header {
  background: black;
}

body.reader-mode[data-theme="dark"] .floating-header-title,
body.reader-mode[data-theme="dark"] .floating-header-chapter .chapter-indicator,
body.reader-mode[data-theme="sepia"] .floating-header-title,
body.reader-mode[data-theme="sepia"]
  .floating-header-chapter
  .chapter-indicator {
  color: fuchsia;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  .floating-header {
    width: calc(100% - 30px);
    max-width: calc(100% - 30px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0 15px;
    /* iPhone X notch support - position header below notch */
    top: max(20px, env(safe-area-inset-top, 0px));
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .floating-header.hidden {
    transform: translateX(-50%)
      translateY(calc(-100% - max(20px, env(safe-area-inset-top, 0px))));
  }

  .floating-header-content {
    padding: 10px 0;
  }

  .floating-header-image {
    max-height: 70px; /* Increased from 45px to show full header image proportionally */
    margin-bottom: 2px;
    width: 100%;
    object-fit: contain;
  }

  .floating-header-title {
    font-size: 1.3rem;
  }

  .floating-header-chapter .chapter-indicator {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .floating-header {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    padding: 0 10px;
  }

  .floating-header-content {
    padding: 8px 0;
  }

  .floating-header-image {
    max-height: 60px; /* Increased from 38px to show full header image proportionally */
    margin-bottom: 2px;
    width: 100%;
    object-fit: contain;
  }

  .floating-header-title {
    font-size: 1.1rem;
  }

  .floating-header-chapter .chapter-indicator {
    font-size: 0.75rem;
  }
}

/* Ensure reader content starts below floating header */
.reader-container {
  padding-top: 150px;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 768px) {
  .reader-container {
    padding-top: 90px !important; /* Dramatically reduced from 150px to eliminate white space */
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .reader-container {
    padding-top: 85px !important; /* Dramatically reduced from 140px to eliminate white space */
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    width: 100% !important;
  }
}

/* Hide the original reader header since we moved content to floating header */
.reader-header {
  display: none;
}

.reader-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  padding: 10px 20px;
  background: #000000; /* Changed back to black - fuchsia was too intense for reading */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
  will-change: transform;
}

.reader-footer.hidden {
  transform: translateY(100%);
  opacity: 0;
}

.reader-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 auto;
}

.reader-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reader-nav-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #ff1493;
}

.reader-nav-btn:active {
  transform: translateY(0);
}

.reader-nav-btn svg {
  pointer-events: none;
}

/* Specific button styling */
.reader-nav-home {
  background: rgba(255, 20, 147, 0.1);
  border-color: #ff1493;
  color: #ff1493;
}

.reader-nav-home:hover {
  background: rgba(255, 20, 147, 0.2);
}

.reader-nav-prev,
.reader-nav-next {
  background: rgba(0, 123, 255, 0.1);
  border-color: #007bff;
  color: #007bff;
}

.reader-nav-prev:hover,
.reader-nav-next:hover {
  background: rgba(0, 123, 255, 0.2);
  color: #0056b3;
}

.reader-nav-close {
  background: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
  color: #dc3545;
}

.reader-nav-close:hover {
  background: rgba(220, 53, 69, 0.2);
  color: #c82333;
}

/* Chapter indicator */
.chapter-info {
  text-align: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #666;
}

/* Hide original floating elements */
.reader-appearance-toggle {
  display: none !important;
}

/* Update appearance panel position for footer usage */
#reader-appearance-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  transform-origin: bottom center;
}

/* Contents menu positioning for footer */
.reader-nav-contents-menu {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  max-height: 60vh;
  overflow-y: auto;
}

/* Theme-specific footer styling */

/* Light theme */
body.reader-mode[data-theme="light"] .reader-footer {
  background: #000000; /* Changed back to black - fuchsia was too intense */
  border-top-color: rgba(0, 0, 0, 0.1);
}

body.reader-mode[data-theme="light"] .reader-nav-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: #333;
}

/* Sepia theme */
body.reader-mode[data-theme="sepia"] .reader-footer {
  background: #000000; /* Changed back to black - fuchsia was too intense */
  border-top-color: rgba(92, 78, 55, 0.2);
}

body.reader-mode[data-theme="sepia"] .reader-nav-btn {
  background: rgba(245, 232, 209, 0.9);
  border-color: rgba(92, 78, 55, 0.2);
  color: #5c4e37;
}

body.reader-mode[data-theme="sepia"] .reader-nav-btn:hover {
  background: rgba(245, 232, 209, 1);
  color: #4a6741;
}

/* Dark theme */
body.reader-mode[data-theme="dark"] .reader-footer {
  background: #000000; /* Changed back to black - fuchsia was too intense */
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.reader-mode[data-theme="dark"] .reader-nav-btn {
  background: rgba(40, 40, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
}

body.reader-mode[data-theme="dark"] .reader-nav-btn:hover {
  background: rgba(50, 50, 50, 1);
  color: #ff6fb5;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .reader-footer {
    padding: 8px 12px;
  }

  .reader-nav {
    gap: 6px;
  }

  .reader-nav-btn {
    width: 40px;
    height: 40px;
  }

  .reader-nav-btn svg {
    width: 18px;
    height: 18px;
  }

  .reader-nav-contents-menu {
    bottom: 70px;
    max-width: 90vw;
  }

  #reader-appearance-panel {
    bottom: 70px;
    right: 10px;
    max-width: 90vw;
  }

  /* Mobile: Ensure dark theme content areas have black background */
  body.reader-mode[data-theme="dark"] .reader-content,
  body.reader-mode[data-theme="dark"] .reader-container,
  body.reader-mode[data-theme="dark"] main,
  body.reader-mode[data-theme="dark"] .content-wrapper,
  body.reader-mode[data-theme="dark"] .main-content {
    background: #1a1a1a !important;
  }
}

@media (max-width: 480px) {
  .reader-footer {
    padding: 6px 8px;
  }

  .reader-nav {
    gap: 4px;
  }

  .reader-nav-btn {
    width: 36px;
    height: 36px;
  }

  .reader-nav-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Mobile small screens: Dark theme background coverage */
  body.reader-mode[data-theme="dark"] .reader-content,
  body.reader-mode[data-theme="dark"] .reader-container,
  body.reader-mode[data-theme="dark"] main,
  body.reader-mode[data-theme="dark"] .content-wrapper,
  body.reader-mode[data-theme="dark"] .main-content,
  body.reader-mode[data-theme="dark"] .prose {
    background: #1a1a1a !important;
  }
}

/* Scroll-based footer hiding */
.reader-footer.scroll-hide {
  animation: slideDown 0.3s ease-out;
}

.reader-footer.scroll-show {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Add padding to content to account for footer */
.reader-content {
  padding-bottom: 100px; /* Space for footer */
}

/* Ensure header spacing */
.reader-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.reader-mode[data-theme="sepia"] .reader-header {
  border-bottom-color: rgba(92, 78, 55, 0.2);
}

body.reader-mode[data-theme="dark"] .reader-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Interactive Footer Functionality */
.reader-footer-navigation.interactive-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
  will-change: transform;
  opacity: 1;
  width: calc(100% - 40px);
  max-width: 760px;
  margin: 0 auto;
}

.reader-footer-navigation.interactive-footer.hidden {
  transform: translateX(-50%) translateY(100%);
  opacity: 0;
}

/* Footer Buttons Layout */
.reader-footer-buttons {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 15px;
  max-width: 600px;
  margin: 0 auto;
  gap: 5px;
}

.reader-footer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 50px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
  padding: 5px;
  text-decoration: none;
}

.reader-footer-btn:hover {
  background: rgba(255, 20, 147, 0.1);
  color: #ff1493;
  transform: translateY(-2px);
}

.reader-footer-btn:active {
  transform: translateY(0);
}

.reader-footer-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.reader-footer-btn.disabled:hover {
  background: transparent;
  color: #333;
  transform: none;
}

.reader-footer-btn svg {
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.reader-footer-btn span {
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

/* Footer Menu Popups - Position Above Footer */
.footer-menu-popup {
  position: fixed;
  bottom: 70px; /* Position above footer */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 90vw;
  width: 400px;
  max-height: 50vh;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.footer-menu-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* Contents Popup Specific Styles */
.reader-contents-popup .reader-contents-content {
  padding: 20px;
}

.reader-contents-popup .reader-contents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.reader-contents-popup .reader-contents-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.reader-contents-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.reader-contents-close:hover {
  background: rgba(255, 20, 147, 0.1);
  color: #ff1493;
}

.reader-contents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reader-contents-item {
  display: block;
  padding: 12px 15px;
  text-decoration: none;
  color: #333;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.reader-contents-item:hover {
  background: rgba(255, 20, 147, 0.1);
  color: #ff1493;
  border-color: rgba(255, 20, 147, 0.2);
}

.reader-contents-item.active {
  background: rgba(255, 20, 147, 0.15);
  color: #ff1493;
  border-color: rgba(255, 20, 147, 0.3);
  font-weight: 500;
}

/* Appearance Popup Specific Styles */
.reader-appearance-popup .reader-appearance-content {
  padding: 20px;
}

.reader-appearance-popup .reader-appearance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.reader-appearance-popup .reader-appearance-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

.reader-appearance-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.reader-appearance-close:hover {
  background: rgba(255, 20, 147, 0.1);
  color: #ff1493;
}

.reader-appearance-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.appearance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.appearance-row label {
  font-weight: 500;
  color: #333;
}

.font-size-buttons {
  display: flex;
  gap: 8px;
}

.font-size-buttons button {
  width: 50px; /* Increased from 40px */
  height: 50px; /* Increased from 40px */
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 16px; /* Added larger font size */
}

.font-size-buttons button:hover {
  background: rgba(255, 20, 147, 0.1);
  border-color: #ff1493;
  color: #ff1493;
}

.theme-buttons {
  display: flex;
  gap: 8px;
}

.theme-btn {
  padding: 12px 20px; /* Increased padding for bigger buttons */
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px; /* Increased font size */
}

/* Individual theme button colors */
.theme-btn[data-theme="light"] {
  background: #ffffff;
  color: #333;
  border-color: #ddd;
}

.theme-btn[data-theme="sepia"] {
  background: #f3ead8;
  color: #5c4e37;
  border-color: #d4c5a0;
}

.theme-btn[data-theme="dark"] {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #444;
}

.theme-btn:hover,
.theme-btn.active {
  border-color: #ff1493;
  box-shadow: 0 0 0 2px rgba(255, 20, 147, 0.1);
}

/* Reader content theme styling */
body.reader-mode {
  background: #000000 !important; /* Black background for reader mode */
  color: #333;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

body.reader-mode[data-theme="light"] {
  background: #000000 !important; /* Black background */
  color: #333;
}

body.reader-mode[data-theme="light"] .reader-content {
  background: #ffffff !important;
  color: #333 !important;
}

body.reader-mode[data-theme="sepia"] {
  background: #000000 !important; /* Black background */
  color: #5c4e37;
}

body.reader-mode[data-theme="sepia"] .reader-content {
  background: #f3ead8 !important;
  color: #5c4e37 !important;
}

body.reader-mode[data-theme="dark"] {
  background: #1a1a1a;
  color: #e0e0e0;
}

body.reader-mode[data-theme="dark"] .reader-content {
  background: #1a1a1a !important;
  color: #e0e0e0 !important;
}

/* Prose content styling with paragraph indentation */
.reader-content .prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
  line-height: 1.6;
  font-size: 1rem;
  padding-top: 54px; /* Move content down by 2 more line spaces (22px + 32px = 54px) */
}

.reader-content .prose p {
  text-indent: 5ch !important; /* Indent all paragraphs by 5 spaces - use !important to override conflicting rules */
  margin: 1em 0;
}

/* Ensure first paragraph also gets indented with highest specificity */
.reader-mode .reader-content .prose p:first-of-type {
  text-indent: 5ch !important; /* Explicitly indent first paragraph */
}

/* Comprehensive paragraph indentation - catch all paragraph variations with high specificity */
.reader-mode .reader-content .prose p:first-child {
  text-indent: 5ch !important; /* First child paragraph */
}

.reader-mode .reader-content .prose > p {
  text-indent: 5ch !important; /* Direct child paragraphs */
}

/* Override the conflicting rule for book paragraphs */
.reader-mode .reader-content .prose .book-paragraph:first-of-type {
  text-indent: 5ch !important; /* Override the no-indent rule */
}

/* Chapter headings spacing */
.reader-content .prose h1,
.reader-content .prose h2,
.reader-content .prose h3,
.reader-content .prose h4 {
  margin-top: 2em;
  margin-bottom: 1em;
  text-indent: 0; /* Don't indent headings */
}

/* Paragraph following headings should also be indented - override conflicting style.css rules */
.reader-mode .reader-content .prose h1 + p,
.reader-mode .reader-content .prose h2 + p,
.reader-mode .reader-content .prose h3 + p,
.reader-mode .reader-content .prose h4 + p {
  text-indent: 5ch !important; /* Force indentation even after headings */
}

#font-family-select {
  padding: 12px 16px; /* Increased padding */
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  background: white;
  min-width: 140px; /* Increased width */
  font-size: 14px; /* Added font size */
}

#font-family-select:focus {
  outline: none;
  border-color: #ff1493;
  box-shadow: 0 0 0 2px rgba(255, 20, 147, 0.1);
}

/* Theme Support for Footer */
body.reader-mode[data-theme="sepia"]
  .reader-footer-navigation.interactive-footer {
  background: rgba(243, 234, 216, 0.95);
  border-top-color: rgba(92, 78, 55, 0.2);
}

body.reader-mode[data-theme="sepia"] .reader-footer-btn {
  color: #5c4e37;
}

body.reader-mode[data-theme="sepia"] .footer-menu-popup {
  background: #f3ead8;
  border-color: rgba(92, 78, 55, 0.2);
}

body.reader-mode[data-theme="dark"]
  .reader-footer-navigation.interactive-footer {
  background: rgba(26, 26, 26, 0.95);
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.reader-mode[data-theme="dark"] .reader-footer-btn {
  color: #e0e0e0;
}

body.reader-mode[data-theme="dark"] .footer-menu-popup {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

body.reader-mode[data-theme="dark"] .reader-contents-item,
body.reader-mode[data-theme="dark"] .reader-contents-header h3,
body.reader-mode[data-theme="dark"] .reader-appearance-header h3,
body.reader-mode[data-theme="dark"] .appearance-row label {
  color: #e0e0e0;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .reader-footer-buttons {
    padding: 8px 10px;
    gap: 2px;
  }

  .reader-footer-btn {
    min-width: 45px;
    height: 45px;
    font-size: 10px;
  }

  .reader-footer-btn span {
    font-size: 9px;
  }

  .footer-menu-popup {
    width: 95vw;
    max-height: 60vh;
  }
}

@media (max-width: 480px) {
  .reader-footer-buttons {
    padding: 6px 8px;
  }

  .reader-footer-btn {
    min-width: 40px;
    height: 40px;
  }

  .reader-footer-btn span {
    font-size: 8px;
  }

  .footer-menu-popup {
    width: 98vw;
    bottom: 60px;
  }
}

/* Mobile Reading Optimizations */
@media (max-width: 768px) {
  /* Hide scroll bars on mobile for cleaner reading experience */
  html,
  body,
  body.reader-mode,
  .reader-container {
    -ms-overflow-style: none !important; /* Internet Explorer 10+ */
    scrollbar-width: none !important; /* Firefox */
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  body.reader-mode::-webkit-scrollbar,
  .reader-container::-webkit-scrollbar {
    display: none !important; /* Safari and Chrome */
    width: 0 !important;
    height: 0 !important;
  }

  /* Expand reading area by reducing margins */
  .reader-container {
    max-width: 100%;
    padding-left: 5px;
    padding-right: 5px;
    margin: 0;
  }
}

@media (max-width: 480px) {
  /* Further optimize for smaller mobile screens */
  .reader-container {
    padding-left: 3px;
    padding-right: 3px;
  }
}
