/* ============================================
   CherryMods - Main CSS
   Cherry Blossom Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ─── */
:root {
  --cherry: #e8174e;
  --cherry-dark: #b5103c;
  --cherry-light: #ff4d7d;
  --cherry-glow: rgba(232, 23, 78, 0.3);
  --pink: #ff6b9d;
  --pink-light: #ffb3cc;

  --bg: #080810;
  --bg-2: #0f0f1e;
  --bg-3: #141428;
  --card: #111125;
  --card-hover: #161630;
  --border: rgba(232, 23, 78, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);

  --text: #f0f0ff;
  --text-muted: #8888aa;
  --text-subtle: #555577;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-cherry: 0 0 30px rgba(232, 23, 78, 0.2);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);

  --transition: all 0.25s ease;
  --nav-height: 70px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--cherry-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cherry); }

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; line-height: 1.2; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ─── Preloader (homepage entrance screen) ─── */
html.preloader-active, html.preloader-active body { overflow: hidden; height: 100%; }

.preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-petals { position: absolute; inset: 0; pointer-events: none; }

.preloader-content { position: relative; z-index: 1; text-align: center; }

.preloader-logo {
  width: 64px; height: 64px; border-radius: var(--radius);
  margin: 0 auto 1.1rem; display: block;
  box-shadow: var(--shadow-cherry);
  animation: preloaderPulse 1.6s ease-in-out infinite;
}

.preloader-title {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.3rem;
  color: var(--text); letter-spacing: 0.01em; margin-bottom: 1.6rem;
}
.preloader-title em { font-style: normal; color: var(--cherry); }

.preloader-bar {
  width: 160px; height: 3px; border-radius: 3px;
  background: var(--bg-3); overflow: hidden; margin: 0 auto;
}

.preloader-bar-fill {
  height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, var(--cherry), var(--pink));
  animation: preloaderSlide 1.1s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes preloaderSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}

@media (prefers-reduced-motion: reduce) {
  .preloader-logo, .preloader-bar-fill { animation: none; }
}

/* ─── Navbar ─── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  display: flex; align-items: center;
  padding: 0 2rem;
  background: rgba(8, 8, 16, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(8, 8, 16, 0.98);
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800; font-size: 1.4rem;
  color: var(--text);
  margin-right: 2rem;
  flex-shrink: 0;
}

.nav-logo img { width: 36px; height: 36px; border-radius: 8px; }
.nav-logo span em { font-style: normal; color: var(--cherry); }

.nav-links {
  display: flex; align-items: center; gap: 0.5rem;
  list-style: none; flex: 1;
}

.nav-links a {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  background: var(--border-light);
}

.nav-links a.active { color: var(--cherry); }

.nav-right {
  display: flex; align-items: center; gap: 0.75rem;
  margin-left: auto;
}

.nav-search {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 50px; width: 200px; transition: var(--transition);
}

.nav-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 0.85rem; width: 100%;
}

.nav-search input::placeholder { color: var(--text-muted); }
.nav-search:focus-within { border-color: var(--cherry); box-shadow: 0 0 0 3px var(--cherry-glow); width: 260px; }
.nav-search svg { color: var(--text-muted); flex-shrink: 0; width: 16px; height: 16px; }

/* Burger button — injected by js/nav.js, hidden above 768px */
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; padding: 0 9px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition);
}

.nav-burger span {
  display: block; height: 2px; width: 100%;
  background: var(--text); border-radius: 2px;
  transition: var(--transition);
}

.nav-burger:hover { border-color: var(--cherry); }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.btn-discord {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #5865f2; border-radius: 50px;
  font-size: 0.85rem; font-weight: 600; color: #fff;
  transition: var(--transition); border: none; cursor: pointer;
}

.btn-discord:hover { background: #4752c4; transform: translateY(-1px); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.4rem; border-radius: 50px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); border: none; outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cherry), #c0102e);
  color: #fff; box-shadow: 0 4px 20px var(--cherry-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--cherry-glow);
  background: linear-gradient(135deg, var(--cherry-light), var(--cherry));
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text); border: 1px solid var(--border-light);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--cherry); border-color: var(--cherry); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* ─── Hero Section ─── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background: var(--bg);
}

.hero-bg-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.35;
}

.hero-bg-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(
    to right,
    rgba(8, 8, 16, 0.97) 0%,
    rgba(8, 8, 16, 0.7) 50%,
    rgba(8, 8, 16, 0.2) 100%
  );
}

.hero-bg-gradient-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; height: 200px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

/* Floating petals */
.petals-container {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}

.petal {
  position: absolute; top: -20px;
  width: 8px; height: 8px;
  background: radial-gradient(circle, var(--cherry-light), var(--cherry));
  border-radius: 50% 0 50% 0;
  opacity: 0;
  animation: petalFall linear infinite;
}

@keyframes petalFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.3; }
  100% { transform: translateY(110vh) rotate(720deg) translateX(100px); opacity: 0; }
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.2em;
  color: var(--cherry); text-transform: uppercase; margin-bottom: 1rem;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900; line-height: 1.05;
  color: var(--text); margin-bottom: 0.2rem;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--cherry), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1rem; color: var(--text-muted);
  max-width: 420px; margin: 1.2rem 0 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}

/* ─── Feature Badges ─── */
.features-bar {
  display: flex; gap: 2.5rem; margin-top: 2.5rem;
  padding-top: 2rem; border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.feature-item {
  display: flex; align-items: flex-start; gap: 0.9rem;
  flex: 1; min-width: 180px;
}

.feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(232, 23, 78, 0.1); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.feature-text h4 {
  font-size: 0.85rem; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.05em;
}

.feature-text p {
  font-size: 0.82rem; color: var(--text-muted);
  margin-top: 0.2rem; line-height: 1.5;
}

/* ─── Partners (in hero) ─── */
.hero-partners {
  display: flex; align-items: center;
  gap: 1.25rem; flex-wrap: wrap;
  margin-top: 2.25rem;
}

/* The class sets display:flex, which would otherwise beat the UA [hidden] rule */
.hero-partners[hidden] { display: none; }

.partners-label {
  font-size: 0.7rem; font-weight: 700; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: 0.18em;
  white-space: nowrap;
}

.partners-logos {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}

/* Sits on top of the hero image, so the chip needs its own backdrop. */
.partner {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: rgba(8, 8, 16, 0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius); transition: var(--transition);
}

.partner:hover {
  border-color: var(--cherry);
  background: rgba(8, 8, 16, 0.75);
  box-shadow: var(--shadow-cherry);
  transform: translateY(-2px);
}

.partner-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  opacity: 0.9;
  transition: var(--transition);
}

.partner:hover .partner-icon { opacity: 1; transform: scale(1.06); }

.partner-text { display: flex; flex-direction: column; line-height: 1.25; }

.partner-text strong {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem; font-weight: 700; color: var(--text);
}

.partner-text small { font-size: 0.72rem; color: var(--text-muted); }

/* ─── Section ─── */
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }

.container {
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.8rem;
}

.section-title {
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 1rem; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.08em;
}

.section-title::before {
  content: '';
  display: block; width: 4px; height: 18px;
  background: var(--cherry); border-radius: 2px;
}

.section-link {
  font-size: 0.85rem; color: var(--cherry); font-weight: 600;
  display: flex; align-items: center; gap: 0.4rem;
  transition: var(--transition);
}

.section-link:hover { color: var(--cherry-light); gap: 0.6rem; }

/* ─── Browse Section (2-column) ─── */
.browse-section {
  display: grid; grid-template-columns: 260px 1fr; gap: 2rem;
  align-items: start;
}

/* ─── Categories Panel ─── */
.categories-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem; position: sticky; top: 90px;
}

.categories-panel h3 {
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 1rem;
}

.category-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.75rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition); gap: 0.7rem;
  margin-bottom: 2px;
}

.category-item:hover { background: rgba(232, 23, 78, 0.08); }
.category-item.active { background: rgba(232, 23, 78, 0.12); }

.cat-left {
  display: flex; align-items: center; gap: 0.6rem;
}

.cat-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}

.cat-name { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.cat-count {
  font-size: 0.75rem; color: var(--text-muted);
  background: var(--bg-3); padding: 2px 7px;
  border-radius: 20px;
}

.view-all-cats {
  display: flex; align-items: center; gap: 0.4rem;
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem; color: var(--cherry); font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.view-all-cats:hover { gap: 0.6rem; }

/* ─── Mod Cards ─── */
.mods-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2rem;
}

.mod-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: var(--transition); cursor: pointer;
  position: relative; display: flex; flex-direction: column;
}

.mod-card:hover {
  border-color: var(--cherry);
  transform: translateY(-4px);
  box-shadow: var(--shadow-cherry), var(--shadow-card);
}

.mod-card-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-3); overflow: hidden; position: relative;
}

.mod-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}

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

.mod-card-thumb .mod-icon-overlay {
  position: absolute; bottom: 8px; left: 8px;
  width: 40px; height: 40px; border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.2);
  overflow: hidden; background: var(--bg-2);
}

.mod-card-thumb .mod-icon-overlay img { width: 100%; height: 100%; object-fit: cover; }

.mod-featured-badge {
  position: absolute; top: 8px; right: 8px;
  background: linear-gradient(135deg, var(--cherry), #a00030);
  color: #fff; font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mod-card-body {
  padding: 0.9rem; flex: 1; display: flex; flex-direction: column;
}

.mod-category-badge {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 0.4rem;
}

.mod-card-title {
  font-size: 0.95rem; font-weight: 700; color: var(--text);
  margin-bottom: 0.35rem; line-height: 1.3;
}

.mod-card-desc {
  font-size: 0.78rem; color: var(--text-muted);
  line-height: 1.5; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.mod-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.8rem; padding-top: 0.8rem;
  border-top: 1px solid var(--border-light);
}

.mod-stat {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; color: var(--text-muted);
}

.mod-stat svg { width: 13px; height: 13px; }
.mod-stat.rating { color: #f59e0b; }

/* ─── Stats Bar ─── */
.stats-bar {
  background: var(--bg-2); border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 2.5rem 0;
}

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
}

.stat-item {
  text-align: center; padding: 1.5rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: var(--transition);
}

.stat-item:hover { border-color: var(--cherry); transform: translateY(-2px); }

.stat-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }

.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem; font-weight: 900;
  background: linear-gradient(135deg, var(--text), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.2rem;
}

/* ─── Footer ─── */
.footer {
  background: var(--bg-2); border-top: 1px solid var(--border-light);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  font-size: 0.875rem; color: var(--text-muted);
  margin-top: 0.75rem; line-height: 1.7; max-width: 280px;
}

.footer-social {
  display: flex; gap: 0.6rem; margin-top: 1.2rem;
}

.footer-social a {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.9rem;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--cherry); border-color: var(--cherry);
  color: #fff; transform: translateY(-2px);
}

.footer-col h4 {
  font-size: 0.8rem; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { font-size: 0.875rem; color: var(--text-muted); transition: var(--transition); }
.footer-col ul a:hover { color: var(--cherry); padding-left: 4px; }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 2rem; border-top: 1px solid var(--border-light);
  font-size: 0.82rem; color: var(--text-subtle);
}

/* ─── Mods Page Layout ─── */
.mods-page {
  padding-top: calc(var(--nav-height) + 2rem);
  min-height: 100vh;
}

.mods-page-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 2rem;
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  align-items: start;
}

/* ─── Filter Sidebar (Mods Page) ─── */
.filter-sidebar {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  position: sticky; top: 90px;
}

.filter-section { margin-bottom: 1.8rem; }
.filter-section:last-child { margin-bottom: 0; }

.filter-section h4 {
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.9rem;
  display: flex; align-items: center; justify-content: space-between;
}

.filter-checkbox {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.5rem; border-radius: 6px;
  cursor: pointer; transition: var(--transition); margin-bottom: 2px;
}

.filter-checkbox:hover { background: rgba(232, 23, 78, 0.06); }

.filter-checkbox input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--cherry); cursor: pointer;
}

.filter-checkbox label {
  font-size: 0.875rem; color: var(--text); cursor: pointer; flex: 1;
}

.filter-checkbox .count {
  font-size: 0.72rem; color: var(--text-subtle);
}

/* ─── Search & Sort Bar ─── */
.mods-toolbar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}

.search-bar {
  flex: 1; display: flex; align-items: center; gap: 0.6rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 50px; padding: 0.6rem 1rem; min-width: 200px;
}

.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.9rem;
}

.search-bar input::placeholder { color: var(--text-muted); }
.search-bar:focus-within { border-color: var(--cherry); }
.search-bar svg { color: var(--text-muted); width: 18px; height: 18px; }

.sort-select {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 0.6rem 1rem;
  border-radius: 50px; font-size: 0.85rem; cursor: pointer; outline: none;
}

.sort-select:focus { border-color: var(--cherry); }

.view-toggle {
  display: flex; gap: 2px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 8px; padding: 2px;
}

.view-btn {
  padding: 0.4rem 0.6rem; border-radius: 6px;
  border: none; background: none; cursor: pointer;
  color: var(--text-muted); transition: var(--transition);
}

.view-btn.active { background: var(--cherry); color: #fff; }

/* ─── Mod List View ─── */
.mods-list { display: flex; flex-direction: column; gap: 0.75rem; }

.mod-list-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  transition: var(--transition); cursor: pointer;
}

.mod-list-item:hover {
  border-color: var(--cherry); transform: translateX(4px);
  box-shadow: -4px 0 0 var(--cherry), var(--shadow-card);
}

.mod-list-icon {
  width: 52px; height: 52px; border-radius: 10px;
  overflow: hidden; background: var(--bg-3); flex-shrink: 0;
}

.mod-list-icon img { width: 100%; height: 100%; object-fit: cover; }

.mod-list-info { flex: 1; min-width: 0; }
.mod-list-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.mod-list-desc {
  font-size: 0.82rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 0.2rem;
}

.mod-list-meta {
  display: flex; align-items: center; gap: 1rem;
  margin-top: 0.4rem;
}

.mod-badge {
  font-size: 0.68rem; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; text-transform: uppercase;
}

.mod-list-stats {
  display: flex; align-items: center; gap: 1.5rem;
  flex-shrink: 0;
}

/* ─── Pagination ─── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem; margin-top: 2.5rem;
}

.page-btn {
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
  background: var(--cherry); border-color: var(--cherry); color: #fff;
}

.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ─── Toast ─── */
.toast-container {
  position: fixed; bottom: 2rem; right: 2rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
}

.toast {
  min-width: 280px; padding: 0.9rem 1.2rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.875rem;
  box-shadow: var(--shadow); animation: slideIn 0.3s ease;
  display: flex; align-items: center; gap: 0.7rem;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.info { border-color: var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Loader ─── */
.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 4rem; flex-direction: column; gap: 1rem;
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border); border-top-color: var(--cherry);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

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

/* ─── Empty State ─── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; }

/* ─── 404 Page ─── */
.error-page {
  min-height: calc(100vh - var(--nav-height));
  padding: calc(var(--nav-height) + 4rem) 0 4rem;
  display: flex; align-items: center;
  text-align: center;
}

.error-code {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(5rem, 18vw, 10rem); font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, var(--cherry), var(--pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.error-title {
  font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 800;
  margin-top: 0.5rem;
}

.error-text {
  color: var(--text-muted); max-width: 480px;
  margin: 1rem auto 2rem; line-height: 1.7;
}

.error-search {
  display: flex; align-items: center; gap: 0.5rem;
  max-width: 460px; margin: 0 auto 1.5rem;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 50px; transition: var(--transition);
}

.error-search:focus-within { border-color: var(--cherry); box-shadow: 0 0 0 3px var(--cherry-glow); }
.error-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

.error-search input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--text); font-size: 0.95rem;
}

.error-search input::placeholder { color: var(--text-muted); }

.error-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; flex-wrap: wrap;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .browse-section { grid-template-columns: 220px 1fr; }
  .mods-page-layout { grid-template-columns: 240px 1fr; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-grid > *:last-child { display: none; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-burger { display: flex; }

  /* Dropdown panel below the navbar; .open is toggled by js/nav.js */
  .nav-links {
    display: none;
    position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem;
    background: rgba(8, 8, 16, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }

  .nav-links.open { display: flex; }
  .nav-links li { list-style: none; }
  .nav-links a { display: block; padding: 0.85rem 1rem; font-size: 1rem; }

  /* Make room for the burger — Discord is still linked from the hero and footer */
  .btn-discord { display: none; }
  .nav-search { width: 140px; }
  .nav-search:focus-within { width: 140px; }
  .hero-title { font-size: 2.2rem; }
  .browse-section { grid-template-columns: 1fr; }
  .mods-page-layout { grid-template-columns: 1fr; }
  .filter-sidebar { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mods-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-partners { gap: 0.75rem; margin-top: 1.75rem; }
  .partners-label { width: 100%; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }

  /* Keep logo + search + burger on one row without overflowing */
  .nav-logo { font-size: 1.1rem; margin-right: 0.5rem; gap: 8px; }
  .nav-logo img { width: 30px; height: 30px; }
  .nav-right { gap: 0.5rem; }
  .nav-search { padding: 0.4rem 0.7rem; }
  .nav-search, .nav-search:focus-within { width: 112px; }

  .mods-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .partners-logos { width: 100%; }
  .partner { flex: 1; min-width: 0; }
  .partner-text small { display: none; }
}

/* ─── Mod Detail ─── */
.mod-detail-hero {
  padding: calc(var(--nav-height) + 3rem) 0 3rem;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  background-color: var(--bg-2);
  background-size: cover;
  background-position: center 35%;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.mod-detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,15,20,0.6) 0%, rgba(15,15,20,0.95) 100%);
  z-index: 1;
  pointer-events: none;
}

.mod-detail-hero .container {
  width: 100%;
  position: relative;
  z-index: 2;
}

.mod-detail-header {
  display: flex; align-items: flex-start; gap: 1.5rem;
}

.mod-detail-icon {
  width: 80px; height: 80px; border-radius: 16px;
  overflow: hidden; background: var(--bg-3);
  flex-shrink: 0; border: 2px solid var(--border);
}

.mod-detail-icon img { width: 100%; height: 100%; object-fit: cover; }

.mod-detail-info h1 { font-size: 2rem; margin-bottom: 0.3rem; }
.mod-detail-info p { font-size: 0.9rem; color: var(--text-muted); max-width: 600px; }

.mod-detail-meta {
  display: flex; align-items: center; gap: 1.5rem;
  margin-top: 1rem; flex-wrap: wrap;
}

.meta-item {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--text-muted);
}

.mod-detail-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 2rem;
  padding: 2rem 0;
}

.mod-content {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
}

.mod-content h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.mod-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 1rem; }
.mod-content ul, .mod-content ol { padding-left: 1.5rem; color: var(--text-muted); }
.mod-content li { margin-bottom: 0.4rem; line-height: 1.6; }
.mod-content h3 { font-size: 1.1rem; margin: 1.5rem 0 0.75rem; color: var(--cherry); }

.mod-sidebar-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-bottom: 1rem;
}

.mod-sidebar-card h4 {
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem;
}

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); }
.info-value { color: var(--text); font-weight: 500; }

.loader-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  margin-right: 0.3rem; margin-bottom: 0.3rem;
}

.loader-forge { background: rgba(255, 140, 0, 0.15); color: #ff8c00; border: 1px solid rgba(255, 140, 0, 0.3); }
.loader-fabric { background: rgba(100, 180, 100, 0.15); color: #64b464; border: 1px solid rgba(100, 180, 100, 0.3); }
.loader-quilt { background: rgba(150, 100, 200, 0.15); color: #9664c8; border: 1px solid rgba(150, 100, 200, 0.3); }
.loader-neoforge { background: rgba(255, 80, 0, 0.15); color: #ff5000; border: 1px solid rgba(255, 80, 0, 0.3); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.5s ease forwards; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--card-hover) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
