:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --success: #047857;
  --error: #dc2626;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  width: 100%;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 1.5rem 1rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.hero-card {
  width: min(640px, 100%);
  background: var(--surface);
  border-radius: 28px;
  padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 30px 60px rgba(79, 70, 229, 0.15);
  text-align: center;
}

.hero-card h2 {
  margin: 0 0 0.5rem;
  color: var(--primary);
  font-size: 1.8rem;
}

.helper-text {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.seo-highlight {
  margin: 0 0 2rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.2rem;
  width: 100%;
  height: 200px;
  border: 2px dashed var(--primary);
  border-radius: 18px;
  background: #f5f7ff;
  color: var(--primary-dark);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dropzone svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

.dropzone span {
  font-size: 0.85rem;
  color: var(--muted);
}

.dropzone.dragover {
  transform: scale(1.01);
  border-color: var(--primary-light);
  box-shadow: 0 20px 35px rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.08);
}

#fileInput {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1.5rem 0 0.75rem;
  gap: 0.5rem;
  text-align: left;
}

.list-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.reorder-hint {
  text-align: right;
}

#fileList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

.file-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.file-handle {
  font-size: 1.2rem;
  cursor: grab;
  color: var(--muted);
}

.file-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.8rem;
  color: var(--muted);
}

.file-remove {
  border: none;
  background: transparent;
  color: var(--error);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: transform 0.15s ease;
}

.file-remove:hover {
  transform: scale(1.15);
}

button {
  margin-top: 2rem;
  padding: 0.85rem 2.8rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--surface);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 50px rgba(79, 70, 229, 0.3);
  filter: brightness(1.03);
}

button:disabled {
  cursor: progress;
  filter: grayscale(0.3);
  box-shadow: none;
}

#status {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  min-height: 1.1rem;
}

#status[data-tone="muted"] {
  color: var(--muted);
}

#status[data-tone="info"] {
  color: var(--primary-dark);
}

#status[data-tone="success"] {
  color: var(--success);
}

#status[data-tone="error"] {
  color: var(--error);
}

footer {
  width: 100%;
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

#footer-links {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

#footer-links a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s ease;
}

#footer-links a:hover {
  color: var(--primary-dark);
}

@media (max-width: 720px) {
  header {
    padding: 1.25rem 1rem;
  }

  .hero-card {
    padding: 2rem 1.25rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.18);
  }

  .dropzone {
    height: 180px;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .reorder-hint {
    text-align: left;
  }
}
