* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(30, 30, 30, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #8a2be2, #4b0082);
  border-radius: 4px;
}

:root {
  --dark-bg: #0f0f15;
  --darker-bg: #09090e;
}

body {
  background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 70%);
  color: #e0d6ff;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.footer-navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 10, 30, 0.9);
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: 9999;
  backdrop-filter: blur(5px);
  border-top: 1px solid #4a2a7c;
   transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  user-select: none;
}

.text-nav-btn {
  background: linear-gradient(145deg, #8a2be2, #6a1fc0);
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  color: #f0e6ff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  
}

#footerPrevBtn,
#footerNextBtn {
  min-width: auto;
  white-space: nowrap;
  padding: 10px 10px;
}

@media (max-width: 768px) {
  #footerPrevBtn,
  #footerNextBtn {
    min-width: auto;
    padding: 10px 8px;
    font-size: 0.9rem;
  }
}

.text-nav-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  background: linear-gradient(145deg, #7a3faf, #5a3a9c);
}

.text-nav-btn:active {
  transform: translateY(1px);
}

.text-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.chapter-list-btn {
  background: linear-gradient(145deg, #8a2be2, #6a1fc0);
  font-size: 1.2rem;
  min-width: auto;
  padding: 9px 16px;
}

.reader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 20px 0 100px;
  flex: 1;
  background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 70%);
  padding-top: 90px;
}

.reader img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
}

.progress-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: #2a0a4e;
  z-index: 101;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6a3093, #8a2be2);
  width: 0%;
  transition: width 0.2s ease-out;
  border-radius: 0 3px 3px 0;
}

.loading {
  text-align: center;
  padding: 30px;
  color: #b08cff;
  font-size: 1.2rem;
}

.loading i {
  font-size: 2rem;
  margin-bottom: 15px;
  display: block;
  animation: spin 1.5s linear infinite;
}

.scroll-buttons {
  position: fixed;
  bottom: 90px;
  right: 20px;
  left: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99;
   transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.settings-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 400px;
  background: #1a1a1a;
  border: 2px solid #7a2fdf;
  border-radius: 16px;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  visibility: hidden;
}

.settings-popup.visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.settings-header {
  background: #1a1a1a;
  padding: 24px 28px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.settings-header h3 {
  color: white;
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#closeSettings {
  background: transparent;
  border: none;
  color: #9a04f6;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

#closeSettings:hover {
  color: white;
  background: #9a04f6;
}

.settings-content {
  padding: 32px 28px;
}

.setting-group {
  margin-bottom: 36px;
}

.setting-group:last-of-type {
  margin-bottom: 24px;
}

.setting-group label {
  display: block;
  margin-bottom: 16px;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.quality-options {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
}

.quality-btn {
  flex: 1;
  padding: 16px 12px;
  background: #2a2a2a;
  border: 2px solid #333;
  border-radius: 12px;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.quality-btn.active {
  background: #2a2a2a;
  border-color: #7a2fdf;
  color: white;
}

.quality-btn:hover:not(.active) {
  background: #333;
  border-color: #555;
}

.quality-btn .icon {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #7a2fdf;
}

.quality-btn.active .icon {
  color: #7a2fdf;
}

.quality-btn .text {
  font-size: 0.875rem;
  font-weight: 500;
}

.slider-container {
  position: relative;
  width: 100%;
  margin-top: 20px;
}

#autoScrollSpeed {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #333;
  outline: none;
  -webkit-appearance: none;
  position: relative;
  cursor: pointer;
}

#autoScrollSpeed::-webkit-slider-track {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
}

#autoScrollSpeed::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #7a2fdf;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  border: none;
  transition: all 0.2s ease;
}

#autoScrollSpeed::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.6);
}

#autoScrollSpeed::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #7a2fdf;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.75rem;
  color: #888;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 0;
}

.btn-primary {
  flex: 2;
  background: linear-gradient(145deg, #9a3cff, #7a2fdf);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.btn-secondary {
  flex: 1;
  background: transparent;
  color: #ccc;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 14px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #666;
  color: white;
}

.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(145deg, #9a3cff, #7a2fdf);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  z-index: 1001;
  transition: transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.notification.show {
  transform: translateX(-50%) translateY(0);
}

.scroll-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, #8a2be2, #6a1fc0);
  border: none;
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.scroll-btn:hover {
  background: linear-gradient(145deg, #9a3cff, #7a2fdf);
  transform: scale(1.05);
}

.hidden {
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .text-nav-btn {
    padding: 10px 15px;
    min-width: 120px;
    font-size: 0.9rem;
  }

  .scroll-btn {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }

  .chapter-list-btn {
    background: linear-gradient(145deg, #8a2be2, #6a1fc0);
    font-size: 1.2rem;
    min-width: auto;
    padding: 9px 16px;
  }
  .reader {
  padding-top: 80px;
}

}

.chevron-r {
  margin-left: 6px;
}

.chevron-l {
  margin-right: 6px;
}

.chapter-title-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 15px 20px;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
}

.chapter-title-container > * {
  pointer-events: auto;
}

.chapter-title {
  color: white;
  padding: 16px 22px;
  margin: 0;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 500;
  width: 100%;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.851);
  background: rgba(30, 20, 40, 0.962);
  border: 1px solid rgba(138, 43, 226, 0.3);
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}


.chapter-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  background: #f0daff;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  margin-left: 15px;
  padding-left: 15px;
  position: relative;
}

.chapter-number::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 70%;
  width: 2px;
  background: rgba(138, 43, 226, 0.5);
  border-radius: 1px;
}

@keyframes fadeInDown {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .chapter-title {
    font-size: 1.2rem;
    padding: 14px 18px;
    justify-content: center;
  }

  .chapter-number {
    font-size: 1.2rem;
    margin-left: 12px;
    padding-left: 12px;
  }

  .chapter-title-container {
    padding: 12px 15px;
  }

  .chapter-number::before {
    height: 80%;
  }
}

@media (max-width: 480px) {
  .chapter-title {
    font-size: 1rem;
  
    flex-direction: row;
    justify-content: center;
  }

  .chapter-number {
    font-size: 1rem;

  }

  .chapter-number::before {
    height: 80%;
  }
}


.scroll-buttons,
.footer-navigation {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.scroll-buttons.visible,
.footer-navigation.visible {
  opacity: 1;
  pointer-events: auto;
}

.auto-scroll-active {
  background: linear-gradient(145deg, #8b07ff, #8c08ff);
}

.notification.error {
  background-color: #5703b1ff;
  color: white;
  border: none;
}

.image-container {
  position: relative;
  min-height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.image-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 400px;
  z-index: 1;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.image-loader .spinner {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(138, 43, 226, 0.2);
  border-top: 4px solid #8a2be2;
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
  flex-shrink: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  position: relative;
  z-index: 2;
}

.image-container img.loaded {
  opacity: 1;
}

.image-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.image-container:not(.loaded) .image-loader {
  display: flex;
}

.image-container.loaded .image-loader {
  display: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .image-container {
    min-height: 300px;
  }

  .image-loader {
    min-height: 300px;
  }

  .image-loader .spinner {
    width: 80px;
    height: 80px;
    border-width: 3px;
  }
}

@media (max-width: 480px) {
  .image-container {
    min-height: 250px;
  }

  .image-loader {
    min-height: 250px;
  }

  .image-loader .spinner {
    width: 80px;
    height: 80px;
    border-width: 2px;
  }
}

 .report-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 90%;
    max-width: 400px;
    background: #111;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    color: #fff;
    border: 1px solid #8A2BE2;
}

.report-popup.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.report-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #e0d6ff;
}

#closeReport {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #b197fc;
    transition: color 0.2s ease;
}

#closeReport:hover {
    color: #8A2BE2;
}

.report-content {
    padding: 20px;
}

.report-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.report-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ddd;
    font-size: 0.95rem;
}

.report-options input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #8A2BE2;
    cursor: pointer;
}

.report-options input[type="radio"]:checked + span {
    color: #b197fc;
}

.btn-primary {
    background: linear-gradient(to right, #8A2BE2, #6a0dad);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(to right, #6a0dad, #8A2BE2);
}

.report-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
    font-size: 0.9rem !important;
}

.report-notification.show {
    opacity: 1;
}

.report-notification.error {
    background: #f44336;
    color: black;
}

.comic-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
}

.chapter-number .abbr-text {
  display: none;
}

@media (max-width: 480px) {
  .chapter-number .full-text {
    display: none;
  }
  
  .chapter-number .abbr-text {
    display: inline;
  }
  
  .comic-title {
    max-width: 90%;
  }
  .report-notification {
    font-size: 0.75rem !important;
}
.notification {
font-size: 0.75rem !important;
}
}

.report-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
    font-size: 0.95rem;
}

.chapter-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}