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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #242836;
  --primary: #6c5ce7;
  --primary-hover: #5a4bd1;
  --text: #e4e6eb;
  --text-muted: #8b8fa3;
  --success: #00b894;
  --error: #e17055;
  --warning: #fdcb6e;
  --border: #2d3142;
  --radius: 12px;
}

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

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

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

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

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

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
}

label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

.input-group input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--primary);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

button,
.download-btn {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button:hover,
.download-btn:hover {
  background: var(--primary-hover);
}

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

.hints {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Progress */
.progress-bar-container {
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  height: 32px;
  margin-bottom: 20px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a29bfe);
  border-radius: 8px;
  width: 0%;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

#progress-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
}

.status-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.step.active {
  opacity: 1;
}

.step.done {
  opacity: 0.7;
}

.step-icon {
  font-size: 1.4rem;
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.current-step {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.files-counter {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 4px;
}

/* Results */
.results-list {
  margin-bottom: 16px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

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

.result-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-info {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 12px;
  white-space: nowrap;
}

.result-status {
  margin-left: 8px;
}

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

.result-status.error {
  color: var(--error);
}

.download-btn {
  width: 100%;
  margin-top: 8px;
  font-size: 1rem;
  padding: 14px;
}

/* Error */
.card.error {
  border-color: var(--error);
}

.card.error h2 {
  color: var(--error);
}

#error-message {
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

footer {
  text-align: center;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .input-group {
    flex-direction: column;
  }

  .status-steps {
    gap: 4px;
  }

  .step-label {
    font-size: 0.65rem;
  }
}
