/* Modern CSS Reset & Variables */
:root {
  --strava-orange: #FC4C02;
  --strava-orange-dark: #E34402;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --text-primary: #edf2f7;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --border-color: #2d3748;
  --success: #48bb78;
  --danger: #fc8181;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0f0f1a 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--bg-card) 0%, #0f1629 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow);
}

header .brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header img {
  width: 50px;
  height: 50px;
  border-radius: 10px;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--strava-orange) 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav {
  display: flex;
  gap: 0.5rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

nav a:hover {
  color: var(--text-primary);
  background: rgba(252, 76, 2, 0.1);
  border-color: var(--strava-orange);
}

/* Main Content */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  padding-bottom: 100px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

/* Typography */
h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--strava-orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Links */
a {
  color: var(--strava-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--strava-orange-dark);
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.3s;
  border-radius: 28px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: var(--text-primary);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--strava-orange) 0%, #ff6b35 100%);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

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

/* Latest Run Card */
.latest-run {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(252, 76, 2, 0.05) 100%);
  border-left: 4px solid var(--strava-orange);
}

.latest-run .run-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.latest-run .run-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.run-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

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

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Table */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: rgba(0, 0, 0, 0.3);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody tr:last-child td {
  border-bottom: none;
}

.faster {
  color: var(--success);
  font-weight: 600;
}

.slower {
  color: var(--danger);
  font-weight: 600;
}

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem;
  position: fixed;
  bottom: 0;
  width: 100%;
}

footer a {
  color: var(--text-secondary);
}

footer a:hover {
  color: var(--strava-orange);
}

/* Home Content */
.home-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.home-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.home-content strong {
  color: var(--strava-orange);
}

.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, var(--strava-orange) 0%, #ff6b35 100%);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  margin-top: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
  }
  
  .run-stats {
    gap: 1rem;
  }
  
  main {
    padding: 1rem;
  }
  
  th, td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');
