:root {
  color-scheme: dark;
  /* Cyberpunk color palette */
  --bg: #0a0a0f;
  --bg-gradient: linear-gradient(180deg, #0f0a18 0%, #0a0a0f 50%, #080810 100%);
  --panel: #12101a;
  --panel-light: #1a1525;
  --card: #14111d;
  --card-hover: #1c1828;
  --text: #f0e8ff;
  --text-secondary: #b8a8d0;
  --muted: #6b5f80;

  /* Neon colors */
  --neon-cyan: #00f5ff;
  --neon-magenta: #ff00aa;
  --neon-purple: #bf5fff;
  --neon-pink: #ff6ec7;
  --neon-blue: #00d4ff;

  /* Primary accent - cyan */
  --accent: var(--neon-cyan);
  --accent-glow: rgba(0, 245, 255, 0.4);
  --accent-dim: rgba(0, 245, 255, 0.15);

  /* Secondary accent - magenta/pink */
  --accent2: var(--neon-magenta);
  --accent2-glow: rgba(255, 0, 170, 0.4);

  /* Success - neon green */
  --success: #00ff88;
  --success-glow: rgba(0, 255, 136, 0.4);

  --border: rgba(191, 95, 255, 0.12);
  --border-light: rgba(191, 95, 255, 0.2);
  --border-glow: rgba(0, 245, 255, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 40px rgba(191, 95, 255, 0.05);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-neon: 0 0 20px var(--accent-glow), 0 0 40px rgba(0, 245, 255, 0.2);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  position: relative;
}

/* Subtle grid overlay for cyberpunk feel */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(191, 95, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 95, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* App container */
.app {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

/* Hero section */
.hero {
  padding: 48px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-copy {
  text-align: center;
}

.eyebrow {
  color: var(--neon-magenta);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
  text-shadow: 0 0 10px var(--accent2-glow);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple), var(--neon-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px var(--accent-glow);
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 300px;
  margin: 0 auto;
  display: none;
}

.data-source {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Progress display */
.progress-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 16px 0;
}

.progress-completed {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px var(--accent-glow);
}

.progress-separator {
  font-size: 1.5rem;
  color: var(--muted);
  font-weight: 300;
}

.progress-total {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--muted);
}

.progress-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 8px;
  text-transform: lowercase;
}

/* Filters - Mobile optimized */
.filters {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 0 -16px;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filters label {
  font-size: 0.7rem;
  color: var(--neon-purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

select,
input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel-light);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23bf5fff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px var(--accent-glow);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.5;
  cursor: pointer;
}

.filter-summary {
  display: none;
}

/* Schedule container */
.schedule {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
}

/* Day cards */
.day-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
}

.day-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-magenta));
}

.day-header {
  padding: 16px 16px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(191, 95, 255, 0.08), transparent);
}

.day-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
  min-width: 180px;
  color: var(--text);
}

.day-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.day-meta span {
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--neon-cyan);
}

.phase-pill {
  background: linear-gradient(135deg, rgba(255, 0, 170, 0.2), rgba(191, 95, 255, 0.2));
  border: 1px solid rgba(255, 0, 170, 0.4);
  color: var(--neon-pink);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(255, 110, 199, 0.5);
}

/* Section blocks */
.section-block {
  padding: 12px 16px 16px;
}

.section-block + .section-block {
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 10px;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 10px var(--accent-glow);
}

.section-title::before {
  content: "";
  display: block;
  width: 3px;
  height: 12px;
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Exercise cards - The star of the show */
.exercise-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
}

.exercise-card:last-child {
  margin-bottom: 0;
}

.exercise-card:active {
  transform: scale(0.98);
  border-color: var(--border-light);
}

.exercise-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exercise-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.exercise-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exercise-meta span {
  background: rgba(191, 95, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(191, 95, 255, 0.2);
}

.exercise-notes {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  line-height: 1.5;
}

/* Log toggle button */
.exercise-log-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(191, 95, 255, 0.08);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--neon-purple);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exercise-log-toggle:hover {
  background: rgba(191, 95, 255, 0.15);
  border-color: var(--neon-purple);
}

.exercise-log-toggle .toggle-icon {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neon-cyan);
}

/* Collapsible inputs container */
.exercise-inputs {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
  margin-top: 0;
}

.exercise-inputs.expanded {
  max-height: 400px;
  overflow: visible;
  opacity: 1;
  margin-top: 12px;
}

/* Input row layout */
.exercise-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weight-group {
  flex: 1;
  min-width: 140px;
}

.rpe-group {
  flex-shrink: 0;
  width: 70px;
}

.input-label {
  font-size: 0.7rem;
  color: var(--neon-purple);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Weight inputs container */
.weight-inputs {
  display: flex;
  gap: 6px;
}

/* Weight input */
.exercise-weight-input {
  flex: 1;
  min-width: 60px;
  padding: 10px 12px;
  background: var(--panel-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.exercise-weight-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px var(--accent-glow), 0 0 15px var(--accent-glow);
}

.exercise-weight-input::placeholder {
  color: var(--muted);
}

/* Unit select */
.exercise-unit-select {
  width: 65px;
  padding: 10px 8px;
  padding-right: 24px;
  background: var(--panel-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--neon-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300f5ff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: all 0.2s ease;
}

.exercise-unit-select:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* RPE select */
.exercise-rpe-select {
  width: 100%;
  padding: 10px 12px;
  padding-right: 28px;
  background: var(--panel-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23bf5fff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: all 0.2s ease;
}

.exercise-rpe-select:focus {
  outline: none;
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 2px var(--accent2-glow);
}

/* Notes row */
.exercise-notes-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* User notes textarea */
.exercise-user-notes {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1.4;
  resize: vertical;
  min-height: 60px;
  transition: all 0.2s ease;
}

.exercise-user-notes:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px var(--accent-glow), 0 0 15px var(--accent-glow);
}

.exercise-user-notes::placeholder {
  color: var(--muted);
}

/* Complete button - Big and tappable with neon glow */
.exercise-complete-button {
  width: 100%;
  margin-top: 12px;
  padding: 14px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, var(--neon-magenta), var(--neon-purple));
  color: white;
  box-shadow: 0 4px 20px rgba(255, 0, 170, 0.4), 0 0 30px rgba(255, 0, 170, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.exercise-complete-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 0, 170, 0.5), 0 0 40px rgba(255, 0, 170, 0.3);
}

.exercise-complete-button:active {
  transform: translateY(0) scale(0.98);
}

/* Completed state - neon green */
.exercise-complete {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.08), var(--card));
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.exercise-complete .exercise-title {
  color: var(--success);
  position: relative;
  text-shadow: 0 0 10px var(--success-glow);
}

.exercise-complete .exercise-title::after {
  content: " ✓";
  font-size: 0.9em;
}

.exercise-complete .exercise-complete-button {
  background: rgba(0, 255, 136, 0.15);
  color: var(--success);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.exercise-complete .exercise-complete-button:hover {
  background: rgba(0, 255, 136, 0.2);
  transform: none;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* Empty state */
.empty-state {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--border);
}

.empty-state::before {
  content: "⚡";
  display: block;
  font-size: 2.5rem;
  margin-bottom: 12px;
}

/* Rest day card */
.rest-day-card {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.05), rgba(191, 95, 255, 0.05));
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  border: 1px solid var(--border);
  margin-top: 20px;
}

.rest-day-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.rest-day-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.rest-day-message {
  font-size: 1rem;
  color: var(--neon-cyan);
  margin-bottom: 16px;
  text-shadow: 0 0 10px var(--accent-glow);
}

.rest-day-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Desktop enhancements */
@media (min-width: 480px) {
  .app {
    padding: 0 24px 100px;
  }

  h1 {
    font-size: 2.4rem;
  }

  .subtitle {
    display: block;
  }

  .summary-grid {
    gap: 12px;
  }

  .summary-card {
    padding: 16px 12px;
  }

  .summary-value {
    font-size: 1.75rem;
  }

  .exercise-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .exercise-title {
    flex: 1;
  }

  .exercise-meta {
    flex-shrink: 0;
  }
}

@media (min-width: 640px) {
  .app {
    max-width: 700px;
  }

  .hero {
    padding: 64px 0 32px;
  }

  .filters {
    margin: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 16px;
  }

  .filter-summary {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--neon-cyan);
    white-space: nowrap;
    text-shadow: 0 0 10px var(--accent-glow);
  }

  .day-header {
    padding: 20px;
  }

  .section-block {
    padding: 16px 20px 20px;
  }

  .exercise-card {
    padding: 18px;
  }
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .app {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
  box-shadow: 0 0 15px var(--accent-glow);
}

/* Selection color */
::selection {
  background: var(--neon-magenta);
  color: var(--bg);
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-purple);
}
