/**
 * UI/UX Pro Max Design System
 * Theme: Glassmorphism + Dynamic Dark/Light Mode + High-End Utility SaaS
 * Fonts: Plus Jakarta Sans + Inter + JetBrains Mono
 */

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

:root {
  /* Color Tokens - Light Mode Default */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-primary-glow: rgba(79, 70, 229, 0.25);
  
  --color-accent: #f43f5e;
  --color-accent-hover: #e11d48;
  --color-accent-light: #fff1f2;

  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-border: rgba(16, 185, 129, 0.25);

  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;

  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;

  /* Surfaces & Glass */
  --bg-app: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-dropzone: rgba(248, 250, 252, 0.85);

  --border-subtle: #e2e8f0;
  --border-focus: #6366f1;
  --border-glass: rgba(255, 255, 255, 0.6);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 36px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.15);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: rgba(15, 23, 42, 0.75);
  --bg-surface-elevated: #131b2e;
  --bg-card: rgba(20, 29, 48, 0.65);
  --bg-card-subtle: #0f172a;
  --bg-dropzone: rgba(15, 23, 42, 0.6);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #818cf8;
  --border-glass: rgba(255, 255, 255, 0.12);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: rgba(99, 102, 241, 0.16);
  --color-primary-glow: rgba(99, 102, 241, 0.4);

  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-success-border: rgba(16, 185, 129, 0.35);

  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger-bg: rgba(239, 68, 68, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* Ambient Ambient Glow Mesh */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 550px;
  background: radial-gradient(ellipse at 50% -20%, var(--color-primary-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 28px;
  transition: all 0.25s ease;
}

.nav-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-success);
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  padding: 6px 14px;
  border-radius: 99px;
  transition: all 0.2s ease;
}

/* Suite Switcher Tabs - Mathematically pinned to exact center */
.nav-tabs {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  z-index: 10;
}

.nav-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.nav-tab-link:hover {
  color: var(--text-primary);
}

.nav-tab-link.active {
  background: var(--bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.05);
}

/* Preset Chips Bar */
.preset-bar {
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  position: relative;
  z-index: 10;
}

.preset-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.preset-tags {
  display: flex;
  gap: 8px;
}

.preset-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.preset-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.preset-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 10px var(--color-primary-glow);
}

/* Main Container */
.main-wrapper {
  max-width: 860px;
  margin: 24px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

/* Compressor Card */
.compressor-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

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

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-header h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-header h1 span {
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-lg);
  background: var(--bg-dropzone);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

[data-theme="dark"] .dropzone {
  border-color: rgba(99, 102, 241, 0.35);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -6px var(--color-primary-glow);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 10;
}

.upload-icon-pulse {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease;
}

.dropzone:hover .upload-icon-pulse {
  transform: scale(1.1) rotate(-3deg);
}

.dropzone-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.dropzone-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Action Buttons */
.btn {
  font-family: var(--font-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-browse {
  background: var(--bg-surface-elevated);
  color: var(--color-primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.dropzone:hover .btn-browse {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.btn-compress {
  background: linear-gradient(135deg, var(--color-primary), #6366f1);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px var(--color-primary-glow);
  letter-spacing: -0.01em;
}

.btn-compress:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), #4f46e5);
  box-shadow: 0 6px 24px var(--color-primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-app);
  border-color: var(--border-focus);
}

/* Attached File Preview Cards */
.file-list {
  list-style: none;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}

.file-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

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

.file-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-thumb-canvas {
  width: 40px;
  height: 52px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
  background: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.file-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.file-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.btn-remove:hover {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

/* Analysis Tip Banner */
.analysis-tip {
  margin: 18px 0 0;
  padding: 12px 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

/* Controls Deck */
.controls-deck {
  margin-top: 28px;
}

.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 auto 24px;
  background: var(--bg-dropzone);
  border: 1px solid var(--border-subtle);
  padding: 5px;
  border-radius: 99px;
  width: fit-content;
}

.mode-tab {
  cursor: pointer;
  user-select: none;
}

.mode-tab input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.mode-tab span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.18s ease;
}

.mode-tab input:checked + span {
  background: var(--bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 24px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.stepper-field {
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 6px 0 14px;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.stepper-field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.size-input {
  border: none;
  outline: none;
  width: 75px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  -moz-appearance: textfield;
}

.size-input::-webkit-outer-spin-button,
.size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-buttons {
  display: flex;
  flex-direction: column;
}

.step-btn {
  background: none;
  border: none;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.step-btn:hover {
  color: var(--color-primary);
}

.select-input {
  height: 44px;
  padding: 0 32px 0 14px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  box-shadow: var(--shadow-sm);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.select-input:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.range-slider {
  width: 200px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.quality-label {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 75px;
}

/* Advanced Accordion */
.adv-accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-dropzone);
  margin-top: 18px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.adv-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.adv-summary::-webkit-details-marker {
  display: none;
}

.adv-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.adv-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.adv-accordion[open] .adv-chevron {
  transform: rotate(180deg);
}

.adv-panel {
  padding: 18px 20px 24px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  background: var(--bg-card);
}

.adv-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.adv-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.adv-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.adv-text span {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.adv-select-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adv-select-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Results Cards */
.results-section {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.results-heading {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 22px;
}

.results-cards {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.2s ease;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.result-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg);
}

.result-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.result-size {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.result-was {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.result-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
  padding: 3px 12px;
  border-radius: 99px;
}

.rename-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 440px;
}

.rename-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-dropzone);
  outline: none;
  transition: all 0.15s ease;
}

.rename-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.rename-ext {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-download {
  background: linear-gradient(135deg, var(--color-primary), #6366f1);
  color: #ffffff;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--color-primary-glow);
  transition: all 0.18s ease;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--color-primary-glow);
}

.btn-preview {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  cursor: pointer;
}

.btn-preview:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.result-note {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  background: var(--bg-dropzone);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
}

.results-footer {
  text-align: center;
  margin-top: 24px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.spinner-ring {
  width: 56px;
  height: 56px;
  border: 4px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-status {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  min-height: 24px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), #a855f7);
  border-radius: 99px;
  transition: width 0.22s ease;
}

.progress-percent {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Password Modal */
.modal-password {
  text-align: left;
}

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

.pw-input-wrap {
  margin-bottom: 16px;
}

.pw-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font-main);
  font-size: 15px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-dropzone);
  color: var(--text-primary);
  outline: none;
  margin-bottom: 8px;
}

.pw-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.pw-show-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.pw-error {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-danger);
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

/* Info Section */
.info-section {
  max-width: 860px;
  margin: 0 auto;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.info-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.info-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.info-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-steps {
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  padding: 24px;
  margin-top: 60px;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

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

.footer-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

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

/* Responsive queries */
@media (max-width: 1080px) {
  .privacy-pill {
    display: none;
  }
}

@media (max-width: 860px) {
  .nav-container {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
  }
  .nav-tabs {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .compressor-card {
    padding: 24px 20px;
  }
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .control-group {
    justify-content: space-between;
  }
  .btn-compress {
    width: 100%;
  }
  .privacy-pill {
    display: none;
  }
  .preset-bar {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0;
  }
  .brand-title {
    font-size: 16px;
  }
  .brand-subtitle {
    display: none;
  }
  .card-header h1 {
    font-size: 26px;
  }
  .preset-bar {
    padding: 0 10px;
    gap: 6px;
  }
  .preset-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-download, .btn-preview {
    justify-content: center;
    width: 100%;
  }
  .rename-row {
    width: 100%;
  }
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
