

[data-theme="light"] {
  --bg-color: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.8);
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary: #0284c7;
  --secondary: #6366f1;
  --border-color: rgba(0, 0, 0, 0.1);
}

:root {
  --bg-color: #0b0f19;
  --bg-card: rgba(20, 27, 45, 0.6);
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #06b6d4;
  --secondary: #8b5cf6;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(12px);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

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

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

/* Header */
.site-header {
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 20px 0;
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo span {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
nav a {
  margin-left: 20px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}
nav a:hover { color: var(--text-main); }
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-outline {
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}
.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
}

/* Hero */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Filters */
.filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Grid - Dense HF Style */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 60px;
}
.asset-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 1;
}
.asset-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 10;
}
.preview-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  font-size: 0.85rem;
  color: var(--text-main);
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 0 10px;
}
.asset-card:hover .preview-content {
  max-height: 200px;
  opacity: 1;
  margin-top: 10px;
  padding: 10px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge {
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}
.badge-dataset { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.badge-model { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.badge-tool { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.modality { color: var(--text-muted); font-size: 0.8rem; }

.asset-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  line-height: 1.3;
  color: var(--text-main);
}
.description {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-grow: 1;
  margin-bottom: 12px;
  line-height: 1.4;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

/* Asset Detail Page */
.asset-detail {
  max-width: 800px;
  margin: 60px auto;
}
.asset-header {
  margin-bottom: 40px;
}
.asset-title {
  font-size: 3rem;
  font-weight: 800;
  margin: 15px 0;
  line-height: 1.2;
}
.badge-outline {
  display: inline-block;
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-right: 10px;
  color: var(--text-muted);
}
.asset-telemetry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 5px;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.asset-content h2 { margin-bottom: 20px; }
.content-body {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}


/* Reading Progress Bar */
.progress-container {
  width: 100%;
  height: 4px;
  background: transparent;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}
.progress-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
}


.reading-time {
  display: inline-block;
  background: rgba(6, 182, 212, 0.15);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 15px;
}


#toast {
  visibility: hidden;
  min-width: 250px;
  background-color: var(--primary);
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 16px;
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-weight: 600;
}
#toast.show {
  visibility: visible;
  animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
@keyframes fadein {
  from {bottom: 0; opacity: 0;}
  to {bottom: 30px; opacity: 1;}
}
@keyframes fadeout {
  from {bottom: 30px; opacity: 1;}
  to {bottom: 0; opacity: 0;}
}


/* Back to Top FAB */
#backToTop {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  border: none;
  outline: none;
  background-color: var(--primary);
  color: white;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0px 4px 15px rgba(0,0,0,0.4);
  transition: background-color 0.3s, transform 0.2s;
}
#backToTop:hover {
  background-color: var(--secondary);
  transform: translateY(-3px);
}

/* Stats Dashboard */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto 50px;
  padding: 0 20px;
}
.stat-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}
.stat-box:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.15);
}
.stat-box .number {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-bottom: 5px;
}
.stat-box .label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* CareHub Promo Banner */
.carehub-promo {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px;
  max-width: 1000px;
  margin: 0 auto 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}
.carehub-promo-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-main);
}
.carehub-promo-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 650px;
}
.carehub-promo-btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .stats-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  .carehub-promo {
    flex-direction: column;
    text-align: center;
    padding: 25px;
  }
  .carehub-promo-content p {
    margin: 0 auto;
  }
  .leaderboard-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-dashboard {
    grid-template-columns: 1fr;
  }
  .site-header .container {
    justify-content: center;
  }
}

.leaderboard-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  padding: 10px 0;
  padding-bottom: env(safe-area-inset-bottom, 10px);
}
.mobile-bottom-nav ul {
  list-style: none;
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 0;
}
.mobile-bottom-nav li {
  flex: 1;
  text-align: center;
}
.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.mobile-bottom-nav a:hover,
.mobile-bottom-nav a.active {
  color: var(--primary);
}
.mobile-bottom-nav svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }
  body {
    padding-bottom: 70px; /* Space for the bottom nav */
  }
}
