:root {
  /* 2026 Premium Palette */
  --primary: #FF5500;
  /* Vibrant Strava Orange */
  --primary-glow: rgba(255, 85, 0, 0.4);
  --bg-deep: #050510;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-main: #FFFFFF;
  --text-dim: rgba(255, 255, 255, 0.6);
  --transition-smooth: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

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

body {
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Immersive Background Orbs */
.background-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.3;
  pointer-events: none;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  animation: float 20s infinite alternate;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #6366F1 0%, transparent 70%);
  bottom: -50px;
  left: -50px;
  animation: float 25s infinite alternate-reverse;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #EC4899 0%, transparent 70%);
  top: 40%;
  left: 20%;
  animation: float 15s infinite alternate;
}

@keyframes float {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(40px, 40px) scale(1.1);
  }
}

/* Bento Layout */
.bento-container {
  max-width: 850px;
  width: 100%;
  padding: 4rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  animation: pageEnter 1s ease-out;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bento-node {
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 32px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.bento-node::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.bento-node:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.bento-node:hover::before {
  opacity: 1;
}

/* Hero Node */
.hero-node {
  text-align: center;
  padding: 3rem 2rem;
}



.community-banner {
  display: inline-flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.banner-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.banner-value {
  font-size: 1.25rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.features-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  background: rgba(255, 85, 0, 0.1);
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.features-link:hover {
  background: rgba(255, 85, 0, 0.2);
  transform: translateY(-2px);
}

/* --- Authenticated Dashboard --- */
.authenticated-node {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-quick-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.quick-stat {
    display: flex;
    flex-direction: column;
}

.quick-stat .stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-bright);
}

.quick-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 12px;
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-bright);
}

.toggle-btn {
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    background: #4B5563;
    color: white;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: #10B981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.settings-shortcut {
    font-size: 0.85rem;
    color: var(--strava-orange);
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Node Titles */
.node-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

/* Leaderboard List */
.leaderboard-container {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}

/* Custom Scrollbar */
.leaderboard-container::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.leaderboard-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.athlete-row {
  display: grid;
  grid-template-columns: 32px 48px minmax(100px, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
  animation: rowSlide 0.5s ease-out backwards;
  animation-delay: calc(var(--rank) * 0.05s);
  overflow: hidden; /* Safety */
}

.athlete-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 85, 0, 0.2);
  transform: translateX(8px);
}

.rank-badge {
  width: 32px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
}

.rank-badge {
  width: 36px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.rank-1 {
  color: #FCD34D;
  font-size: 1.2rem;
}

.rank-2 {
  color: #CBD5E1;
}

.rank-3 {
  color: #D97706;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
}

.generic-avatar {
  background: var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.athlete-info {
  flex: 1;
}

.athlete-name {
  font-weight: 700;
  font-size: 1rem;
}

.athlete-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.athlete-stats-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.summit-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0.4rem 0.6rem;
    border-radius: 12px;
}


.total-stat {
    background: rgba(255, 85, 0, 0.1);
    border: 1px solid rgba(255, 85, 0, 0.2);
}

.summit-icon {
    font-size: 0.75rem;
    margin-bottom: 2px;
    opacity: 0.7;
}

.summit-val {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
}


.total-stat .summit-val {
    color: var(--primary);
}

.athlete-info {
  flex: 1;
  min-width: 0; /* Critical for ellipsis */
}

.athlete-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.athlete-name a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.athlete-name a:hover {
    text-decoration: underline;
}

.health-badge {
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #000;
    background: #ffcc00;
    padding: 2px 10px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    cursor: help;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Connect Node */
.connect-node {
  background: linear-gradient(135deg, rgba(252, 76, 2, 0.1), transparent);
}

.node-subtitle {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Weather Node Fixes */
.weather-node {
  padding: 1.5rem 0;
}

.weather-bar {
  width: 100%;
}

.weather-track {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0 1rem;
}

.weather-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 80px;
  /* Uniform width for alignment */
  text-align: center;
}

.weather-day {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  height: 1rem;
  display: flex;
  align-items: center;
}

.weather-tiny-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.weather-temp {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
}

/* Official Strava Compliance Styles */
.strava-connect-btn {
  display: inline-block;
  height: 48px;
  position: relative;
  z-index: 10;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.strava-connect-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.strava-connect-img {
  height: 48px;
  /* Required by Strava Branding Guidelines */
  display: block;
}

.footer-brand {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-glass);
}

.powered-by-strava {
  height: 24px;
  opacity: 0.8;
  transition: var(--transition-smooth);
}

.powered-by-strava:hover {
  opacity: 1;
}

.footer-details {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  h1 {
    font-size: 2.75rem;
  }

  .bento-container {
    padding: 2rem 1rem;
  }
}
/* Post-Auth Success & Form Styles */
.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(34, 197, 94, 0.1);
  color: #22C55E;
  border-radius: 50%;
  padding: 1.5rem;
  margin: 0 auto 2rem;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
}

.summit-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.summit-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.strava-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.strava-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 12px 30px var(--primary-glow);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
