/* ANISORA CORE DESIGN SYSTEM (style.css) */
:root {
  --font-family: 'Inter', 'Noto Sans Sinhala', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* AniShift Exact Color Tokens */
  --bg-body: #f4f5f8;
  --bg-primary: #f4f5f8;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8f9fa;
  --bg-hover: #ebebeb;
  --bg-badge: #ebebeb;
  
  --border-color: #e5e7eb;
  --border-light: #f0f2f5;
  --border-subtle: #d1d5db;
  
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-dim: #9ca3af;
  
  --accent-primary: #1E90FF;
  --primary-accent: #1E90FF;
  --primary-accent-hover: #0d80f2;
  --primary-glow: rgba(30, 144, 255, 0.18);
  --accent-green: #10b981;
  --accent-star: #f59e0b;
  
  --tag-bg: #ebebeb;
  --tag-text: #475569;
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 14px 24px -4px rgba(0, 0, 0, 0.12);
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode (Matching AniShift) */
[data-theme="dark"] {
  --bg-body: #0a0a0c;
  --bg-primary: #0a0a0c;
  --bg-surface: #121214;
  --bg-card: #121214;
  --bg-card-subtle: #18181c;
  --bg-hover: #1f1f24;
  --bg-badge: #232329;
  
  --border-color: #27272f;
  --border-light: #1f1f24;
  --border-subtle: #383844;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent-primary: #1E90FF;
  --primary-accent: #1E90FF;
  --primary-accent-hover: #0d80f2;
  --primary-glow: rgba(30, 144, 255, 0.25);
  --accent-green: #10b981;
  --accent-star: #f59e0b;
  
  --tag-bg: #232329;
  --tag-text: #cbd5e1;
}

/* Midnight OLED Mode (Matching AniShift) */
[data-theme="oled"] {
  --bg-body: #000000;
  --bg-primary: #000000;
  --bg-surface: #070709;
  --bg-card: #08080a;
  --bg-card-subtle: #0f0f13;
  --bg-hover: #16161d;
  --bg-badge: #141419;
  
  --border-color: #1a1a24;
  --border-light: #121218;
  --border-subtle: #262635;
  
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent-primary: #00e5ff;
  --primary-accent: #00e5ff;
  --primary-accent-hover: #00c7de;
  --primary-glow: rgba(0, 229, 255, 0.25);
  --accent-green: #10b981;
  --accent-star: #f59e0b;
  
  --tag-bg: #141419;
  --tag-text: #cbd5e1;
}

/* Midnight Navy Mode (Matching AniShift Classic #201f31) */
[data-theme="navy"] {
  --bg-body: #201f31;
  --bg-primary: #201f31;
  --bg-surface: #26253b;
  --bg-card: #26253b;
  --bg-card-subtle: #1c1b2c;
  --bg-hover: #2e2c45;
  --bg-badge: #2c2a42;
  
  --border-color: #35334e;
  --border-light: #2c2a42;
  --border-subtle: #454266;
  
  --text-main: #ffffff;
  --text-muted: #a5a8be;
  --text-dim: #72758e;
  
  --accent-primary: #1E90FF;
  --primary-accent: #1E90FF;
  --primary-accent-hover: #0d80f2;
  --primary-glow: rgba(30, 144, 255, 0.25);
  --accent-green: #10b981;
  --accent-star: #f59e0b;
  
  --tag-bg: #2c2a42;
  --tag-text: #cbd5e1;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Main Container */
.site-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.brand-text-accent {
  color: var(--primary-accent);
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--primary-glow);
  color: var(--primary-accent);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 4px;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-item {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: var(--tag-bg);
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--tag-bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--border-subtle);
}

/* Hero Section (Matching User Image 1: index.png fully visible with smooth bottom fade) */
.hero-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 600;
  min-height: 420px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--bg-primary);
  padding: 30px 20px 55px; /* Brings search and stats counter much further down into the fade zone */
}

/* Background Image using assets/images/index.png (Fully rendered) */
.hero-image-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Bottom seamless gradient fade overlay blending into var(--bg-primary) */
.hero-fade-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 20%,
    rgba(244, 245, 248, 0.08) 38%,
    rgba(244, 245, 248, 0.28) 52%,
    rgba(244, 245, 248, 0.55) 66%,
    rgba(244, 245, 248, 0.82) 80%,
    rgba(244, 245, 248, 0.96) 92%,
    var(--bg-primary) 100%
  );
  pointer-events: none;
}

[data-theme="dark"] .hero-wrapper {
  background: var(--bg-primary);
}
[data-theme="dark"] .hero-fade-overlay {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 20%,
    rgba(10, 10, 12, 0.08) 38%,
    rgba(10, 10, 12, 0.28) 52%,
    rgba(10, 10, 12, 0.55) 66%,
    rgba(10, 10, 12, 0.82) 80%,
    rgba(10, 10, 12, 0.96) 92%,
    #0a0a0c 100%
  );
}

[data-theme="oled"] .hero-wrapper {
  background: #000000;
}
[data-theme="oled"] .hero-fade-overlay {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 20%,
    rgba(0, 0, 0, 0.08) 38%,
    rgba(0, 0, 0, 0.28) 52%,
    rgba(0, 0, 0, 0.55) 66%,
    rgba(0, 0, 0, 0.82) 80%,
    rgba(0, 0, 0, 0.96) 92%,
    #000000 100%
  );
}

[data-theme="navy"] .hero-wrapper {
  background: #201f31;
}
[data-theme="navy"] .hero-fade-overlay {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 20%,
    rgba(32, 31, 49, 0.08) 38%,
    rgba(32, 31, 49, 0.28) 52%,
    rgba(32, 31, 49, 0.55) 66%,
    rgba(32, 31, 49, 0.82) 80%,
    rgba(32, 31, 49, 0.96) 92%,
    #201f31 100%
  );
}

[data-theme="dark"] .search-input-box,
[data-theme="oled"] .search-input-box,
[data-theme="navy"] .search-input-box {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
}

[data-theme="dark"] .search-submit-btn,
[data-theme="oled"] .search-submit-btn,
[data-theme="navy"] .search-submit-btn {
  color: var(--text-muted);
}
[data-theme="dark"] .search-submit-btn:hover,
[data-theme="oled"] .search-submit-btn:hover,
[data-theme="navy"] .search-submit-btn:hover {
  background: var(--tag-bg);
  color: var(--primary-accent);
}


/* Hero Center Content */
.hero-content {
  position: relative;
  z-index: 3;
  max-width: 840px;
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

.hero-logo-box {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-brand-logo-img {
  max-width: 250px;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}

.hero-brand-logo-img.logo-dark {
  display: none !important;
}

.hero-brand-logo-img.logo-light {
  display: block !important;
}

[data-theme="dark"] .hero-brand-logo-img.logo-dark,
[data-theme="oled"] .hero-brand-logo-img.logo-dark,
[data-theme="navy"] .hero-brand-logo-img.logo-dark {
  display: block !important;
}

[data-theme="dark"] .hero-brand-logo-img.logo-light,
[data-theme="oled"] .hero-brand-logo-img.logo-light,
[data-theme="navy"] .hero-brand-logo-img.logo-light {
  display: none !important;
}

/* Miruro-Style Search Group (Matching AniShift precisely) */
.miruro-search-group {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.miruro-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0 8px 0 34px;
  height: 38px;
  transition: all 0.2s ease;
}

.miruro-input-wrap .search-inner-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}

.miruro-input-wrap:focus-within {
  background-color: var(--bg-surface);
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.miruro-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
}

.miruro-input-wrap input::placeholder {
  color: var(--text-dim);
}

/* Clear Button */
.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
  flex-shrink: 0;
  border-radius: 4px;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

/* Search Action Box (Matching AniShift nav-action-box) */
.nav-action-box {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-action-box:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

/* Search Suggestions Dropdown (Miruro Style) */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
}

.search-suggestions-list {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.search-suggestions-list::-webkit-scrollbar {
  display: none;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.15s ease;
  text-decoration: none;
  text-align: left;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background-color: var(--bg-hover);
}

.suggestion-thumb {
  width: 38px;
  height: 52px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.suggestion-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.suggestion-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.suggestion-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Hero Stats Counter (Zero card background, seamlessly floating on hero fade) */
.hero-stats-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 70px;
  margin-bottom: 0px;
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 820px;
  background: transparent;
  padding: 8px 16px;
  gap: 12px;
}

.hero-stats-counter .stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 24px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.hero-stats-counter .stat-item:hover {
  transform: translateY(-3px);
}

.hero-stats-counter .stat-num {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-main);
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
}

/* Hover effect on ANY stat item: number turns bright theme blue */
.hero-stats-counter .stat-item:hover .stat-num {
  color: var(--accent-primary) !important;
  text-shadow: 0 0 18px var(--primary-glow);
}

/* EP count always permanently blue in all themes */
.hero-stats-counter #stat-total-subs,
.hero-stats-counter .stat-item.highlight .stat-num,
.hero-stats-counter .stat-num.accent,
.hero-stats-counter .stat-num.highlight-blue {
  color: var(--accent-primary) !important;
  text-shadow: 0 0 12px var(--primary-glow);
}

.hero-stats-counter .stat-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: color 0.2s ease;
}

/* Hover effect on label: turns theme blue */
.hero-stats-counter .stat-item:hover .stat-lbl {
  color: var(--accent-primary);
}

.hero-stats-counter .stat-sep {
  width: 1px;
  height: 44px;
  background-color: var(--border-color);
  opacity: 0.65;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .hero-stats-counter {
    margin-top: 50px;
    padding: 0 8px;
    gap: 4px;
    max-width: 100%;
  }
  .hero-stats-counter .stat-item {
    padding: 6px 8px;
  }
  .hero-stats-counter .stat-num {
    font-size: 26px;
  }
  .hero-stats-counter .stat-lbl {
    font-size: 11px;
    margin-top: 4px;
  }
  .hero-stats-counter .stat-sep {
    height: 32px;
  }
}

@media (max-width: 480px) {
  .hero-stats-counter {
    margin-top: 55px;
    padding: 0 2px;
    gap: 0;
  }
  .hero-stats-counter .stat-item {
    padding: 4px 3px;
  }
  .hero-stats-counter .stat-num {
    font-size: 22px;
  }
  .hero-stats-counter .stat-lbl {
    font-size: 9.5px;
    margin-top: 3px;
  }
  .hero-stats-counter .stat-sep {
    height: 28px;
  }
}

/* Anime Cards 8-Column Grid (Exactly 8 Columns across, 2 Rows = 16 Cards) */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 14px;
  margin-top: 10px;
  margin-bottom: 50px;
}

@media (max-width: 1360px) {
  .anime-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
  }
}

@media (max-width: 1150px) {
  .anime-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .anime-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
}

@media (max-width: 600px) {
  .anime-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .anime-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

/* Anime Card Item (Matching AniShift home.html precisely) */
.anime-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  transition: transform 0.2s ease;
}

/* Natural Anime Poster Aspect Ratio (2 / 2.95) with rounded corners & AniShift play overlay */
.anime-card .anime-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 2.95;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-hover);
  margin-bottom: 7px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.anime-card .anime-poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 8px;
  transition: transform 0.25s ease;
}

.anime-card:hover .anime-poster-wrap img {
  transform: scale(1.05);
}

.anime-poster-overlay {
  display: none !important;
}

.poster-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1E90FF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 17px;
  padding: 0;
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.45);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s ease;
}

.poster-play-btn i {
  color: #ffffff !important;
  font-size: 17px !important;
  display: inline-block;
  line-height: 1;
}

.anime-card:hover .poster-play-btn {
  transform: scale(1.12);
}

/* Anime Card Title (with green active status dot matching NEWEST) */
.anime-card .anime-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.anime-card .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
  flex-shrink: 0;
}

/* Anime Card Meta Tags (TV, Year, Stars matching NEWEST) */
.anime-card .anime-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.anime-card .meta-tag {
  background: var(--bg-badge);
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Placeholder Logo Overlay inside poster when image is loading */
.anime-card-placeholder-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  opacity: 0.35;
  pointer-events: none;
}

/* Badges on Poster */
.anime-card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.badge-sub {
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-format {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.anime-card-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.anime-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.anime-card:hover .anime-card-title {
  color: var(--primary-accent);
}

.anime-card-sub-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
}

.sub-available-tag {
  color: #10b981;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Modal Popup (for Sub Not Available / Request) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 32px 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes modalScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(2, 132, 199, 0.12);
  color: var(--primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 18px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-anime-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--tag-bg);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: left;
}

.modal-anime-poster {
  width: 48px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.modal-anime-meta-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.modal-anime-meta-status {
  font-size: 12px;
  color: #eab308;
  font-weight: 600;
  margin-top: 4px;
}

.modal-btn-row {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--tag-bg);
  color: var(--text-main);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-primary {
  flex: 1.3;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--primary-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--primary-accent-hover);
}

/* ===================================================
   FOOTER (Matching AniShift Mockup)
   =================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 32px 24px 26px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand-wrap {
  max-width: 520px;
}

.footer-brand {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.footer-brand-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

/* Light Theme shows logo-light (the dark icon), hides logo-dark (the light icon) */
.footer-brand-icon.logo-dark {
  display: none !important;
}
.footer-brand-icon.logo-light {
  display: block !important;
}

/* Dark, OLED & Navy Themes show logo-dark (the light icon), hides logo-light */
[data-theme="dark"] .footer-brand-icon.logo-dark,
[data-theme="oled"] .footer-brand-icon.logo-dark,
[data-theme="navy"] .footer-brand-icon.logo-dark {
  display: block !important;
}
[data-theme="dark"] .footer-brand-icon.logo-light,
[data-theme="oled"] .footer-brand-icon.logo-light,
[data-theme="navy"] .footer-brand-icon.logo-light {
  display: none !important;
}

.footer-disclaimer {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.65;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--primary-accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom a:hover {
  color: var(--primary-accent);
}

.footer-version-tag {
  background: var(--tag-bg);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  margin-left: 4px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Footer Theme Icons (Segmented 5 Themes matching AniShift) */
.footer-theme-icons {
  display: flex;
  align-items: stretch;
  background: var(--tag-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  height: 30px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.theme-icon-btn {
  width: 32px;
  height: 100%;
  border: none;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  user-select: none;
}

.theme-icon-btn:last-child {
  border-right: none;
}

.theme-icon-btn:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

.theme-icon-btn.active {
  background-color: var(--bg-surface);
  color: var(--primary-accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (max-width: 680px) {
  .site-container {
    padding: 0 14px;
  }
  .site-footer {
    padding: 24px 16px 20px;
  }
  .footer-top {
    flex-direction: column;
    gap: 16px;
  }
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    font-size: 13px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* ==========================================================================
   FULL MOBILE-RELATIVE SYSTEM OPTIMIZATION (Smartphones & Tablets)
   ========================================================================== */
@media (max-width: 768px) {
  /* Hero Section Adaptability */
  .hero-wrapper {
    aspect-ratio: auto;
    min-height: 340px;
    padding: 24px 14px 140px;
  }
  .hero-brand-logo-img {
    max-width: 200px;
  }
  .miruro-search-group {
    max-width: 100%;
    padding: 0 4px;
  }
  .miruro-input-wrap {
    height: 42px;
    font-size: 14px;
  }
  .miruro-search-input {
    font-size: 14px;
  }
  .nav-action-box {
    width: 42px;
    height: 42px;
  }
  
  /* Anime Cards Grid: Balanced 3 columns on standard mobile */
  .anime-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 36px;
  }
  .anime-card .anime-card-title {
    font-size: 12px;
    line-height: 1.3;
  }
  .anime-card-meta {
    font-size: 10.5px;
    gap: 4px;
  }

  /* Modal responsiveness */
  .modal-card {
    width: 92%;
    max-width: 420px;
    padding: 22px 18px;
    border-radius: var(--radius-lg);
  }
  .modal-anime-banner {
    padding: 10px;
    gap: 12px;
  }
  .modal-anime-poster {
    width: 52px;
    height: 72px;
  }
  .modal-btn-row {
    flex-direction: column-reverse;
    gap: 10px;
  }
  .modal-btn-row button,
  .modal-btn-row a {
    width: 100%;
    text-align: center;
    justify-content: center;
    height: 42px;
  }
}

/* Compact Smartphones (iPhone, Samsung Galaxy, Pixel <= 480px) */
@media (max-width: 480px) {
  .site-container {
    padding: 0 10px;
  }
  .hero-wrapper {
    min-height: 330px;
    padding: 20px 10px 35px;
  }
  .hero-brand-logo-img {
    max-width: 170px;
  }
  .miruro-search-group {
    gap: 5px;
  }
  
  /* 3-column compact layout on small mobile screens */
  .anime-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .anime-card .anime-poster-wrap {
    border-radius: 6px;
  }
  .anime-card .anime-card-title {
    font-size: 11px;
    font-weight: 600;
  }

  /* Theme Switcher in Footer: Touch Optimized */
  .footer-theme-icons {
    width: 100%;
    max-width: 280px;
    height: 34px;
  }
  .theme-icon-btn {
    flex: 1;
    width: auto;
    font-size: 13px;
  }
}

