﻿@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg-deep: #0d1b26;
  --bg-mid: #1d3545;
  --card: rgba(12, 23, 31, 0.86);
  --line: rgba(111, 170, 184, 0.35);
  --ink: #eff8ff;
  --muted: #99b5c4;
  --accent: #ff8c42;
  --accent-soft: #18c29c;
  --danger: #ff6f61;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 15%, #285269, var(--bg-deep) 40%),
    linear-gradient(130deg, var(--bg-deep), #0b161f 60%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
}

.orb-a {
  width: 360px;
  height: 360px;
  top: -90px;
  right: -120px;
  background: #ff8c42;
  animation: driftA 16s ease-in-out infinite;
}

.orb-b {
  width: 300px;
  height: 300px;
  bottom: -100px;
  left: -100px;
  background: #18c29c;
  animation: driftB 18s ease-in-out infinite;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(97, 152, 168, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 152, 168, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  pointer-events: none;
}

.shell {
  width: min(1120px, 94vw);
  margin: 36px auto 48px;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 24px;
  animation: reveal 500ms ease-out both;
}

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

h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.subhead {
  margin: 0;
  color: var(--muted);
  max-width: 700px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 16px;
  background: rgba(7, 14, 21, 0.6);
  backdrop-filter: blur(8px);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(9, 18, 26, 0.9);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.tab.active {
  background: linear-gradient(120deg, #1f4255, #33566b);
  color: var(--ink);
  border-color: transparent;
}

.tab-panel {
  display: none;
  animation: reveal 280ms ease-out both;
}

.tab-panel.active {
  display: block;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.field-row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea,
button,
pre {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(145, 192, 205, 0.35);
  background: rgba(7, 16, 24, 0.95);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 0.96rem;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(145, 192, 205, 0.35);
  background: rgba(7, 16, 24, 0.95);
  border-radius: 12px;
  padding: 8px 10px;
}

#input-file {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(145, 192, 205, 0.35);
  border-radius: 10px;
  background: linear-gradient(135deg, #1f4255, #33566b);
  color: var(--ink);
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  transition: all 180ms ease;
}

.file-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(145, 192, 205, 0.6);
}

.file-name {
  color: var(--muted);
  font-size: 0.94rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(24, 194, 156, 0.6);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions.compact {
  margin-top: 10px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--ink);
  font-weight: 700;
  background: linear-gradient(135deg, #ff8c42, #ff6e3d);
  cursor: pointer;
}

button.ghost {
  background: rgba(20, 38, 49, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.status-item {
  border: 1px solid rgba(145, 192, 205, 0.25);
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 20, 30, 0.75);
}

.status-item .k {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-item .v {
  margin-top: 6px;
  font-weight: 700;
  font-size: 1rem;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 12px;
  border: 1px solid rgba(145, 192, 205, 0.25);
  background: rgba(6, 12, 18, 0.92);
  padding: 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.42;
  min-height: 80px;
  max-height: 360px;
  overflow: auto;
}

.live-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.96rem;
  min-height: 22px;
}

.live-status[data-running="true"] {
  background: linear-gradient(90deg, #92aebc, #e7f3ff, #92aebc);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: statusFlow 1.8s linear infinite;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(20, 36, 49, 0.85);
  border: 1px solid rgba(145, 192, 205, 0.22);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1ec39d, #ffa24f);
  transition: width 260ms ease;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.35) 45%, transparent 70%);
  transform: translateX(-100%);
  animation: barSweep 1.3s linear infinite;
}

.progress-meta {
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.log-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.logs-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.log-date {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 18, 26, 0.9);
  overflow: hidden;
}

.log-date > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  background: rgba(14, 28, 39, 0.88);
}

.log-date > summary::-webkit-details-marker {
  display: none;
}

.log-content {
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.activity-item {
  border: 1px solid rgba(145, 192, 205, 0.22);
  border-radius: 12px;
  padding: 10px;
}

.activity-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.log-file-list {
  display: grid;
  gap: 8px;
}

.log-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(145, 192, 205, 0.22);
  border-radius: 10px;
}

.log-file button {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.error {
  color: var(--danger);
}

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

@keyframes driftA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-20px, 16px);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(24px, -18px);
  }
}

@keyframes statusFlow {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -20% 0;
  }
}

@keyframes barSweep {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(110%);
  }
}

@media (max-width: 720px) {
  .shell {
    width: 95vw;
    margin-top: 20px;
  }

  .panel {
    padding: 12px;
  }

  .log-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    flex-direction: column;
  }
}
