/* ============================================
   CordList Homepage — Premium Dark Space Theme
   Polished layout per detailed spec
   ============================================ */

/* === VARIABLES === */
:root {
  --hp-bg: #05060d;
  --hp-card: rgba(10, 12, 24, 0.85);
  --hp-surface: #101321;
  --hp-border: rgba(139, 92, 246, 0.18);
  --hp-border-hover: rgba(139, 92, 246, 0.55);
  --hp-text: #ffffff;
  --hp-text-secondary: #9ca3af;
  --hp-purple: #8b5cf6;
  --hp-blue-purple: #6366f1;
  --hp-glow: rgba(139, 92, 246, 0.25);
  --hp-glow-strong: rgba(124, 58, 237, 0.28);
  --hp-radius: 20px;
  --hp-container: min(1420px, calc(100% - 48px));
}

/* === BODY BG WITH SUBTLE AMBIENT LIGHTING (#4) === */
body.homepage-body {
  background:
    radial-gradient(circle at 68% 22%, rgba(124,58,237,.075), transparent 30%),
    radial-gradient(circle at 18% 52%, rgba(99,102,241,.035), transparent 25%),
    radial-gradient(circle at 65% 75%, rgba(139,92,246,.025), transparent 30%),
    var(--hp-bg);
}

/* === STARFIELD CANVAS === */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* === PAGE CONTAINER WIDTH (#9) === */
.hero-container,
.featured-container,
.all-servers-container {
  width: var(--hp-container);
  margin-inline: auto;
}

/* =============================================
   HERO SECTION (#1 compact, #2 big planet)
   ============================================= */
.hero-section {
  position: relative;
  padding: 80px 0 20px;
  overflow: hidden;
  z-index: 10;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

/* === HERO LEFT === */
.hero-left {
  max-width: 580px;
  position: relative;
  z-index: 5;
}

/* Badge Pill */
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid var(--hp-border);
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hp-text-secondary);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Hero Heading (#3 — tighter, stronger gradient) */
.hero-title {
  font-size: clamp(52px, 5vw, 76px);
  font-weight: 800;
  color: var(--hp-text);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.hero-title-accent {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.hero-subtitle {
  font-size: 15px;
  color: var(--hp-text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 440px;
}

/* === SEARCH BAR (#10 — wider, purple glow focus) === */
.hero-search-form {
  margin-bottom: 24px;
  max-width: 560px;
}

.hero-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(8,10,20,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hp-border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hero-search-wrap:focus-within {
  border-color: rgba(139,92,246,.65);
  box-shadow: 0 0 0 3px rgba(139,92,246,.08), 0 0 30px rgba(124,58,237,.08);
}

.hero-search-icon {
  position: absolute;
  left: 20px;
  width: 18px;
  height: 18px;
  color: var(--hp-text-secondary);
  pointer-events: none;
  opacity: 0.5;
}

.hero-search-input {
  width: 100%;
  padding: 15px 140px 15px 52px;
  font-size: 14px;
  font-weight: 400;
  color: var(--hp-text);
  background: transparent;
  border: none;
  border-radius: 50px;
  outline: none;
  font-family: inherit;
}

.hero-search-input::placeholder {
  color: rgba(156, 163, 175, 0.45);
}

.hero-search-input:focus,
.hero-search-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.hero-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 11px 28px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  font-family: inherit;
  white-space: nowrap;
}

.hero-search-btn:hover {
  opacity: 0.9;
  transform: translateY(-50%) scale(1.02);
}

/* === CATEGORY PILLS (#11) === */
.hero-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--hp-text-secondary);
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  text-decoration: none;
  transition: all 0.2s ease;
}

.hero-cat-pill:hover {
  border-color: var(--hp-border-hover);
  background: rgba(124, 58, 237, 0.10);
  color: var(--hp-text);
  transform: translateY(-1px);
}

.hero-cat-add {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
  color: #a78bfa;
  font-weight: 600;
}

.hero-cat-add:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.6);
  color: #c4b5fd;
}

/* === HERO RIGHT — SATURN (#2 much bigger, glow) === */
.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-saturn-wrap {
  position: relative;
  width: 130%;
  max-width: 700px;
  margin-left: -15%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Large purple glow behind planet */
.hero-saturn-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  height: 95%;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.16) 0%,
    rgba(99, 102, 241, 0.07) 35%,
    transparent 68%
  );
  border-radius: 50%;
  pointer-events: none;
  filter: blur(35px);
}

.hero-saturn-img {
  width: 95%;
  height: 95%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  mask-image: radial-gradient(circle, #000 50%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle, #000 50%, transparent 78%);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 50px rgba(139, 92, 246, 0.2));
  animation: planetFloat 12s ease-in-out infinite;
}

/* Planet float animation (#12) */
@keyframes planetFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* =============================================
   FEATURED SERVERS SECTION (#5, #6, #7)
   ============================================= */
.featured-section {
  position: relative;
  z-index: 10;
  padding: 20px 0 35px;
}

/* Subtle glow behind featured section */
.featured-section::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(109, 40, 217, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.featured-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Featured Header Row (#7) */
.featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.featured-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.featured-icon { font-size: 18px; }

.featured-title {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.featured-divider {
  width: 1px;
  height: 16px;
  background: rgba(139, 92, 246, 0.3);
  margin: 0 4px;
}

.featured-subtitle {
  font-size: 13px;
  color: #6f7789;
}

.featured-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hp-text);
  background: rgba(12,14,27,.75);
  border: 1px solid rgba(139,92,246,.22);
  text-decoration: none;
  transition: all 0.2s ease;
}

.featured-browse-btn:hover {
  background: rgba(124,58,237,.09);
  border-color: rgba(139,92,246,.48);
  transform: translateY(-1px);
}

/* Hide old classes */
.featured-left { display: none; }
.featured-heading { display: none; }

/* Featured Cards Grid */
.featured-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* === FEATURED CARDS — banner top, body below === */
.feat-overlay-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(13,15,28,.98), rgba(8,10,20,.98));
  border: 1px solid rgba(139,92,246,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 18px 40px rgba(0,0,0,.22);
  border-radius: var(--hp-radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  opacity: 0;
  animation: fadeInCard 0.45s ease forwards;
}

.feat-overlay-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139,92,246,.5);
  box-shadow: 0 20px 55px rgba(0,0,0,.35), 0 0 30px rgba(124,58,237,.12);
}

@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Banner */
.foc-banner {
  position: relative;
  height: 170px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--hp-surface);
}

.foc-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(8,10,20,.15) 72%, rgba(8,10,20,.92) 100%);
  pointer-events: none;
}

/* Badge */
.foc-badge {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(124,58,237,.25);
}

/* Body section below banner */
.foc-overlay,
.foc-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.foc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.foc-head img,
.foc-head div[style*="border-radius"] {
  transform: translateY(-18px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.foc-meta { min-width: 0; flex: 1; }

.foc-name {
  font-size: 14px;
  font-weight: 650;
  color: #f8fafc;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.foc-desc {
  font-size: 13px;
  color: #a1a7b5;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.foc-footer,
.foc-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 10px;
}

.foc-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #9097a8;
}

.foc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.foc-dot-online {
  background: #34d399;
  box-shadow: 0 0 7px rgba(52, 211, 153, 0.35);
}

.foc-dot-members {
  background: rgba(156, 163, 175, 0.5);
}

/* Icon in featured cards */
.foc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(139,92,246,.32);
  box-shadow: 0 5px 15px rgba(0,0,0,.35), 0 0 12px rgba(124,58,237,.08);
  transform: translateY(-18px);
}

.foc-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(139, 92, 246, 0.2);
  transform: translateY(-18px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Gold badge for Pro tier */
.foc-badge-gold {
  background: linear-gradient(135deg, #fde047, #f59e0b) !important;
  color: #111 !important;
  box-shadow: 0 4px 14px rgba(245,158,11,.20) !important;
}

/* Skeleton */
.featured-card-skeleton {
  background: var(--hp-card);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  overflow: hidden;
}
.fcs-banner { height: 170px; background: rgba(255,255,255,0.02); animation: skeletonPulse 2s infinite; }
.fcs-body { padding: 20px; }
.fcs-line { height: 12px; background: rgba(255,255,255,0.04); border-radius: 6px; margin-bottom: 10px; animation: skeletonPulse 2s infinite; }
@keyframes skeletonPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* =============================================
   ALL SERVERS SECTION (#8)
   ============================================= */
.all-servers-section {
  position: relative;
  z-index: 10;
  padding: 35px 0 70px;
}

.all-servers-container {
  display: flex;
  flex-direction: column;
}

.all-servers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.all-servers-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--hp-text);
  letter-spacing: -0.02em;
}

.all-servers-browse {
  font-size: 13px;
  color: #818cf8;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}
.all-servers-browse:hover { color: #a78bfa; }

.all-servers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* All Servers card overrides */
.all-servers-grid .srv-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  width: 100%;
  border-color: rgba(139, 92, 246, 0.15);
  border-radius: var(--hp-radius);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.all-servers-grid .srv-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139,92,246,.5);
  box-shadow: 0 18px 50px rgba(0,0,0,.3), 0 0 30px rgba(124,58,237,.12);
}

.all-servers-grid .srv-card .card-banner {
  height: 170px;
  flex-shrink: 0;
}

.all-servers-grid .srv-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.all-servers-grid .srv-card .card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  color: #a1a7b5;
  flex: 1;
}

.all-servers-grid .srv-card .card-actions {
  margin-top: auto;
}

.all-servers-grid .srv-card .join-btn {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 6px 18px rgba(99,102,241,.16);
}

.all-servers-grid .srv-card .join-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(99,102,241,.28);
}

/* === CTA SECTION === */
.cta-section {
  position: relative;
  z-index: 10;
  padding: 70px 0;
  text-align: center;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 250px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.06) 0%, transparent 65%);
  pointer-events: none;
}

.cta-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--hp-text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.cta-subtitle {
  font-size: 14px;
  color: var(--hp-text-secondary);
  margin-bottom: 24px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 32px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.cta-btn:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(124, 58, 237, 0.4);
}

/* === LOAD MORE === */
.load-more-wrap { text-align: center; margin-top: 36px; }
.load-more-btn {
  display: inline-flex;
  padding: 11px 28px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hp-text-secondary);
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.load-more-btn:hover {
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--hp-text);
  transform: translateY(-1px);
}

/* === ANIMATIONS (#12) === */
.hero-anim {
  opacity: 0;
  animation: heroFadeIn 0.5s ease forwards;
}
.ha-1 { animation-delay: 0s; }
.ha-2 { animation-delay: 0.06s; }
.ha-3 { animation-delay: 0.12s; }
.ha-4 { animation-delay: 0.18s; }
.ha-5 { animation-delay: 0.24s; }

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 1023px) {
  .hero-section { padding: 80px 0 30px; }
  .hero-container { grid-template-columns: 1fr; gap: 30px; }
  .hero-right { display: none; }
  .hero-left { max-width: 100%; }
  .hero-title { font-size: clamp(2rem, 7vw, 3rem); }
  .hero-search-form { max-width: 100%; }
}

@media (max-width: 900px) {
  .featured-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .all-servers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hero-section { padding: 70px 0 24px; }
  .hero-title { font-size: 2rem; line-height: 1.05; }
  .hero-subtitle { font-size: 14px; }
  .hero-search-input { font-size: 16px; padding: 14px 110px 14px 42px; }
  .hero-search-btn { padding: 9px 16px; font-size: 11px; right: 4px; }
  .hero-categories { gap: 7px; }
  .hero-cat-pill { padding: 7px 13px; font-size: 11.5px; }
  .featured-cards { grid-template-columns: 1fr; }
  .all-servers-grid { grid-template-columns: 1fr; }
  .featured-header { flex-direction: column; align-items: flex-start; }
  .featured-subtitle { display: none; }
  .foc-banner { height: 140px; }
}

@media (min-width: 1440px) {
  .hero-container, .featured-container, .all-servers-container { max-width: 1380px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-anim, .feat-overlay-card { opacity: 1 !important; animation: none !important; transform: none !important; }
  .live-dot { animation: none; }
  .hero-saturn-img { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Skeleton cards */
.skeleton-card {
  background: var(--hp-card);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  overflow: hidden;
}


/* Navbar polish */
body.homepage-body .nav-inner {
  background: rgba(18,22,55,.75) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(99,102,241,.18) !important;
  box-shadow: 0 10px 40px rgba(0,0,0,.18), 0 0 30px rgba(99,102,241,.035) !important;
}
