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

:root {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-hover: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.2);
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px 20px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: -15%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.04) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(50px);
}

.container {
  width: 100%;
  max-width: 680px;
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

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

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

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  background: #e2e8f0;
  color: #475569;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover:not(.active) {
  background: #cbd5e1;
}

.tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--card-border-hover);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
}

.hidden {
  display: none;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 10px;
}

.input-group {
  display: flex;
  gap: 10px;
}

input[type="url"] {
  flex: 1;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input[type="url"]::placeholder {
  color: #94a3b8;
}

input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

button[type="submit"] {
  padding: 13px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px var(--accent-glow);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #fecaca;
}

.hint {
  margin-top: 12px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--warning-bg);
  color: var(--warning);
}

.status-badge.completed {
  background: var(--success-bg);
  color: var(--success);
}

#job-info {
  font-size: 0.8rem;
  color: #94a3b8;
  font-family: monospace;
}

.manifest-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.88rem;
}

.manifest-title {
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 75%;
}

.manifest-counter {
  font-weight: 600;
  color: var(--accent);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.file-list::-webkit-scrollbar {
  width: 5px;
}

.file-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.file-item.is-processing {
  border-color: #fcd34d;
  background: #fffbeb;
}

.file-item.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.file-name {
  color: #1e293b;
  word-break: break-all;
  padding-right: 12px;
  font-weight: 500;
}

.file-action {
  white-space: nowrap;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-tag.waiting {
  background: #f1f5f9;
  color: #64748b;
}

.status-tag.processing {
  background: #fef3c7;
  color: #b45309;
}

.status-tag.ready {
  background: #dcfce7;
  color: #15803d;
}

.download-link {
  color: var(--accent);
  background: #ffffff;
  border: 1px solid var(--card-border);
  padding: 3px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.download-link:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

footer {
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .input-group {
    flex-direction: column;
  }
  button[type="submit"] {
    width: 100%;
  }
  .card {
    padding: 20px;
  }
}
