/* ==========================================
   KimoStories — Custom Design Layer
   Unique buttons, card enhancements, loading
   ========================================== */

.kimo-brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  overflow: visible;
}

.kimo-brand-lockup .kimo-brand-mascot {
  width: 72px !important;
  height: 72px !important;
  object-fit: contain;
  filter: none !important;
  -webkit-filter: none !important;
}

.kimoreads-auth-wordmark {
  width: 380px !important;
  max-width: 90vw !important;
  height: 150px !important;
  object-fit: contain;
  filter: none !important;
  -webkit-filter: none !important;
}

body.frontend {
  font-family: 'Nunito', 'Tajawal', 'Segoe UI', system-ui, sans-serif;
}

/* .ks-hero h1,
.home-header h1,
.home-header .display-4,
.home-header .display-3 {
  font-family: 'Nunito', 'Tajawal', 'Segoe UI Rounded', system-ui, sans-serif !important;
  color: #ff8000 !important;
  letter-spacing: -0.04em;
  text-shadow: 0 3px 0 rgba(204, 82, 0, 0.35), 0 14px 34px rgba(255, 128, 0, 0.28);
} */

.home-title-logo {
  margin-bottom: 0.85rem;
  line-height: 1;
  text-shadow: none !important;
}

.home-title-logo img {
  width: 300px;
  max-width: 82vw;
  height: auto;
  filter: none !important;
  -webkit-filter: none !important;
}

.kimo-hero-cards {
  margin-top: 2rem;
  width: min(92vw, 860px);
  overflow: hidden;
  padding: 0.75rem 0.35rem 1.2rem;
  margin-inline: auto;
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

.kimo-hero-track {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 1.75rem;
  width: max-content;
  animation: kimo-card-track 24s linear infinite;
}

.kimo-hero-card {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(255, 128, 0, 0.18);
  border-radius: 2rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 128, 0, 0.18), transparent 9rem),
    linear-gradient(135deg, rgba(255, 245, 246, 0.92), rgba(229, 219, 222, 0.72));
  box-shadow: 0 22px 55px rgba(204, 82, 0, 0.22);
  text-decoration: none;
  color: inherit;
}

.kimo-hero-card:hover {
  transform: translateY(-4px);
}

@keyframes kimo-card-track {
  from {
    translate: 0 0;
  }

  to {
    translate: calc(-50% - 0.875rem) 0;
  }
}

.kimo-hero-mascot {
  width: 155px;
  height: 155px;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(204, 82, 0, 0.22)) !important;
  -webkit-filter: drop-shadow(0 16px 24px rgba(204, 82, 0, 0.22)) !important;
  animation: kimo-float 3.2s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes kimo-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

.kimo-hero-bubble {
  min-width: 210px;
  padding: 1.15rem 1.35rem;
  border: 1px solid rgba(194, 21, 21, 0.14);
  border-radius: 1.35rem;
  color: #32131a;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54);
  text-align: start;
}

.kimo-hero-bubble span,
.kimo-hero-bubble strong {
  display: block;
}

.kimo-hero-bubble span {
  margin-bottom: 0.25rem;
  color: #a56b7f;
  font-size: 0.85rem;
  font-weight: 700;
}

.kimo-hero-bubble strong {
  color: #7f1d2d;
  font-size: 1.25rem;
  font-weight: 800;
}

html[data-theme='dark'] .kimo-hero-card {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 128, 0, 0.18), transparent 9rem),
    linear-gradient(135deg, rgba(204, 82, 0, 0.32), rgba(24, 6, 10, 0.82));
}

html[data-theme='dark'] .kimo-hero-bubble {
  color: #fff5f6;
  background: rgba(24, 6, 10, 0.76);
}

@media (max-width: 575.98px) {
  .kimo-hero-cards {
    margin-top: 1.5rem;
  }

  .kimo-hero-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .kimo-hero-mascot {
    width: 120px;
    height: 120px;
  }
}

.ks-hero h1 span,
.home-header h1 span,
.home-header .display-4 span,
.home-header .display-3 span {
  color: #955f76 !important;
}

.ks-hero p,
.home-header p,
.home-header .lead {
  color: rgba(229, 219, 222, 0.84) !important;
  font-family: 'Nunito', 'Tajawal', 'Segoe UI', system-ui, sans-serif !important;
  letter-spacing: 0;
}

/* .ks-btn,
.btn.ks-btn,
.btn-primary,
.nav-item.show .nav-link,
.navbar .nav-link.active {
  background: linear-gradient(135deg, #cc5200, #ff6600 62%, #ff8000) !important;
  border-color: rgba(255, 128, 0, 0.32) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(194, 21, 21, 0.28) !important;
} */

/* .navbar .nav-link:hover,
.ks-filter-pills a:hover,
.dropdown-item:hover {
  color: #ff8000 !important;
  background: rgba(255, 128, 0, 0.1) !important;
} */

/* .ks-section-mark,
.badge,
.ks-story-type {
  border-color: rgba(194, 21, 21, 0.22) !important;
  color: #ff6600 !important;
  background: rgba(255, 128, 0, 0.09) !important;
} */

.ks-hero,
.home-header.with-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: url('/images/kimo-hero-background.png') center center / cover no-repeat !important;
}

html[data-theme='dark'] .ks-hero,
html[data-theme='dark'] .home-header.with-hero {
  background-image: url('/images/kimo-hero-background-night.png') !important;
}

.ks-hero::before,
.home-header.with-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
}

.ks-hero::after,
.home-header.with-hero::after {
  content: none;
}

/* =============================================
   A) CUSTOM BUTTON SYSTEM — "The Ember Collection"
   ============================================= */

/* Shared base for all custom buttons */
[class*="btn-ember"],
[class*="btn-slash"],
[class*="btn-glass-orange"],
[class*="btn-outline-ember"],
[class*="btn-ghost"],
[class*="btn-icon-ember"] {
  font-family: 'Tajawal', sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

[class*="btn-ember"]:active,
[class*="btn-slash"]:active,
[class*="btn-glass-orange"]:active,
[class*="btn-outline-ember"]:active,
[class*="btn-icon-ember"]:active {
  transform: scale(0.97);
}

/* ---- 1. .btn-ember — Primary Action ---- */
.btn-ember {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: #1D1616;
  color: #EEEEEE;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 3px 0 0 #E11E26;
  z-index: 1;
}

/* Left glowing stripe */
.btn-ember::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #ff8000, #E11E26, #8E1616);
  box-shadow: 0 0 12px rgba(225, 30, 38, 0.6), 0 0 24px rgba(225, 30, 38, 0.3);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  z-index: -1;
}

.btn-ember:hover {
  box-shadow: 0 4px 20px rgba(225, 30, 38, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
  padding-inline-start: 2rem;
}

.btn-ember:hover::before {
  width: 100%;
  box-shadow: 0 0 20px rgba(225, 30, 38, 0.5), 0 0 40px rgba(225, 30, 38, 0.2);
}

/* Ember particle dots on hover (CSS only) */
.btn-ember::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  background: #E11E26;
  border-radius: 50%;
  opacity: 0;
  box-shadow:
    -8px -12px 0 1px rgba(225, 30, 38, 0.7),
    6px -18px 0 0px rgba(216, 64, 64, 0.5),
    14px -6px 0 1px rgba(142, 22, 22, 0.6),
    -12px -4px 0 0px rgba(225, 30, 38, 0.4),
    10px -14px 0 1px rgba(238, 238, 238, 0.3);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.btn-ember:hover::after {
  opacity: 1;
  animation: ember-particles 1.2s ease-out infinite;
}

@keyframes ember-particles {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, calc(-50% - 24px)) scale(0.3); opacity: 0; }
}

/* RTL: stripe on right side */
[dir="rtl"] .btn-ember {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset -3px 0 0 #E11E26;
}

[dir="rtl"] .btn-ember::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .btn-ember:hover {
  padding-inline-end: 2rem;
  padding-inline-start: 1.6rem;
}

/* ---- 2. .btn-slash — Diagonal Cut Corner ---- */
.btn-slash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 2rem;
  background: linear-gradient(135deg, #8E1616, #ff8000);
  color: #EEEEEE;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  box-shadow: 0 4px 16px rgba(142, 22, 22, 0.3);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Glow layer underneath the cut corner */
.btn-slash::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, rgba(225, 30, 38, 0.6), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-slash:hover {
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow: 0 6px 28px rgba(225, 30, 38, 0.35);
  filter: brightness(1.1);
}

.btn-slash:hover::before {
  opacity: 1;
}

.btn-slash:active {
  transform: scale(0.97);
}

/* ---- 3. .btn-glass-orange — Glassmorphism ---- */
.btn-glass-orange {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: rgba(142, 22, 22, 0.12);
  color: #EEEEEE;
  border: 1px solid rgba(225, 30, 38, 0.25);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glass-orange:hover {
  background: rgba(142, 22, 22, 0.22);
  border-color: rgba(225, 30, 38, 0.5);
  box-shadow: 0 4px 24px rgba(225, 30, 38, 0.2), 0 0 0 1px rgba(225, 30, 38, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.btn-glass-orange:active {
  transform: scale(0.97) translateY(0);
}

/* Dark theme adjustments for glass */
html[data-theme='dark'] .btn-glass-orange {
  background: rgba(225, 30, 38, 0.08);
  border-color: rgba(225, 30, 38, 0.2);
}

html[data-theme='dark'] .btn-glass-orange:hover {
  background: rgba(225, 30, 38, 0.15);
  border-color: rgba(225, 30, 38, 0.45);
}

/* ---- 4. .btn-outline-ember — Outline with Fill ---- */
.btn-outline-ember {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: transparent;
  color: #ff8000;
  border: 1px solid #ff8000;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Fill layer from left */
.btn-outline-ember::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #8E1616, #1D1616);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.btn-outline-ember:hover {
  color: #EEEEEE;
  border-color: #ff8000;
  box-shadow: 0 0 16px rgba(225, 30, 38, 0.25);
}

.btn-outline-ember:hover::before {
  width: 100%;
}

/* Glow pulse on border */
.btn-outline-ember::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border: 1px solid rgba(225, 30, 38, 0.4);
  border-radius: 7px;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: none;
}

.btn-outline-ember:hover::after {
  opacity: 1;
  animation: glow-pulse 1.5s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(225, 30, 38, 0.2); }
  50% { box-shadow: 0 0 16px rgba(225, 30, 38, 0.4); }
}

/* RTL: fill from right */
[dir="rtl"] .btn-outline-ember::before {
  left: auto;
  right: 0;
}

/* ---- 5. .btn-ghost — Minimal Nav Link ---- */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: rgba(238, 238, 238, 0.6);
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Sliding underline */
.btn-ghost::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #E11E26;
  box-shadow: 0 0 6px rgba(225, 30, 38, 0.4);
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ghost:hover {
  color: rgba(238, 238, 238, 1);
}

.btn-ghost:hover::after {
  width: 100%;
}

/* RTL: underline from right */
[dir="rtl"] .btn-ghost::after {
  left: auto;
  right: 0;
}

/* Light theme: adjust ghost text color */
html[data-theme='light'] .btn-ghost {
  color: rgba(29, 22, 22, 0.55);
}

html[data-theme='light'] .btn-ghost:hover {
  color: rgba(29, 22, 22, 1);
}

/* ---- 6. .btn-icon-ember — Small Circular/Icon ---- */
.btn-icon-ember {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #1D1616;
  color: #EEEEEE;
  border: 2px solid #ff8000;
  border-radius: 50%;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-icon-ember:hover {
  background: #ff8000;
  color: #1D1616;
  border-color: #ff8000;
  box-shadow: 0 0 0 4px rgba(225, 30, 38, 0.2), 0 4px 16px rgba(225, 30, 38, 0.3);
  animation: icon-pulse 0.6s ease;
}

@keyframes icon-pulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 30, 38, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(225, 30, 38, 0); }
  100% { box-shadow: 0 0 0 4px rgba(225, 30, 38, 0.2); }
}

.btn-icon-ember:active {
  transform: scale(0.92);
}

/* Smaller variant */
.btn-icon-ember.btn-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

/* Larger variant */
.btn-icon-ember.btn-lg {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
}

/* =============================================
   B) NOVEL CARDS ENHANCEMENT
   ============================================= */

/* Red-tinted gradient overlay at bottom of cards */
.novel-card .card::before,
.card.border-light.shadow-sm::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(225, 30, 38, 0.06) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
  border-radius: 0 0 var(--ks-radius) var(--ks-radius);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.novel-card .card:hover::before,
.card.border-light.shadow-sm:hover::before {
  opacity: 1;
}

/* Aggressive hover lift with red glow underneath */
.novel-card .card:hover,
.card.border-light.shadow-sm:hover {
  transform: translateY(-8px) !important;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(225, 30, 38, 0.1),
    0 6px 40px rgba(225, 30, 38, 0.12) !important;
}

html[data-theme='dark'] .novel-card .card:hover,
html[data-theme='dark'] .card.border-light.shadow-sm:hover {
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(225, 30, 38, 0.15),
    0 8px 48px rgba(225, 30, 38, 0.18) !important;
}

/* Cover image red vignette */
.novel-card .card .ratio-container,
.novel-card .card .card-img-top,
.card.border-light.shadow-sm .ratio-container,
.card.border-light.shadow-sm .card-img-top {
  position: relative;
}

.novel-card .card .ratio-container::after,
.novel-card .card .card-img-top::after,
.card.border-light.shadow-sm .ratio-container::after,
.card.border-light.shadow-sm .card-img-top::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(29, 22, 22, 0.2) 100%);
  pointer-events: none;
  transition: background 0.4s ease;
  border-radius: var(--ks-radius) var(--ks-radius) 0 0;
}

.novel-card .card:hover .ratio-container::after,
.novel-card .card:hover .card-img-top::after,
.card.border-light.shadow-sm:hover .ratio-container::after,
.card.border-light.shadow-sm:hover .card-img-top::after {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(142, 22, 22, 0.15) 100%);
}

/* =============================================
   C) NAVBAR ENHANCEMENT
   ============================================= */

/* Active nav item indicator — red */
.navbar .nav-item.active > .nav-link,
.navbar .nav-link.active {
  color: var(--ks-accent) !important;
}

.navbar .nav-item.active > .nav-link::after,
.navbar .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: #E11E26;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(225, 30, 38, 0.4);
}

/* Dropdown items: red glow on hover */
.navbar .dropdown-menu .dropdown-item:hover {
  background: rgba(225, 30, 38, 0.08) !important;
  color: #E11E26 !important;
  box-shadow: inset 3px 0 0 #E11E26, 0 0 12px rgba(225, 30, 38, 0.06);
}

/* RTL: inset on right */
[dir="rtl"] .navbar .dropdown-menu .dropdown-item:hover {
  box-shadow: inset -3px 0 0 #E11E26, 0 0 12px rgba(225, 30, 38, 0.06);
}

/* =============================================
   D) LOADING SCREEN
   ============================================= */

/* Loading background: dark warm tone */
.loading-screen {
  background-color: #1D1616 !important;
}

.loading-screen.with-image {
  background-color: #1D1616 !important;
}

/* Logo stroke: brand red */
.loading-screen #logo path {
  stroke: #E11E26 !important;
}

/* Fill animation uses brand red */
html.loading .loading-screen #logo {
  animation: fill-orange 0.5s ease forwards 4s !important;
}

@keyframes fill-orange {
  from { fill: transparent; }
  to { fill: #E11E26; }
}

html.loaded .loading-screen #logo {
  animation: fill-orange 0s ease forwards !important;
}

/* Dark theme: keep red */
html[data-theme='dark'] .loading-screen {
  background-color: #1D1616 !important;
}

html[data-theme='dark'] .loading-screen #logo path {
  stroke: #E11E26 !important;
}

html[data-theme='dark'].loading #logo {
  animation: fill-orange 0.5s ease forwards 4s !important;
}

html[data-theme='dark'].loaded #logo {
  animation: fill-orange 0s ease forwards !important;
}

/* Light theme: slightly lighter bg but still warm */
html[data-theme='light'] .loading-screen {
  background-color: #1D1616 !important;
}

/* =============================================
   E) MISC UNIQUE TOUCHES
   ============================================= */

/* Scrollbar styling — red tinted */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(142, 22, 22, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(225, 30, 38, 0.5);
}

/* Selection color */
::selection {
  background: rgba(225, 30, 38, 0.25);
  color: #EEEEEE;
}

/* Focus ring — red */
*:focus-visible {
  outline: 2px solid rgba(225, 30, 38, 0.5);
  outline-offset: 2px;
}

/* Smooth all theme transitions */
html {
  transition: background-color 0.5s ease, color 0.5s ease;
}

.home-header.with-hero.full-width {
  width: 100vw;
  max-width: 100vw;
  left: 50%;
  right: auto;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transform: translateX(-50%);
}

.home-header.with-hero .devices-wrapper {
  text-align: center;
}

.home-header.with-hero .devices-image {
  max-width: 95%;
  height: auto;
}

/* =============================================
   F) WEBNOVEL/KIMO PROFILE OVERRIDES
   ============================================= */

/* Custom pagination style override to match the KimoStories Ember theme */
.pagination {
  gap: 0.35rem !important;
  justify-content: center !important;
  margin-block: 1rem !important;
}

.pagination .page-item .page-link {
  border: 1px solid var(--ks-border) !important;
  border-radius: 6px !important;
  color: var(--ks-text) !important;
  background: var(--ks-bg-soft) !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.85rem !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.pagination .page-item .page-link:hover {
  background: var(--ks-border) !important;
  color: var(--ks-heading) !important;
  border-color: var(--ks-accent) !important;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #8e1616, #ff8000) !important;
  border-color: #ff8000 !important;
  color: #eeeeee !important;
  box-shadow: 0 4px 14px rgba(225, 30, 38, 0.35) !important;
}

.pagination .page-item.disabled .page-link {
  opacity: 0.4 !important;
  background: var(--ks-bg-soft) !important;
  border-color: var(--ks-border) !important;
  color: var(--ks-muted) !important;
}

/* Styled Form Controls - textareas and inputs (matches the dark mode properly) */
.form-control {
  background-color: var(--ks-bg-soft) !important;
  border: 1px solid var(--ks-border) !important;
  color: var(--ks-text) !important;
  border-radius: 8px !important;
  font-family: inherit;
  transition: all 0.2s ease !important;
}

.form-control:focus {
  background-color: var(--ks-bg) !important;
  border-color: var(--ks-accent) !important;
  color: var(--ks-heading) !important;
  box-shadow: 0 0 0 3px var(--ks-accent-soft) !important;
}

.form-control::placeholder {
  color: var(--ks-muted) !important;
}

/* Ember Button disabled state override */
.btn-ember:disabled,
.btn.btn-ember:disabled {
  background: var(--ks-bg-soft) !important;
  color: var(--ks-muted) !important;
  box-shadow: none !important;
  border: 1px solid var(--ks-border) !important;
  cursor: not-allowed !important;
  padding-inline-start: 1.6rem !important;
}

.btn-ember:disabled::before,
.btn.btn-ember:disabled::before,
.btn-ember:disabled::after,
.btn.btn-ember:disabled::after {
  display: none !important;
}

/* Styled actions for Wall Posts */
.post-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ks-muted, #8f8f9f) !important;
  background: transparent;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.post-action-btn:hover {
  background: var(--ks-bg-soft, rgba(255, 255, 255, 0.05)) !important;
}

.post-action-btn.hover-ember:hover {
  color: #ff8000 !important; /* Ember accent red */
}

.post-action-btn.hover-danger:hover {
  color: #ff944d !important; /* Danger red */
}

/* Sidebar Nav Pills active tab override to match Ember theme */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background: linear-gradient(135deg, #8e1616, #ff8000) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(225, 30, 38, 0.25) !important;
  border: none !important;
}

.nav-pills .nav-link {
  color: var(--ks-muted, #8f8f9f) !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
  color: var(--ks-heading, #ffffff) !important;
  background: var(--ks-bg-soft, rgba(255, 255, 255, 0.05)) !important;
}

/* Center aligned section heads icon alignment fix */
.ks-section-head.justify-content-center .ks-section-mark .ks-icon {
  transform: none !important;
}

/* Styled Form Controls - select fields (matches the dark mode properly) */
.form-select {
  background-color: var(--ks-bg-soft, #1e1e1e) !important;
  border: 1px solid var(--ks-border, rgba(255, 255, 255, 0.1)) !important;
  color: var(--ks-text, #bebebe) !important;
  border-radius: 8px !important;
  font-family: inherit;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.form-select:focus {
  background-color: var(--ks-bg, #121212) !important;
  border-color: var(--ks-accent, #ff8000) !important;
  color: var(--ks-heading, #ffffff) !important;
  box-shadow: 0 0 0 3px var(--ks-accent-soft, rgba(216, 64, 64, 0.15)) !important;
}

.form-select option {
  background-color: var(--ks-bg, #121212) !important;
  color: var(--ks-text, #bebebe) !important;
}

/* Settings Sidebar Custom Override */
#profile-sidebar {
  background-color: var(--ks-bg, #121212) !important;
  border-right: 1px solid var(--ks-border, rgba(255, 255, 255, 0.1)) !important;
}

#profile-sidebar ul li a {
  color: var(--ks-muted, #8f8f9f) !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

#profile-sidebar ul li a:hover {
  color: var(--ks-heading, #ffffff) !important;
  background: var(--ks-bg-soft, rgba(255, 255, 255, 0.05)) !important;
}

#profile-sidebar ul li.active > a,
#profile-sidebar a[aria-expanded="true"] {
  color: var(--ks-heading, #ffffff) !important;
  background: var(--ks-bg-soft, rgba(255, 255, 255, 0.05)) !important;
}

#profile-sidebar ul li.active {
  border-left: 5px solid #ff8000 !important; /* Ember accent red border instead of cyan */
}

[dir="rtl"] #profile-sidebar ul li.active {
  border-right: 5px solid #ff8000 !important; /* Ember accent red border instead of cyan */
}

/* ==========================================================
   GameNovel Portal - Forced Dark Gaming HUD Override Styles
   Ensures videogame layout renders consistently in light & dark mode
   ========================================================== */

[data-theme="light"] .gamenovel-hud-wrapper,
.gamenovel-hud-wrapper {
  background-color: #0b0f19 !important;
  background-image: radial-gradient(circle at 50% 50%, #151a2d 0%, #0b0f19 100%) !important;
  color: #e2e8f0 !important;
  font-family: 'Poppins', sans-serif !important;
  min-height: 85vh;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid rgba(255, 128, 0, 0.25) !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 128, 0, 0.05);
  margin-bottom: 30px;
}

[data-theme="light"] .gamenovel-hud-wrapper h1,
[data-theme="light"] .gamenovel-hud-wrapper h2,
[data-theme="light"] .gamenovel-hud-wrapper h3,
[data-theme="light"] .gamenovel-hud-wrapper h4,
[data-theme="light"] .gamenovel-hud-wrapper h5,
[data-theme="light"] .gamenovel-hud-wrapper h6,
[data-theme="light"] .gamenovel-hud-wrapper .text-white,
[data-theme="light"] .gamenovel-hud-wrapper .fw-bold,
.gamenovel-hud-wrapper h1,
.gamenovel-hud-wrapper h2,
.gamenovel-hud-wrapper h3,
.gamenovel-hud-wrapper h4,
.gamenovel-hud-wrapper h5,
.gamenovel-hud-wrapper h6,
.gamenovel-hud-wrapper .text-white,
.gamenovel-hud-wrapper .fw-bold {
  color: #ffffff !important;
}

[data-theme="light"] .gamenovel-hud-wrapper .card,
.gamenovel-hud-wrapper .card {
  background: rgba(18, 18, 24, 0.75) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 128, 0, 0.25) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37), 0 0 15px rgba(255, 128, 0, 0.1) !important;
}

[data-theme="light"] .gamenovel-hud-wrapper .text-muted,
.gamenovel-hud-wrapper .text-muted {
  color: rgba(255, 255, 255, 0.55) !important;
}

[data-theme="light"] .gamenovel-hud-wrapper .bg-dark-soft,
.gamenovel-hud-wrapper .bg-dark-soft {
  background: rgba(10, 10, 15, 0.6) !important;
}

[data-theme="light"] .gamenovel-hud-wrapper textarea,
[data-theme="light"] .gamenovel-hud-wrapper input,
.gamenovel-hud-wrapper textarea,
.gamenovel-hud-wrapper input {
  background: rgba(10, 10, 15, 0.9) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 128, 0, 0.25) !important;
}

[data-theme="light"] .gamenovel-hud-wrapper textarea:focus,
[data-theme="light"] .gamenovel-hud-wrapper input:focus,
.gamenovel-hud-wrapper textarea:focus,
.gamenovel-hud-wrapper input:focus {
  border-color: #ff8000 !important;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.8), 0 0 15px rgba(255, 128, 0, 0.35) !important;
}

[data-theme="light"] .gamenovel-hud-wrapper .badge,
.gamenovel-hud-wrapper .badge {
  color: #ffffff !important;
}

[data-theme="light"] .gamenovel-hud-wrapper .badge.bg-warning,
.gamenovel-hud-wrapper .badge.bg-warning {
  color: #000000 !important;
}

[data-theme="light"] .gamenovel-hud-wrapper .border-light-subtle,
.gamenovel-hud-wrapper .border-light-subtle {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Modal Overrides */
[data-theme="light"] .modal-content,
.modal-content {
  background: rgba(22, 22, 28, 0.98) !important;
  border: 1px solid rgba(255, 128, 0, 0.25) !important;
  color: #ffffff !important;
}

[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer,
.modal-header,
.modal-footer {
  background: rgba(255, 128, 0, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="light"] .modal-body table,
.modal-body table {
  color: #e2e8f0 !important;
}

[data-theme="light"] .modal-body table td,
[data-theme="light"] .modal-body table th,
.modal-body table td,
.modal-body table th {
  color: #e2e8f0 !important;
  background-color: transparent !important;
}

/* Scrollbar formatting */
.gamenovel-hud-wrapper ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.gamenovel-hud-wrapper ::-webkit-scrollbar-track {
  background: #0b0f19;
}
.gamenovel-hud-wrapper ::-webkit-scrollbar-thumb {
  background: #ff8000;
  border-radius: 4px;
}

/* ==========================================================
   Hall of Fame - Theme-Aware Styles
   Ensures card layouts and text colors adapt in light/dark mode
   ========================================================== */

.ks-hof-card {
  background: rgba(30, 30, 36, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(12px) !important;
}

.ks-hof-card .ks-hof-username {
  color: #ffffff !important;
}

.ks-hof-card .ks-hof-username:hover {
  color: #ff8000 !important;
}

/* Light mode overrides */
[data-theme="light"] .ks-hof-card {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .ks-hof-card .ks-hof-username {
  color: #0f172a !important;
}

[data-theme="light"] .ks-hof-card .ks-hof-username:hover {
  color: #ff8000 !important;
}

[data-theme="light"] .ks-hof-card .text-muted {
  color: #64748b !important;
}

[data-theme="light"] .ks-hof-bg-rank {
  color: #0f172a !important;
  opacity: 0.05 !important;
}

/* Regional Filters / Buttons */
.ks-filter-btn {
  background: transparent !important;
  color: #8f8f9f !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  transition: all 0.2s ease;
}

[data-theme="light"] .ks-filter-btn {
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.ks-filter-btn:hover {
  color: #ff8000 !important;
  border-color: #ff8000 !important;
  background: rgba(255, 128, 0, 0.05) !important;
}

.ks-filter-btn.active,
[data-theme="light"] .ks-filter-btn.active {
  background: #ff8000 !important;
  color: #ffffff !important;
  border-color: #ff8000 !important;
}/* Japanese Novels Section — jp-novels */
.ks-jp-section {
    margin-block: 2rem;
}
.ks-jp-section-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    line-height: 1;
}
.ks-jp-section-head .ks-section-mark {
    color: #e94560 !important;
}
.ks-jp-section-title {
    margin: 0;
    color: var(--ks-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.15;
}
.ks-jp-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--ks-border);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--ks-surface);
    box-shadow: var(--ks-soft-shadow);
}
.ks-jp-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--ks-border);
    color: var(--ks-text) !important;
    text-decoration: none !important;
    transition: background-color .15s ease;
}
.ks-jp-item:last-child {
    border-bottom: 0;
}
.ks-jp-item:hover {
    background: var(--ks-accent-soft);
}
.ks-jp-rank {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 800;
    color: var(--ks-muted);
    background: var(--ks-bg-soft);
}
.ks-jp-item:nth-child(1) .ks-jp-rank {
    background: linear-gradient(135deg, #ffd700, #ff9500);
    color: #fff;
}
.ks-jp-item:nth-child(2) .ks-jp-rank {
    background: linear-gradient(135deg, #c0c0c0, #909090);
    color: #fff;
}
.ks-jp-item:nth-child(3) .ks-jp-rank {
    background: linear-gradient(135deg, #cd7f32, #a05a2c);
    color: #fff;
}
.ks-jp-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--ks-heading);
    font-size: .92rem;
}
.ks-jp-meta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    color: var(--ks-muted);
}
.ks-jp-meta .ks-jp-chapters {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.ks-jp-status {
    flex: 0 0 auto;
    border-radius: 4px;
    padding: .15rem .4rem;
    font-size: .65rem;
    font-weight: 700;
    color: #fff;
}
.ks-jp-status.ongoing {
    background: #3b82f6;
}
.ks-jp-status.completed {
    background: #22c55e;
}

/* Fix: banner height + image position + button placement */
.ks-jp-banner {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    margin-top: 1.25rem;
    width: 100%;
    height: 0;
    padding-bottom: 40%;
    box-shadow: var(--ks-shadow);
}
.ks-jp-banner-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    z-index: 0;
}
.ks-jp-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
}
.ks-jp-banner-content {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* White button with black text */
.ks-jp-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.8rem;
    border: none;
    border-radius: 999px;
    background: #ffffff;
    color: #000000;
    font-weight: 700;
    font-size: .92rem;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ks-jp-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    color: #000000;
    text-decoration: none;
    background: #ffffff;
}
.ks-jp-banner-btn i {
    font-size: .8rem;
}

@media (max-width: 767.98px) {
    .ks-jp-banner {
        padding-bottom: 50%;
    }
    .ks-jp-banner-content {
        bottom: 1rem;
    }
    .ks-jp-banner-btn {
        font-size: .82rem;
        padding: .55rem 1.3rem;
    }
}

@media (max-width: 575.98px) {
    .ks-jp-banner {
        padding-bottom: 60%;
    }
    .ks-jp-banner-btn {
        font-size: .75rem;
        padding: .5rem 1rem;
    }
}

}


/* Chinese Badge CSS overrides */
.ks-story-type-chinese {
    background: #dc2626 !important;
}
