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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #242424;
  --border: #2e2e2e;
  --accent: #6366f1;
  --accent-hover: #4f52d9;
  --text: #f0f0f0;
  --text-muted: #888;
  --success: #22c55e;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.container {
  width: 100%;
  max-width: 480px;
}

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

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.drop-icon {
  font-size: 3rem;
  line-height: 1;
  color: var(--text-muted);
}

.drop-label {
  font-size: 1rem;
  font-weight: 500;
}

.drop-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.drop-limit {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* File Preview */
.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.file-icon { font-size: 1.8rem; }

.file-meta {
  flex: 1;
  overflow: hidden;
}

.file-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.btn-icon:hover { color: var(--text); }

/* Options */
.options { display: flex; flex-direction: column; gap: 10px; }

.option-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

select:focus { border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-full { width: 100%; }

/* Progress */
.progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.2s;
}

/* Result */
.result {
  text-align: center;
  gap: 16px;
}

.result-icon {
  width: 52px;
  height: 52px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto;
}

.result-label {
  font-size: 1.05rem;
  font-weight: 600;
}

.link-box {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.link-box span {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.85rem;
  word-break: break-all;
  text-align: left;
  color: var(--accent);
  font-family: monospace;
}

.btn-copy {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-copy:hover { background: var(--accent-hover); }
.btn-copy.copied { background: var(--success); }

.result-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* QR Code */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0 4px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.qr-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 500;
}

.qr-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

.qr-wrap canvas {
  display: block;
  border-radius: 4px;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.22); border-color: #ef4444; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger.deleted { background: rgba(100, 100, 100, 0.1); color: var(--text-muted); border-color: var(--border); cursor: default; }

/* ── Mobile ── */
@media (max-width: 560px) {
  body { padding: 0; align-items: flex-start; min-height: 100vh; }

  .container {
    max-width: 100%;
    padding: 20px 16px 40px;
  }

  .header { margin-bottom: 24px; }
  .header h1 { font-size: 1.6rem; }

  .card { padding: 20px 16px; border-radius: 10px; gap: 16px; }

  .drop-zone { padding: 32px 16px; }

  .link-box {
    flex-direction: column;
    border-radius: 8px;
  }
  .link-box span {
    padding: 12px 14px;
    border-radius: 8px 8px 0 0;
    font-size: 0.8rem;
  }
  .btn-copy {
    padding: 11px;
    border-radius: 0 0 8px 8px;
    text-align: center;
  }

  .qr-wrap { padding: 10px; }
  #qr-canvas canvas, #qr-canvas img { width: 160px !important; height: 160px !important; }

  .result-actions { gap: 8px; }
  .btn { padding: 12px 16px; font-size: 0.88rem; }
}

.hidden { display: none !important; }
