/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  box-shadow: var(--shadow-sm);
}

.site-logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-logo:hover {
  text-decoration: none;
}

.site-logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-contract));
  border-radius: var(--radius-full);
}

.site-nav {
  display: flex;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: var(--color-bg);
  color: var(--color-primary);
  text-decoration: none;
}

/* Footer */
.site-footer {
  padding: var(--space-lg) var(--space-md);
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow var(--transition), background var(--transition);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-ghost {
  color: var(--color-text-muted);
}

.btn-ghost:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Cards */
.card {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-body {
  padding: var(--space-lg);
}

/* Course card */
.course-card {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.course-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.course-card-header {
  padding: var(--space-lg);
  padding-bottom: var(--space-sm);
}

.course-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.course-card-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.course-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: 0 var(--space-lg) var(--space-lg);
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.tag-level-beginner {
  background: #e8f5e9;
  color: #2e7d32;
}

.tag-level-intermediate {
  background: #fff3e0;
  color: #e65100;
}

.tag-level-advanced {
  background: #fce4ec;
  color: #c2185b;
}

.tag-progress {
  background: var(--color-primary);
  color: #fff;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.filter-btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Hero */
.hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto var(--space-lg);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  text-align: center;
  padding: var(--space-lg);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* Timer ring */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--space-lg);
}

.timer-ring-wrapper {
  position: relative;
  width: var(--ring-size);
  height: var(--ring-size);
}

.timer-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background var(--transition), transform 0.6s ease;
}

.timer-ring-inner {
  width: 75%;
  height: 75%;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 1;
}

.timer-ring.contract {
  background: radial-gradient(circle, var(--color-contract) 0%, #9b8bc4 100%);
  transform: scale(0.92);
}

.timer-ring.relax {
  background: radial-gradient(circle, var(--color-relax) 0%, #a8d4b0 100%);
  transform: scale(1.05);
}

.timer-ring.rest,
.timer-ring.countdown,
.timer-ring.ready {
  background: radial-gradient(circle, var(--color-rest) 0%, #d0d8d8 100%);
  transform: scale(1);
}

.timer-ring.complete {
  background: radial-gradient(circle, var(--color-success) 0%, #58d68d 100%);
}

.timer-progress-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.timer-progress-ring circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.timer-progress-bg {
  stroke: rgba(255, 255, 255, 0.3);
}

.timer-progress-fill {
  stroke: rgba(255, 255, 255, 0.9);
  transition: stroke-dashoffset 0.1s linear;
}

.timer-phase-label {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.timer-countdown {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.timer-cue {
  text-align: center;
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 320px;
  padding: 0 var(--space-md);
  min-height: 3em;
}

.timer-meta {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.timer-controls {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}

/* Learn page */
.learn-section {
  margin-bottom: var(--space-xl);
}

.learn-section h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  color: var(--color-primary);
}

.learn-section p,
.learn-section li {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.learn-steps {
  counter-reset: step;
}

.learn-steps li {
  position: relative;
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

.learn-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.warning-box {
  background: #fff8e1;
  border-left: 4px solid var(--color-accent);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-md) 0;
}

.warning-box p {
  color: var(--color-text);
  font-size: 0.875rem;
}

/* Course grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
}

/* Settings toggle */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.toggle.active {
  background: var(--color-primary);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle.active::after {
  transform: translateX(20px);
}

/* Week selector for ladder course */
.week-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  justify-content: center;
}

.week-btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  font-size: 0.8125rem;
  cursor: pointer;
}

.week-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
