/* ═══════════════════════════════════════════════════════════════════
   PDF TOOLKIT — Modern Design System
   Premium glassmorphism, vibrant gradients, micro-animations.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Theme Variables ─────────────────────────────────────────────── */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-xs: 6px;
  --max-width: 1200px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary:     #0a0e17;
  --bg-secondary:   #111827;
  --bg-card:        rgba(17, 24, 39, 0.7);
  --bg-card-hover:  rgba(30, 41, 59, 0.8);
  --bg-surface:     rgba(30, 41, 59, 0.5);
  --bg-glass:       rgba(15, 23, 42, 0.65);
  --border-color:   rgba(148, 163, 184, 0.12);
  --border-hover:   rgba(148, 163, 184, 0.25);
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --accent-1:       #818cf8; /* indigo */
  --accent-2:       #34d399; /* emerald */
  --accent-3:       #f472b6; /* pink */
  --accent-4:       #38bdf8; /* sky */
  --accent-5:       #fbbf24; /* amber */
  --accent-6:       #a78bfa; /* violet */
  --accent-7:       #fb923c; /* orange */
  --gradient-hero:  linear-gradient(135deg, rgba(129, 140, 248, 0.12), rgba(52, 211, 153, 0.08), rgba(56, 189, 248, 0.06));
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-glass:   0 8px 32px rgba(0, 0, 0, 0.3);
  --success:        #34d399;
  --error:          #f87171;
  --warning:        #fbbf24;
  --info:           #38bdf8;
}

[data-theme="light"] {
  --bg-primary:     #f8fafc;
  --bg-secondary:   #ffffff;
  --bg-card:        rgba(255, 255, 255, 0.85);
  --bg-card-hover:  rgba(255, 255, 255, 0.95);
  --bg-surface:     rgba(241, 245, 249, 0.9);
  --bg-glass:       rgba(255, 255, 255, 0.7);
  --border-color:   rgba(148, 163, 184, 0.2);
  --border-hover:   rgba(99, 102, 241, 0.3);
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --accent-1:       #6366f1;
  --accent-2:       #10b981;
  --accent-3:       #ec4899;
  --accent-4:       #0ea5e9;
  --accent-5:       #f59e0b;
  --accent-6:       #8b5cf6;
  --accent-7:       #f97316;
  --gradient-hero:  linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(16, 185, 129, 0.04), rgba(14, 165, 233, 0.03));
  --shadow-card:    0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-glass:   0 4px 24px rgba(0, 0, 0, 0.06);
  --success:        #10b981;
  --error:          #ef4444;
  --warning:        #f59e0b;
  --info:           #0ea5e9;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-hero);
  pointer-events: none;
  z-index: 0;
}

button { font-family: inherit; font-size: inherit; border: none; cursor: pointer; background: none; color: inherit; }
input, select { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Header ──────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-glass);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}
.logo:hover { opacity: 0.8; }

.logo-icon { color: var(--accent-1); display: flex; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--accent-5);
  transform: rotate(15deg);
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ── Main Content ────────────────────────────────────────────────── */
.main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  min-height: calc(100vh - 64px - 60px);
}

/* ── Views ────────────────────────────────────────────────────────── */
.view {
  display: none;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.view.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 64px 0 40px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-4), var(--accent-2));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* ── Tool Grid ───────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 24px;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  text-align: left;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  background: var(--bg-card-hover);
}
.tool-card:hover::before { opacity: 1; }

.tool-card:active {
  transform: translateY(-2px) scale(0.99);
}

/* Card accent gradients */
.tool-card[data-tool="merge"]::before { background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), transparent 60%); }
.tool-card[data-tool="split"]::before { background: linear-gradient(135deg, rgba(244, 114, 182, 0.06), transparent 60%); }
.tool-card[data-tool="compress"]::before { background: linear-gradient(135deg, rgba(52, 211, 153, 0.06), transparent 60%); }
.tool-card[data-tool="rotate"]::before { background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), transparent 60%); }
.tool-card[data-tool="remove-pages"]::before { background: linear-gradient(135deg, rgba(251, 191, 36, 0.06), transparent 60%); }
.tool-card[data-tool="watermark"]::before { background: linear-gradient(135deg, rgba(167, 139, 250, 0.06), transparent 60%); }
.tool-card[data-tool="page-numbers"]::before { background: linear-gradient(135deg, rgba(251, 146, 60, 0.06), transparent 60%); }
.tool-card[data-tool="unlock"]::before { background: linear-gradient(135deg, rgba(52, 211, 153, 0.06), transparent 60%); }

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: transform var(--transition);
}
.tool-card:hover .tool-icon { transform: scale(1.08) rotate(-3deg); }

.tool-icon--merge    { background: rgba(99, 102, 241, 0.12); color: var(--accent-1); }
.tool-icon--split    { background: rgba(244, 114, 182, 0.12); color: var(--accent-3); }
.tool-icon--compress { background: rgba(52, 211, 153, 0.12); color: var(--accent-2); }
.tool-icon--rotate   { background: rgba(56, 189, 248, 0.12); color: var(--accent-4); }
.tool-icon--remove   { background: rgba(251, 191, 36, 0.12); color: var(--accent-5); }
.tool-icon--watermark { background: rgba(167, 139, 250, 0.12); color: var(--accent-6); }
.tool-icon--pagenums  { background: rgba(251, 146, 60, 0.12); color: var(--accent-7); }
.tool-icon--unlock    { background: rgba(52, 211, 153, 0.12); color: var(--accent-2); }

.tool-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tool-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.tool-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.tool-badge--new {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(52, 211, 153, 0.15));
  color: var(--accent-2);
  border-color: rgba(52, 211, 153, 0.3);
}

/* ── Trust Bar ───────────────────────────────────────────────────── */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 32px 0 48px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.trust-item svg { color: var(--accent-2); flex-shrink: 0; }

/* ── Operation View ──────────────────────────────────────────────── */
.op-header {
  padding: 32px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  transition: all var(--transition-fast);
  align-self: flex-start;
}
.back-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateX(-2px);
}

.op-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.op-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.op-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.op-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.op-body {
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 28px;
  padding-bottom: 64px;
  align-items: start;
}

.op-col-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
  min-width: 0;
  overflow: hidden;
}

.op-col-right {
  min-width: 0;
  min-height: 0;
}

/* ── Upload Zone ─────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 4px;
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-1);
  background: rgba(99, 102, 241, 0.04);
}
.upload-zone.drag-over {
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.upload-zone-inner {
  border-radius: calc(var(--border-radius) - 4px);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-surface);
}

.upload-icon {
  color: var(--accent-1);
  margin-bottom: 16px;
  opacity: 0.7;
  transition: all var(--transition);
}
.upload-zone:hover .upload-icon {
  opacity: 1;
  transform: translateY(-4px);
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── File List ───────────────────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.file-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.file-entry:hover { border-color: var(--border-hover); }

.file-entry-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}

.file-entry-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.file-entry-name {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.file-entry-name-wrap {
  min-width: 0;
  overflow: hidden;
}

.file-entry-size {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.file-entry-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.file-entry-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* ── PDF Preview Panel ───────────────────────────────────────────── */
.preview-panel {
  border-radius: var(--border-radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.preview-title {
  font-size: 15px;
  font-weight: 700;
}

.preview-info {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.preview-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: var(--text-secondary);
  font-size: 14px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.preview-thumb {
  position: relative;
  border-radius: var(--border-radius-sm);
  border: 2px solid var(--border-color);
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  aspect-ratio: 210 / 297; /* A4 ratio */
  display: flex;
  flex-direction: column;
}

.preview-thumb:hover {
  border-color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.preview-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.preview-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* ── Remove-pages: selected (marked for removal) ──── */
.preview-thumb.selected {
  border-color: var(--error);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.preview-thumb.selected::after {
  content: '✕';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--error);
  border-radius: 50%;
  animation: checkmark-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-thumb.selected canvas {
  opacity: 0.35;
  filter: grayscale(0.5);
}

.preview-thumb.selected .preview-thumb-label {
  background: var(--error);
  text-decoration: line-through;
}

/* ── Split: range highlight ──── */
.preview-thumb.in-range {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.preview-thumb.in-range::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-1);
  border-radius: 50%;
  animation: checkmark-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-thumb.in-range .preview-thumb-label {
  background: rgba(99, 102, 241, 0.85);
}

.preview-thumb.out-of-range canvas {
  opacity: 0.3;
  filter: grayscale(0.6);
}

.preview-thumb.out-of-range {
  border-color: var(--border-color);
}

@media (max-width: 768px) {
  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
  }
}

/* ── Options Panel ───────────────────────────────────────────────── */
.options-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.option-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
}

.option-input {
  padding: 8px 14px;
  border-radius: var(--border-radius-xs);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  min-width: 100px;
}
.option-input:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.option-select {
  padding: 8px 14px;
  border-radius: var(--border-radius-xs);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.option-select:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.option-hint {
  font-size: 12px;
  color: var(--text-muted);
  width: 100%;
  margin-top: 4px;
}

/* ── Execute Button ──────────────────────────────────────────────── */
.exec-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-4));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  transition: all var(--transition);
  align-self: flex-start;
  overflow: hidden;
}
.exec-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.4);
}
.exec-btn:active:not(:disabled) {
  transform: translateY(0);
}
.exec-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.exec-btn.loading {
  background: linear-gradient(135deg, var(--accent-5), var(--accent-7));
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.3);
  pointer-events: none;
}

.exec-btn-text { transition: opacity var(--transition-fast); }
.exec-btn.loading .exec-btn-text { display: none; }
.exec-btn-loader { display: none; align-items: center; gap: 8px; }
.exec-btn.loading .exec-btn-loader { display: flex; }

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress Bar ────────────────────────────────────────────────── */
.progress-bar-wrap {
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-surface);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-4));
  width: 0%;
  transition: width 0.3s ease;
}

.progress-fill.indeterminate {
  width: 40%;
  animation: progress-slide 1.2s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* ── Result Panel ────────────────────────────────────────────────── */
.result-panel {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-icon {
  color: var(--success);
  margin-bottom: 16px;
  animation: checkmark-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes checkmark-pop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.result-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.7;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-2), #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.3);
  transition: all var(--transition);
}
.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(52, 211, 153, 0.4);
}

.btn-secondary {
  margin-top: 16px;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  transition: all var(--transition-fast);
}
.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ── Toast Notifications ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-glass);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  max-width: 420px;
  animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.toast.toast-out {
  animation: toast-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

.toast-icon { flex-shrink: 0; }
.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-error .toast-icon { color: var(--error); }
.toast.toast-info .toast-icon { color: var(--info); }

.toast-close {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-primary); background: var(--bg-surface); }

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; opacity: 0.5; }
::-webkit-scrollbar-thumb:hover { opacity: 0.8; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .op-body {
    grid-template-columns: 1fr;
  }
  .op-col-left {
    position: static;
  }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .main { padding: 0 16px; }
  .hero { padding: 40px 0 24px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; }
  .tools-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-card { padding: 20px 18px; }
  .trust-bar { gap: 16px; padding: 20px 0 36px; }
  .trust-item { font-size: 12px; }
  .op-body { padding-bottom: 40px; }
  .upload-zone-inner { padding: 36px 16px; }
  .toast-container { right: 12px; left: 12px; }
  .toast { min-width: auto; }
  .option-group { padding: 14px 16px; }
  .exec-btn { width: 100%; justify-content: center; }
  .download-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 22px; }
  .logo-text { display: none; }
  .nav-status { display: none; }
}
