/* ========== Variables ========== */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-alt: #1e2231;
  --border: #2e3345;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --accent: #6c63ff;
  --accent-hover: #5a52e0;
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.1);
  --warning-border: rgba(251, 191, 36, 0.3);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);
  --success: #22c55e;
  --compound-bg: rgba(108, 99, 255, 0.15);
  --compound-border: rgba(108, 99, 255, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --max-width: 800px;
}

/* ========== Reset ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========== Base ========== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========== Layout ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}

/* ========== Header ========== */
.site-header {
  text-align: center;
  padding: 2rem 0 1rem;
}

.site-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.site-header h1 .accent {
  color: var(--accent);
}

.site-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-group .btn {
  flex: 1;
}

/* ========== Injury Card ========== */
.injury-card {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.injury-card .card-title {
  color: var(--warning);
}

.injury-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.injury-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid var(--warning-border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--warning);
}

.advice-list {
  list-style: none;
  padding: 0;
}

.advice-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--warning-border);
  font-size: 0.9rem;
  color: var(--text);
}

.advice-list li:last-child {
  border-bottom: none;
}

/* ========== Warning Card ========== */
.warning-card {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.warning-card .card-title {
  color: var(--danger);
}

.warning-card p {
  color: var(--text);
  font-size: 0.9rem;
}

/* ========== Tables ========== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

thead th {
  text-align: left;
  padding: 0.75rem;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

tbody tr:hover {
  background: var(--surface-alt);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
  font-style: italic;
}

/* ========== Badges ========== */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.badge-compound {
  background: var(--compound-bg);
  border: 1px solid var(--compound-border);
  color: var(--accent);
}

.badge-equipment {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ========== Plan Header ========== */
.plan-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.plan-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.plan-header .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ========== Ad Slot ========== */
.ad-slot {
  background: var(--surface-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  margin: 1rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== Equipment Section ========== */
.equipment-section {
  margin-top: 1rem;
}

.equipment-section h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.equipment-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.equipment-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  transition: border-color 0.2s;
}

.equipment-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* ========== Disclaimer ========== */
.disclaimer {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.disclaimer h3 {
  color: var(--danger);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.disclaimer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========== SEO Content ========== */
.seo-content {
  margin: 2rem 0;
}

.seo-content h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.seo-content h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.seo-content p {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.seo-content ul {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  font-size: 0.95rem;
}

.seo-content li {
  margin-bottom: 0.25rem;
}

/* ========== FAQ ========== */
.faq-section {
  margin: 2rem 0;
}

.faq-section h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.faq-answer {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========== Footer ========== */
.site-footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* ========== Utility ========== */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========== Print Styles ========== */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .ad-slot,
  .btn-group,
  .disclaimer,
  .seo-content,
  .faq-section,
  .site-footer,
  .equipment-section,
  #workout-form,
  .no-print {
    display: none !important;
  }

  .card {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid;
  }

  .injury-card {
    background: #fffbeb;
    border-color: #f59e0b;
  }

  .warning-card {
    background: #fef2f2;
    border-color: #ef4444;
  }

  table {
    font-size: 0.85rem;
  }

  thead th {
    background: #f3f4f6;
    color: #374151;
  }

  tbody td {
    border-bottom: 1px solid #e5e7eb;
  }

  .badge-compound {
    background: #ede9fe;
    color: #6c63ff;
    border-color: #6c63ff;
  }

  .plan-header h2,
  .plan-header .subtitle,
  .card-title {
    color: #000;
  }

  .injury-tag {
    background: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
  }
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .site-header h1 {
    font-size: 1.4rem;
  }

  .card {
    padding: 1rem;
  }

  .btn-group {
    flex-direction: column;
  }

  thead th,
  tbody td {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .badge {
    display: block;
    margin-left: 0;
    margin-top: 0.25rem;
    width: fit-content;
  }
}
