/* DoujinHero Custom Styles - Themed for Tailwind */

:root {
  /* Color Components - Dark Mode (default) */
  --color-bg: 10 11 20;
  --color-surface: 21 22 33;
  --color-accent-coral: 255 168 168;
  --color-accent-mint: 143 223 183;
  --color-text: 245 243 240;

  /* Full Color Variables (for custom CSS) */
  --dark-bg: rgb(var(--color-bg));
  --dark-surface: rgb(var(--color-surface));
  --soft-coral: rgb(var(--color-accent-coral));
  --soft-mint: rgb(var(--color-accent-mint));
  --warm-white: rgb(var(--color-text));

  --soft-coral-20: rgba(var(--color-accent-coral), 0.2);
  --soft-coral-10: rgba(var(--color-accent-coral), 0.1);
  --soft-mint-30: rgba(var(--color-accent-mint), 0.3);
  --soft-mint-20: rgba(var(--color-accent-mint), 0.2);
  --soft-mint-10: rgba(var(--color-accent-mint), 0.1);
  --warm-white-80: rgba(var(--color-text), 0.8);
  --warm-white-70: rgba(var(--color-text), 0.7);
  --warm-white-60: rgba(var(--color-text), 0.6);
}

/* Light Mode Colors - Applied when 'dark' class is NOT present */
html:not(.dark) {
  /* Color Components - Light Mode */
  --color-bg: 248 249 250;
  --color-surface: 255 255 255;
  --color-accent-coral: 232 93 117;
  --color-accent-mint: 45 157 92;
  --color-text: 26 26 46;

  /* Opacity Variations */
  --soft-coral-20: rgba(var(--color-accent-coral), 0.15);
  --soft-coral-10: rgba(var(--color-accent-coral), 0.08);
  --soft-mint-30: rgba(var(--color-accent-mint), 0.25);
  --soft-mint-20: rgba(var(--color-accent-mint), 0.15);
  --soft-mint-10: rgba(var(--color-accent-mint), 0.08);
  --warm-white-80: rgba(var(--color-text), 0.85);
  --warm-white-70: rgba(var(--color-text), 0.7);
  --warm-white-60: rgba(var(--color-text), 0.55);
}

/* Light mode shadows and borders */
html:not(.dark) .card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--soft-mint-20);
}

html:not(.dark) .card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Light mode scrollbar */
html:not(.dark) ::-webkit-scrollbar-track {
  background: #f0f0f0;
}

html:not(.dark) ::-webkit-scrollbar-thumb {
  background: rgba(var(--color-accent-mint), 0.4);
}

html:not(.dark) ::-webkit-scrollbar-thumb:hover {
  background: var(--soft-mint);
}

/* Light mode - Mobile menu and overlay fixes */
html:not(.dark) #mobile-menu {
  background-color: rgb(var(--color-surface));
  border-left-color: rgba(var(--color-accent-mint), 0.2);
}

html:not(.dark) #mobile-overlay {
  background-color: rgba(0, 0, 0, 0.3);
}

/* Light mode - Navigation and button text color fixes */
html:not(.dark) .nav-link:hover,
html:not(.dark) .mobile-nav-link:hover,
html:not(.dark) .profile-nav-link:hover {
  color: var(--soft-mint) !important;
}

/* Light mode - Dropdown menu fixes */
html:not(.dark) #user-dropdown-menu {
  background-color: rgb(var(--color-surface));
  border-color: rgba(var(--color-accent-mint), 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Light mode - Button and interactive element text on hover */
html:not(.dark) .btn-primary:hover,
html:not(.dark) .btn-secondary:hover {
  color: rgb(var(--color-bg));
}

/* Light mode - Header/navbar fixes */
html:not(.dark) nav {
  background-color: rgba(var(--color-surface), 0.95);
  border-bottom-color: rgba(var(--color-accent-mint), 0.2);
}

/* Light mode - Form inputs */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="email"],
html:not(.dark) input[type="password"],
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: rgba(var(--color-bg), 0.5);
  border-color: rgba(var(--color-accent-mint), 0.3);
  color: rgb(var(--color-text));
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
  color: rgba(var(--color-text), 0.5);
}

/* Light mode - Cards and surfaces with better contrast */
html:not(.dark) .bg-dark-surface {
  background-color: rgb(var(--color-surface));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

html:not(.dark) .bg-dark-bg {
  background-color: rgb(var(--color-bg));
}

/* Light mode - Footer fixes */
html:not(.dark) footer {
  background-color: rgb(var(--color-surface));
  border-top-color: rgba(var(--color-accent-mint), 0.15);
}

/* Light mode - Auth modal fixes */
html:not(.dark) #auth-reminder-modal {
  background-color: rgba(0, 0, 0, 0.4);
}

html:not(.dark) #auth-reminder-modal > div {
  background-color: rgb(var(--color-surface));
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* Light mode - Chapter/Status badges - ensure dark text is readable */
html:not(.dark) .text-dark-bg {
  color: #1a1a2e !important;
}

/* Light mode - Auth page button improvements */
html:not(.dark) .card-hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Light mode - Transparent borders need more visibility */
html:not(.dark) .border-soft-mint\/10,
html:not(.dark) .border-soft-mint\/20,
html:not(.dark) .border-soft-mint\/30 {
  border-color: rgba(var(--color-accent-mint), 0.3) !important;
}

/* Light mode - All modals and overlays */
html:not(.dark) .bg-black\/50 {
  background-color: rgba(0, 0, 0, 0.4) !important;
}

html:not(.dark) .bg-black\/60 {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

html:not(.dark) .bg-black\/70 {
  background-color: rgba(0, 0, 0, 0.6) !important;
}

/* Light mode - Settings overlay */
html:not(.dark) #settingsOverlay {
  background-color: rgba(0, 0, 0, 0.4);
}

html:not(.dark) #settingsModal {
  background-color: rgb(var(--color-surface));
}

/* Light mode - Primary action buttons should have stronger contrast */
html:not(.dark) .bg-soft-mint {
  background-color: rgb(var(--color-accent-mint));
}

html:not(.dark) .bg-soft-coral {
  background-color: rgb(var(--color-accent-coral));
}

/* Light mode - Improve hover states */
html:not(.dark) .hover\:bg-soft-mint\/10:hover,
html:not(.dark) .hover\:bg-soft-coral\/10:hover {
  background-color: rgba(var(--color-accent-mint), 0.15) !important;
}

/* Light mode - Improve focus ring visibility */
html:not(.dark) *:focus {
  outline-color: rgb(var(--color-accent-mint));
}

/* Light mode - Badge improvements for better readability */
html:not(.dark) .bg-soft-mint.text-dark-bg,
html:not(.dark) .bg-soft-coral.text-dark-bg {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Light mode - Fix sharp white edges on rounded borders */
html:not(.dark) .series-card,
html:not(.dark) .comic-card {
  /* Prevent white edge artifacts on rounded corners */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

html:not(.dark) .series-card > div,
html:not(.dark) .comic-card > div {
  /* Smooth out rounded corner rendering */
  isolation: isolate;
}

/* Light mode - Card shadows should be darker for better contrast */
html:not(.dark) .shadow-lg {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) .shadow-2xl {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Light mode - Thumbnail image containers fix */
html:not(.dark) .series-card .rounded-lg,
html:not(.dark) .comic-card .rounded-lg,
html:not(.dark) .series-card .rounded-xl,
html:not(.dark) .comic-card .rounded-xl,
html:not(.dark) .series-card .rounded-2xl,
html:not(.dark) .comic-card .rounded-2xl {
  /* Remove any box-shadow that could cause white edges */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Light mode - Thumbnail shadows should be subtle */
html:not(.dark) .series-card .shadow-lg,
html:not(.dark) .comic-card .shadow-lg {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Light mode - Backdrop blur causing edge issues */
html:not(.dark) [class*="backdrop-blur"] {
  /* Reduce backdrop blur intensity in light mode */
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

/* Light mode - Border rendering on cards */
html:not(.dark) .border-soft-mint\/10 {
  border-color: rgba(var(--color-accent-mint), 0.15) !important;
}

html:not(.dark) .border-soft-mint\/20 {
  border-color: rgba(var(--color-accent-mint), 0.25) !important;
}

/* Base Styles */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

/* Responsive Font Scaling */
@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 1024px) {
  html {
    font-size: 14px;
  }
}

@media (min-width: 1280px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 1536px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--dark-bg);
  color: var(--warm-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
.font-display {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

/* Enhanced Typography Scale for Desktop */
@media (min-width: 1024px) {
  .text-xs { font-size: 0.7rem; }
  .text-sm { font-size: 0.8rem; }
  .text-base { font-size: 0.9rem; }
  .text-lg { font-size: 1rem; }
  .text-xl { font-size: 1.1rem; }
  .text-2xl { font-size: 1.3rem; }
  .text-3xl { font-size: 1.6rem; }
  .text-4xl { font-size: 1.9rem; }
  .text-5xl { font-size: 2.4rem; }
  .text-6xl { font-size: 3rem; }
}

/* Component Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--soft-coral);
  color: var(--dark-bg);
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background-color: rgba(var(--color-accent-coral), 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--color-accent-coral), 0.3);
  color: var(--dark-bg);
  text-decoration: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--warm-white);
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid var(--soft-mint-30);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
}

.btn-secondary:hover {
  border-color: var(--soft-mint);
  background-color: var(--soft-mint-10);
  color: var(--warm-white);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--soft-mint-20);
}

/* Card Styles */
.card {
  background-color: var(--dark-surface);
  border-radius: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--soft-mint-10);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--soft-mint-20);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Navigation */
.nav-link {
  color: var(--warm-white-80);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--soft-mint), var(--soft-coral));
  border-radius: 1px;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--soft-mint);
  text-decoration: none;
}

/* Utilities */
.smooth-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.group:hover .group-hover\:bg-opacity-30 {
  background-color: var(--soft-coral-30);
}

.group:hover .group-hover\:scale-110 {
  transform: scale(1.1);
}

/* Container */
.container {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--soft-mint-30);
  border-radius: 4px;
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--soft-mint);
}

/* Form Styles */
.form-control {
  background-color: var(--dark-surface);
  border: 1px solid var(--soft-mint-30);
  border-radius: 0.75rem;
  color: var(--warm-white);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  width: 100%;
}

.form-control:focus {
  border-color: var(--soft-mint);
  outline: none;
  box-shadow: 0 0 0 3px var(--soft-mint-20);
  background-color: rgba(var(--color-surface), 0.9);
}

.form-control::placeholder {
  color: var(--warm-white-60);
}

/* Focus States */
.btn-primary:focus,
.btn-secondary:focus,
.nav-link:focus {
  outline: 2px solid var(--soft-mint);
  outline-offset: 2px;
}

/* Desktop optimizations */
@media (min-width: 1024px) {
  .btn-primary,
  .btn-secondary {
    padding: 0.7rem 1.8rem;
    font-size: 0.85rem;
    min-height: 44px;
  }

  .card {
    padding: 1.8rem;
  }

  .form-control {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
}

@media (min-width: 1280px) {
  .card {
    padding: 2rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --color-accent-coral: 255 107 107;
    --color-accent-mint: 81 207 102;
    --color-text: 255 255 255;
    --color-bg: 0 0 0;
    --color-surface: 26 26 26;
  }
}

/* Comic Grid Layout Styles */
.comic-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
  transition: all 0.3s ease;
}

@media (min-width: 640px) {
  .comic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .comic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .comic-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1536px) {
  .comic-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Comic List Layout Styles */
.comic-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
}

/* Comic Card Styles */
.comic-card {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comic-card:hover {
  transform: scale(1.02);
}

/* Hover Effects */
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.hover-glow:hover {
  box-shadow: 0 0 30px var(--soft-coral-20);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Line Clamp Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Aspect Ratio Utilities */
.aspect-\[3\/4\] {
  aspect-ratio: 3 / 4;
}

/* Animation Classes */
.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Loading Animation */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Modal Animation Utilities */
.modal-overlay-anim {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content-anim {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content-anim.fast-close {
  transition-duration: 0.15s;
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

/* Reusable scale animations */
.animate-scale-in {
  animation: scaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-scale-out {
  animation: scaleOut 0.15s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Image Styles */
img {
  max-width: 100%;
  height: auto;
  image-rendering: smooth;
}

/* Comic Card Image Styles */
.comic-card img {
  transition: transform 0.3s ease;
}

.comic-card:hover img {
  transform: scale(1.05);
}

/* Filter Panel Styles */
#filters-panel {
  backdrop-filter: blur(8px);
}

/* Search Input Focus Ring */
#search-input:focus {
  box-shadow: 0 0 0 3px var(--soft-mint-20);
}

/* Custom Select Styles */
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  appearance: none;
}

/* Custom Checkbox Container - uses wrapper pattern for cross-browser reliability */
.checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.checkbox-wrapper .checkbox-visual {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--soft-mint);
  border-radius: 6px;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox-wrapper:hover .checkbox-visual {
  border-color: var(--soft-coral);
  background-color: rgba(255, 107, 107, 0.1);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-visual {
  background-color: var(--soft-coral);
  border-color: var(--soft-coral);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-visual::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid var(--dark-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checkbox-wrapper input[type="checkbox"]:focus + .checkbox-visual {
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3);
}

/* Light mode checkbox adjustments */
html:not(.dark) .checkbox-wrapper .checkbox-visual {
  background-color: rgba(255, 255, 255, 0.9);
  border-color: var(--soft-mint);
}

html:not(.dark) .checkbox-wrapper:hover .checkbox-visual {
  background-color: rgba(255, 107, 107, 0.1);
}

/* Manga Section Styles */
.manga-section {
  position: relative;
}

.manga-scroll-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--soft-mint-30) transparent;
  scroll-behavior: smooth;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}

.manga-scroll-container:active {
  cursor: grabbing;
}

.manga-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.manga-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.manga-scroll-container::-webkit-scrollbar-thumb {
  background: var(--soft-mint-30);
  border-radius: 3px;
}

.manga-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-accent-mint), 0.5);
}

.manga-scroll-track {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.manga-card-horizontal {
  flex-shrink: 0;
  width: 280px;
  background: var(--dark-surface);
  border-radius: 0.75rem;
  border: 1px solid var(--soft-mint-10);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.manga-card-horizontal:hover {
  border-color: var(--soft-mint-20);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.rank-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--soft-coral);
  color: var(--dark-bg);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 10;
}

.rank-badge.rank-gold {
  background: linear-gradient(135deg, #ffd700, #ffb347);
}

.rank-badge.rank-gradient {
  background: linear-gradient(135deg, var(--soft-coral), var(--soft-mint));
}

.rank-badge.rank-mint {
  background: var(--soft-mint);
}

.manga-card-content {
  display: flex;
  height: 100%;
}

.cover-container {
  width: 80px;
  height: 100px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.group:hover .cover-image {
  transform: scale(1.05);
}

.cover-placeholder {
  background: linear-gradient(135deg, var(--soft-coral-10), var(--soft-mint-10));
  display: flex;
  align-items: center;
  justify-content: center;
}

.manga-info {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.manga-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--warm-white);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.group:hover .manga-title {
  color: var(--soft-coral);
}

.manga-meta {
  font-size: 0.75rem;
  color: var(--warm-white-60);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.manga-genres {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.genre-tag {
  background: var(--soft-mint-10);
  color: var(--soft-mint);
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.625rem;
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .manga-card-horizontal {
    width: 260px;
  }

  .manga-scroll-track {
    gap: 0.75rem;
  }

  .cover-container {
    width: 70px;
    height: 90px;
  }

  .manga-info {
    padding: 0.5rem;
  }
}

/* Touch devices */
@media (hover: none) {
  .manga-scroll-container {
    cursor: default;
  }

  .manga-scroll-container:active {
    cursor: default;
  }
}

/* Settings Modal Styles */
.card-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: rgba(var(--color-surface), 0.5);
  border: 1px solid var(--soft-mint-20);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.card-option:hover {
  border-color: rgba(var(--color-accent-mint), 0.4);
  background-color: rgba(var(--color-surface), 0.7);
  transform: translateY(-1px);
}

.card-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.card-option input[type="radio"]:checked + div {
  color: var(--soft-coral);
}

.card-option input[type="radio"]:checked ~ div {
  color: var(--soft-coral);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(var(--color-text), 0.2);
  border-radius: 24px;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: var(--warm-white);
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider {
  background-color: var(--soft-coral);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Range Slider */
.range-slider {
  height: 6px;
  border-radius: 3px;
  background: rgba(var(--color-text), 0.1);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--soft-coral);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--dark-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(var(--color-accent-coral), 0.4);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--soft-coral);
  cursor: pointer;
  border: 2px solid var(--dark-surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Shortcuts Grid */
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background-color: rgba(var(--color-surface), 0.5);
  border: 1px solid var(--soft-mint-20);
  border-radius: 0.75rem;
  padding: 1rem;
}

.shortcut-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.shortcut-key {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--soft-coral);
  background-color: var(--soft-coral-10);
  border: 1px solid var(--soft-coral-20);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  text-align: center;
}

.shortcut-desc {
  font-size: 0.7rem;
  color: var(--warm-white-60);
  text-align: center;
}

/* Compact Shortcut Row - for separate shortcuts modal */
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: rgba(var(--color-surface), 0.5);
  border: 1px solid var(--soft-mint-10);
  border-radius: 0.5rem;
}

.shortcut-key-sm {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--soft-coral);
  background-color: var(--soft-coral-10);
  border: 1px solid var(--soft-coral-20);
  border-radius: 0.25rem;
  padding: 0.2rem 0.4rem;
}

.shortcut-desc-sm {
  font-size: 0.75rem;
  color: var(--warm-white-60);
}

/* Compact Card Option for Reading Mode */
.card-option-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background-color: rgba(var(--color-surface), 0.5);
  border: 1px solid var(--soft-mint-10);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-option-compact:hover {
  border-color: var(--soft-mint-20);
  background-color: rgba(var(--color-surface), 0.7);
}

.card-option-compact:has(input:checked) {
  border-color: var(--soft-mint);
  background-color: var(--soft-mint-10);
}

.card-option-compact input {
  display: none;
}

/* Small Switch */
.switch.switch-sm {
  width: 36px;
  height: 20px;
}

.switch.switch-sm .slider:before {
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
}

.switch.switch-sm input:checked + .slider:before {
  transform: translateX(16px);
}

/* Markdown Content Styling */
.to-mark {
  line-height: 1.625;
}

.to-mark h1,
.to-mark h2,
.to-mark h3,
.to-mark h4,
.to-mark h5,
.to-mark h6 {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  color: var(--warm-white);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.to-mark h1:first-child,
.to-mark h2:first-child,
.to-mark h3:first-child,
.to-mark h4:first-child,
.to-mark h5:first-child,
.to-mark h6:first-child {
  margin-top: 0;
}

.to-mark h1 { font-size: 1.875rem; font-weight: 700; }
.to-mark h2 { font-size: 1.5rem; font-weight: 600; }
.to-mark h3 { font-size: 1.25rem; }

.to-mark p {
  margin-bottom: 1rem;
  color: var(--warm-white-80);
}

.to-mark p:last-child { margin-bottom: 0; }

.to-mark strong {
  color: var(--warm-white);
  font-weight: 600;
}

.to-mark em {
  color: var(--soft-coral);
  font-style: italic;
}

.to-mark a {
  color: var(--soft-mint);
  text-decoration: none;
  border-bottom: 1px solid var(--soft-mint-30);
  transition: all 0.2s ease;
}

.to-mark a:hover {
  color: var(--warm-white);
  border-bottom-color: var(--soft-mint);
}

.to-mark ul,
.to-mark ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--warm-white-80);
}

.to-mark ul li,
.to-mark ol li { margin-bottom: 0.5rem; }

.to-mark ul li::marker { color: var(--soft-coral); }
.to-mark ol li::marker { color: var(--soft-mint); }

.to-mark blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background-color: rgba(var(--color-accent-mint), 0.05);
  border-left: 4px solid var(--soft-mint);
  border-radius: 0 0.75rem 0.75rem 0;
  color: rgba(var(--color-text), 0.9);
  font-style: italic;
}

.to-mark code {
  background-color: var(--soft-mint-10);
  color: var(--soft-mint);
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
}

.to-mark pre {
  background-color: rgba(var(--color-accent-mint), 0.05);
  border: 1px solid var(--soft-mint-10);
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.to-mark pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

.to-mark hr {
  margin: 2rem 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--soft-mint), transparent);
}

/* Fix for equal height cards in horizontal scroll sections */
.horizontal-scroll-container {
  align-items: stretch;
}

.horizontal-scroll-container .series-card .bg-dark-surface {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.horizontal-scroll-container .series-card .bg-dark-surface > div:last-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Toast Notification Styles */
.toast-notification {
  will-change: transform, opacity;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Toast progress bar animation */
@keyframes toast-progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

.toast-progress {
  transition: width 0.1s linear;
}

/* Toast hover effects - pause progress bar */
.toast-notification:hover .toast-progress {
  animation-play-state: paused !important;
}

/* Light mode toast adjustments */
html:not(.dark) .toast-notification {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

html:not(.dark) .toast-notification.border-soft-coral\/30 {
  background: linear-gradient(to bottom right, rgb(var(--color-surface)), rgba(var(--color-accent-coral), 0.08));
}

html:not(.dark) .toast-notification.border-soft-mint\/30 {
  background: linear-gradient(to bottom right, rgb(var(--color-surface)), rgba(var(--color-accent-mint), 0.08));
}

/* Responsive toast positioning */
@media (max-width: 640px) {
  #toast-container {
    left: 1rem;
    right: 1rem;
    max-width: calc(100vw - 2rem);
  }

  .toast-notification {
    max-width: 100% !important;
    width: 100% !important;
  }
}
