﻿:root {
  --bg: #090b10;
  --bg-2: #11151d;
  --bg-3: #171c26;
  --ink: #eef3ff;
  --muted: #8e98ab;
  --surface: rgba(17, 21, 29, 0.88);
  --surface-strong: rgba(23, 28, 38, 0.96);
  --accent: #4de2c5;
  --accent-strong: #2db7ff;
  --accent-warm: #ff8c61;
  --line: rgba(151, 168, 197, 0.18);
  --line-strong: rgba(151, 168, 197, 0.3);
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.34);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(77, 226, 197, 0.14), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(45, 183, 255, 0.16), transparent 24%),
    radial-gradient(circle at 50% 120%, rgba(255, 140, 97, 0.1), transparent 34%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 52%, #06080d 100%);
  color-scheme: dark;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.7;
}

body::before {
  top: 8%;
  left: -8%;
  width: 300px;
  height: 300px;
  background: rgba(77, 226, 197, 0.12);
}

body::after {
  right: -6%;
  bottom: 10%;
  width: 340px;
  height: 340px;
  background: rgba(45, 183, 255, 0.14);
}

.app-shell {
  width: min(980px, 92vw);
  margin: 28px auto 64px;
  position: relative;
  z-index: 1;
}

.hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: float-in 420ms ease-out both;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.11em;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 8px 0 18px;
  line-height: 1.12;
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  max-width: 14ch;
}

.workout-name {
  display: grid;
  gap: 7px;
}

.workout-name span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(8, 11, 17, 0.76);
  color: var(--ink);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  resize: vertical;
  min-height: 76px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(77, 226, 197, 0.45);
  outline-offset: 1px;
}

.controls {
  margin: 18px 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation: float-in 520ms ease-out both;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 10px 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #041118;
  box-shadow: 0 12px 24px rgba(45, 183, 255, 0.22);
}

.btn-secondary {
  background: linear-gradient(135deg, #1b2230 0%, #121823 100%);
  color: var(--ink);
}

.btn:hover,
.icon-btn:hover,
.drag-handle:hover,
.add-below:hover {
  border-color: rgba(77, 226, 197, 0.28);
}

.plus {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.1rem;
  line-height: 1;
}

.blocks-list {
  display: grid;
  gap: 12px;
}

.block {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  animation: rise-in 250ms ease-out both;
  transition: border-color 150ms ease, transform 150ms ease;
}

.block::before,
.block::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 0 0 1px rgba(77, 226, 197, 0.2), 0 0 18px rgba(45, 183, 255, 0.28);
  opacity: 0;
  transform: scaleX(0.95);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}

.block::before {
  top: -8px;
}

.block::after {
  bottom: -8px;
}

.block.drop-before,
.block.drop-after {
  border-color: rgba(77, 226, 197, 0.45);
}

.block.drop-before::before,
.block.drop-after::after {
  opacity: 1;
  transform: scaleX(1);
}

.block.dragging {
  opacity: 0.35;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drag-handle {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 13, 20, 0.92);
  color: var(--muted);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: grab;
}

.block-type-chip {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px;
}

.block-type-chip.exercise {
  background: linear-gradient(135deg, var(--accent) 0%, #1aa9ff 100%);
  color: #041118;
}

.block-type-chip.rest {
  background: linear-gradient(135deg, #465066 0%, #6f7a8f 100%);
}

.block-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 13, 20, 0.92);
  color: var(--ink);
  min-width: 32px;
  height: 32px;
  cursor: pointer;
}

.grid {
  display: grid;
  gap: 10px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.add-below {
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 20, 0.82);
  padding: 7px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink);
}

.footer-actions .add-below:first-child {
  margin-left: auto;
}

.add-below span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(77, 226, 197, 0.14);
  color: var(--accent);
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--muted);
  background: rgba(17, 21, 29, 0.6);
  text-align: center;
}

@media (max-width: 700px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .block-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .block-actions {
    width: 100%;
  }

  .icon-btn {
    flex: 1;
  }

  .footer-actions .add-below:first-child {
    margin-left: 0;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
