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

:root {
  --bg-start: #2f4a6d;
  --bg-mid: #162435;
  --bg-end: #0c111a;

  --panel-bg: rgba(7, 14, 24, 0.74);
  --panel-line: rgba(96, 127, 166, 0.35);
  --panel-soft: rgba(13, 23, 37, 0.7);

  --text: #e8eef8;
  --muted: #a8bfdc;

  --accent: #69ceff;
  --accent-strong: #53c9ff;
  --ok: #53e8b0;
  --warn: #ffd27a;
  --err: #ff8b8b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 12% 8%, var(--bg-start), var(--bg-mid) 45%, var(--bg-end));
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.22;
  pointer-events: none;
}

.ambient-a {
  left: -160px;
  top: 14vh;
  background: #59b8ff;
  animation: drift-a 16s ease-in-out infinite;
}

.ambient-b {
  right: -140px;
  bottom: 6vh;
  background: #52e7ac;
  animation: drift-b 18s ease-in-out infinite;
}

.app-root {
  position: relative;
  z-index: 1;
  width: min(1140px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 28px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 12px;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26);
  min-height: 0;
}

.panel-form {
  display: flex;
  flex-direction: column;
}

.panel-status {
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.panel-header-compact {
  margin-bottom: 4px;
}

.kicker {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: #b8cff0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(1.48rem, 2.9vw, 2rem);
}

h2 {
  font-size: 1.24rem;
}

.intro {
  margin: 8px 0 14px;
}

.muted {
  color: var(--muted);
}

.note {
  margin: 12px 0 0;
  font-size: 13px;
}

.status-dot {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-dot.online {
  color: var(--ok);
  border-color: rgba(83, 232, 176, 0.45);
  background: rgba(83, 232, 176, 0.1);
}

.converter-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-group {
  display: flex;
  flex-direction: column;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  color: #dce8f8;
}

input,
select,
button {
  width: 100%;
  border: 1px solid rgba(119, 157, 201, 0.35);
  background: rgba(11, 20, 33, 0.84);
  color: #f2f7ff;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
}

input::placeholder {
  color: #8fa8c6;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(105, 206, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(105, 206, 255, 0.16);
}

button {
  border-color: rgba(105, 206, 255, 0.5);
  background: linear-gradient(140deg, rgba(47, 110, 165, 0.95), rgba(25, 63, 98, 0.95));
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

button:hover {
  border-color: rgba(105, 206, 255, 0.86);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

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

.status {
  margin: 6px 0 0;
  font-weight: 600;
}

.status.idle {
  color: var(--muted);
}

.status.queued,
.status.downloading,
.status.converting,
.status.zipping {
  color: var(--warn);
}

.status.finished {
  color: var(--ok);
}

.status.failed {
  color: var(--err);
}

.progress-wrap {
  margin-top: 12px;
  border: 1px solid rgba(108, 144, 185, 0.32);
  background: rgba(8, 15, 26, 0.72);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-strong), #61f4a8);
  transition: width 0.25s ease;
}

.counts {
  margin-top: 12px;
  font-size: 14px;
  border: 1px solid rgba(95, 129, 166, 0.2);
  background: var(--panel-soft);
  border-radius: 10px;
  padding: 9px 10px;
}

.download-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #082015;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(83, 232, 176, 0.5);
  background: linear-gradient(140deg, rgba(124, 230, 175, 0.97), rgba(83, 232, 176, 0.94));
  font-weight: 700;
}

.failed-list {
  margin-top: 12px;
  border: 1px solid rgba(255, 139, 139, 0.38);
  background: rgba(113, 34, 34, 0.3);
  border-radius: 10px;
  padding: 10px;
  color: #ffdede;
  font-size: 14px;
}

.failed-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.entries-wrap {
  margin-top: 14px;
}

.entries-wrap h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.entries-scroll {
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(95, 129, 166, 0.32);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(95, 129, 166, 0.2);
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(16, 28, 44, 0.94);
  color: #d9e7fb;
}

tbody tr:hover {
  background: rgba(99, 144, 198, 0.08);
}

.hidden {
  display: none !important;
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(36px, -18px);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-42px, 24px);
  }
}

@media (max-width: 980px) {
  .app-root {
    width: min(760px, calc(100% - 20px));
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 16px 0 20px;
  }

  .panel {
    padding: 15px;
  }
}

@media (max-width: 740px) {
  .ambient {
    width: 300px;
    height: 300px;
    opacity: 0.18;
  }

  .app-root {
    width: calc(100% - 14px);
    gap: 10px;
    padding: 12px 0 18px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  h1 {
    font-size: clamp(1.28rem, 7.4vw, 1.56rem);
  }

  h2 {
    font-size: 1.12rem;
  }

  .intro {
    margin: 6px 0 12px;
    font-size: 14px;
    line-height: 1.4;
  }

  .input-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .panel {
    padding: 13px;
    border-radius: 12px;
  }

  label {
    font-size: 13px;
    margin-bottom: 4px;
  }

  input,
  select,
  button,
  .download-link {
    min-height: 44px;
    padding: 10px 11px;
    font-size: 15px;
  }

  .status {
    margin-top: 4px;
  }

  .counts {
    line-height: 1.35;
  }

  .entries-scroll {
    max-height: 300px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 540px;
  }

  .status-dot {
    font-size: 11px;
  }

  .counts,
  th,
  td,
  .note {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .app-root {
    width: calc(100% - 10px);
    padding: 10px 0 14px;
  }

  .panel {
    padding: 12px;
  }

  .kicker {
    font-size: 10px;
  }

  .intro,
  .note {
    font-size: 12px;
  }

  table {
    min-width: 500px;
  }
}

@media (max-width: 380px) {
  .app-root {
    width: calc(100% - 8px);
    gap: 8px;
    padding: 8px 0 12px;
  }

  .panel {
    padding: 10px;
    border-radius: 10px;
  }

  .kicker {
    letter-spacing: 0.08em;
    font-size: 9px;
  }

  h1 {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.02rem;
  }

  .intro,
  .note,
  .counts,
  th,
  td {
    font-size: 12px;
  }

  label {
    font-size: 12px;
  }

  input,
  select,
  button,
  .download-link {
    min-height: 42px;
    padding: 9px 10px;
    font-size: 14px;
    border-radius: 9px;
  }

  .status-dot {
    padding: 3px 8px;
    font-size: 10px;
  }

  .progress-wrap {
    margin-top: 10px;
    height: 10px;
  }

  .entries-scroll {
    max-height: 260px;
  }

  table {
    min-width: 460px;
  }
}
