/* ============================================================
   LI Demos — Custom Styles
   Dark developer dashboard aesthetic, Bootstrap-enhanced
   ============================================================ */

/* ── CSS Custom Properties ───────────────────────────────────────────────── */
:root {
  --bg-base: #0d0d0f;
  --bg-surface: #16161a;
  --bg-card: #1c1c22;
  --bg-card-hover: #222229;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(99, 102, 241, 0.35);

  --text-primary: #f0f0f5;
  --text-secondary: #9898a8;
  --text-muted: #5a5a6a;

  --accent: #6366f1; /* indigo */
  --accent-hover: #818cf8;

  --live-color: #22c55e;
  --beta-color: #f59e0b;
  --offline-color: #ef4444;

  --radius-card: 14px;
  --radius-badge: 6px;
  --radius-btn: 8px;

  --transition-base: 200ms ease;
  --transition-card: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

/* ── Base Reset / Global ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Hero / Header ───────────────────────────────────────────────────────── */
.site-hero {
  background: linear-gradient(160deg, #12121a 0%, #15152b 50%, #0d0d0f 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow behind the hero */
.site-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
}

/* Logo */
.hero-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.logo-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 12px var(--accent),
    0 0 28px rgba(99, 102, 241, 0.4);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    box-shadow:
      0 0 12px var(--accent),
      0 0 28px rgba(99, 102, 241, 0.4);
  }
  50% {
    opacity: 0.75;
    box-shadow:
      0 0 6px var(--accent),
      0 0 14px rgba(99, 102, 241, 0.2);
  }
}

.logo-text {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #f0f0f5 30%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* Stats Row */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.stat-pill i {
  font-size: 0.7rem;
}

/* Helper color classes used in EJS */
.text-success-custom {
  color: var(--live-color) !important;
}
.text-warning-custom {
  color: var(--beta-color) !important;
}
.text-danger-custom {
  color: var(--offline-color) !important;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.site-main {
  padding: 3rem 0 4rem;
}

/* Section label */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

/* ── App Cards ────────────────────────────────────────────────────────────── */
.app-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition:
    transform var(--transition-card),
    border-color var(--transition-card),
    box-shadow var(--transition-card),
    background-color var(--transition-card);
  position: relative;
  overflow: hidden;
}

/* Top-left corner accent line */
.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--accent) 0%, transparent 100%);
  border-radius: 0 0 4px 4px;
  transition: height var(--transition-card);
}

.app-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(99, 102, 241, 0.15);
}

.app-card:hover::before {
  height: 60%;
}

/* ── Card Top (meta badges) ──────────────────────────────────────────────── */
.card-top {
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Category Badge */
.category-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-badge);
  font-family: var(--font-mono);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}

.status-badge i {
  font-size: 0.48rem;
}

.status-live {
  background: rgba(34, 197, 94, 0.12);
  color: var(--live-color);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-live i {
  animation: blink-live 1.8s ease-in-out infinite;
}

@keyframes blink-live {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.status-beta {
  background: rgba(245, 158, 11, 0.12);
  color: var(--beta-color);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-offline {
  background: rgba(239, 68, 68, 0.1);
  color: var(--offline-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Card Body ────────────────────────────────────────────────────────────── */
.card-body-content {
  flex: 1;
  margin-bottom: 1.25rem;
}

.app-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  letter-spacing: -0.2px;
}

.app-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ── Card Footer / Launch Button ─────────────────────────────────────────── */
.card-footer-content {
  margin-top: auto;
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-hover);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-btn);
  padding: 0.5rem 1rem;
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base),
    box-shadow var(--transition-base);
  cursor: pointer;
}

.btn-launch:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(99, 102, 241, 0.55);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.25);
  text-decoration: none;
}

.btn-launch--disabled {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-btn);
  padding: 0.5rem 1rem;
  font-size: 0.83rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0.7;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 0;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer-brand {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── Responsive Tweaks ────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .logo-text {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .site-hero {
    padding: 2.5rem 0 2rem;
  }
}
