/* ============================================
   RESIZEPRO - 2025 Award-Winning Design System
   ============================================ */

:root {
  /* Minimal Dark Theme - Clean & Professional */
  --bg: #0f0f0f;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.05);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  
  /* Minimal Accent - Subtle Blue-Gray */
  --accent: #60a5fa;
  --accent-light: #93c5fd;
  --accent-dark: #3b82f6;
  --accent-glow: rgba(96, 165, 250, 0.15);
  --success: #34d399;
  --error: #f87171;
  
  /* Minimal Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: rgba(0, 0, 0, 0.02);
  --surface-hover: rgba(0, 0, 0, 0.04);
  --glass: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.06);
  --text: #171717;
  --text-secondary: rgba(0, 0, 0, 0.65);
  --text-tertiary: rgba(0, 0, 0, 0.4);
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */

.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -200px;
  right: -200px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-dark) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ============================================
   APP CONTAINER
   ============================================ */

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  backdrop-filter: blur(24px) saturate(180%);
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 10px;
  color: white;
  transition: transform 0.2s ease;
}

.logo-icon:hover {
  transform: translateY(-1px);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

.icon-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

[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; }

/* ============================================
   UPLOAD VIEW
   ============================================ */

.upload-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.upload-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  padding: 100px 80px;
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(180%);
  border: 2px solid var(--glass-border);
  border-radius: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.upload-glow {
  position: absolute;
  inset: -2px;
  background: var(--accent);
  border-radius: 42px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.upload-card:hover .upload-glow,
.upload-card.dragover .upload-glow {
  opacity: 0.15;
}

.upload-card:hover,
.upload-card.dragover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.upload-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 24px;
  color: white;
}

.upload-icon svg {
  width: 56px;
  height: 56px;
}

.upload-card h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.upload-card p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 32px;
  font-weight: 500;
}

.upload-formats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.format-chip {
  padding: 8px 18px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.format-chip:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}

/* ============================================
   EDITOR VIEW & BENTO GRID
   ============================================ */

.editor-view {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  max-height: calc(100vh - 140px);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(100px, auto);
  gap: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

/* ============================================
   BENTO CARDS
   ============================================ */

.bento-card {
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  border-color: var(--glass-border);
  transform: translateY(-2px);
}

/* Canvas Card - Hero Element */
.canvas-card {
  grid-column: span 8;
  grid-row: span 6;
  display: flex;
  flex-direction: column;
  padding: 0;
  height: calc(100vh - 200px);
  max-height: 650px;
  min-height: 500px;
}

.card-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.1);
}

.toolbar-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-2px);
}

.toolbar-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
}

.file-badge {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

.file-badge .separator {
  color: var(--text-tertiary);
}

#fileMeta {
  color: var(--text-tertiary);
  font-weight: 500;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: var(--glass-border);
  margin: 0 4px;
}

/* Canvas Container */
.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  background: 
    radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.canvas-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

.canvas-viewport img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Zoom Controls */
.zoom-controls {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.zoom-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-btn svg {
  width: 20px;
  height: 20px;
}

.zoom-level {
  min-width: 60px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

/* Compare Slider */
.compare-slider {
  position: absolute;
  inset: 40px;
  overflow: hidden;
  border-radius: 16px;
}

.compare-slider img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  clip-path: inset(0 50% 0 0);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 100%);
  cursor: ew-resize;
  transform: translateX(-50%);
  box-shadow: 0 0 20px var(--accent-glow);
}

.compare-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 4px solid var(--accent);
}

/* ============================================
   CONTROL CARDS
   ============================================ */

.control-card {
  grid-column: span 4;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border-radius: 12px;
  color: white;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card-header h3 {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.value-badge {
  padding: 6px 14px;
  background: var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
}

/* Dimension Grid */
.dimension-grid {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.dim-input {
  flex: 1;
}

.dim-input label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dim-input input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dim-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
  background: var(--surface-hover);
}

.link-toggle {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 24px;
}

.link-toggle:hover {
  background: var(--surface-hover);
  transform: scale(1.05);
}

.link-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.link-toggle svg {
  width: 20px;
  height: 20px;
}

/* Scale Chips */
.scale-chips {
  display: flex;
  gap: 10px;
}

.chip {
  flex: 1;
  padding: 12px;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-2px);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Exam Presets System */
.preset-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.preset-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preset-search {
  margin-bottom: 12px;
}

.preset-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.preset-search-input:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.preset-search-input::placeholder {
  color: var(--text-tertiary);
}

.preset-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.preset-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateX(4px);
}

.preset-item:active {
  transform: scale(0.98);
}

.preset-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.preset-item-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.preset-item-size {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.preset-item-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-meta-tag {
  padding: 3px 8px;
  background: var(--glass-border);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.no-presets {
  padding: 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* Quality Hint */
.quality-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.hint-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.hint-text {
  font-weight: 500;
}

/* Range Sliders */
.range-slider {
  width: 100%;
  height: 10px;
  background: var(--surface);
  border-radius: 5px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: none;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
}

/* Mini Sliders */
.mini-slider {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.mini-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mini-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.mini-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: none;
}

.mini-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Format Selector */
.format-selector {
  display: flex;
  gap: 10px;
}

.format-option {
  flex: 1;
  padding: 18px 16px;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.format-option:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-2px);
}

.format-option.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.format-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}



.action-chip {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px;
}

.action-chip:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

.action-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.action-chip svg {
  width: 28px;
  height: 28px;
}

.chip-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Stats Card */
.stats-card {
  grid-column: span 4;
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat-block {
  flex: 1;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-number.accent {
  color: var(--success);
}

.stat-divider {
  width: 2px;
  height: 50px;
  background: var(--glass-border);
  border-radius: 1px;
}

/* Actions Card */
.actions-card {
  grid-column: span 4;
  display: flex;
  gap: 14px;
  padding: 20px;
}

.btn-reset,
.btn-download {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  border: none;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
}

.btn-reset {
  background: var(--surface);
  border: 2px solid var(--glass-border);
  color: var(--text);
}

.btn-reset:hover {
  background: var(--surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-download {
  background: var(--accent);
  color: white;
}

.btn-download:hover {
  transform: translateY(-2px);
  background: var(--accent-light);
}

.btn-reset svg,
.btn-download svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 28px 40px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-credit {
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
}

.credit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.credit-btn svg {
  width: 18px;
  height: 18px;
}

.credit-btn:hover {
  transform: translateY(-2px);
  background: var(--accent-light);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

#toast-container {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1000;
}

.toast {
  padding: 18px 28px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 300px;
  text-align: center;
}

.toast-success {
  border-color: var(--success);
}

.toast-error {
  border-color: var(--error);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 5px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ============================================
   INPUT STYLING
   ============================================ */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Desktop - 1400px+ */
@media (min-width: 1400px) {
  .bento-grid {
    max-width: 1800px;
  }
}

/* Desktop - 1200px to 1400px */
@media (max-width: 1400px) {
  .bento-grid {
    grid-template-columns: repeat(12, 1fr);
    max-width: 1400px;
  }
  
  .canvas-card {
    grid-column: span 8;
    grid-row: span 5;
    height: calc(100vh - 220px);
    max-height: 600px;
    min-height: 500px;
  }
  
  .control-card,
  .stats-card,
  .actions-card {
    grid-column: span 4;
  }
}

/* Tablet Landscape - 1024px to 1200px */
@media (max-width: 1200px) {
  .header {
    padding: 20px 32px;
  }
  
  .editor-view {
    padding: 28px;
  }
  
  .bento-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 18px;
  }
  
  .canvas-card {
    grid-column: span 8;
    grid-row: span 4;
    height: calc(100vh - 240px);
    max-height: 550px;
    min-height: 450px;
  }
  
  .control-card,
  .stats-card,
  .actions-card {
    grid-column: span 4;
  }
}

/* Tablet Portrait - 768px to 1024px */
@media (max-width: 1024px) {
  .header {
    padding: 18px 24px;
  }
  
  .header-center {
    display: none;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .logo-icon {
    width: 38px;
    height: 38px;
  }
  
  .icon-btn {
    width: 44px;
    height: 44px;
  }
  
  .upload-view {
    padding: 40px 24px;
  }
  
  .upload-card {
    padding: 80px 60px;
  }
  
  .upload-card h1 {
    font-size: 2.2rem;
  }
  
  .editor-view {
    padding: 20px;
  }
  
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .canvas-card {
    grid-column: span 1;
    grid-row: span 1;
    height: 60vh;
    max-height: 500px;
    min-height: 400px;
  }
  
  .control-card,
  .stats-card,
  .actions-card,
  .filters-card {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .card-toolbar {
    padding: 16px 20px;
  }
  
  .toolbar-btn {
    width: 40px;
    height: 40px;
  }
  
  .zoom-controls {
    padding: 10px 16px;
    gap: 10px;
  }
  
  .zoom-btn {
    width: 36px;
    height: 36px;
  }
}

/* Mobile Landscape - 640px to 768px */
@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
  }
  
  .logo {
    font-size: 1.1rem;
    gap: 10px;
  }
  
  .logo-icon {
    width: 36px;
    height: 36px;
  }
  
  .logo-icon svg {
    width: 18px;
    height: 18px;
  }
  
  .icon-btn {
    width: 42px;
    height: 42px;
  }
  
  .icon-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .upload-view {
    padding: 32px 20px;
  }
  
  .upload-card {
    padding: 60px 40px;
    border-radius: 32px;
  }
  
  .upload-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 24px;
  }
  
  .upload-icon svg {
    width: 48px;
    height: 48px;
  }
  
  .upload-card h1 {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  
  .upload-card p {
    font-size: 1rem;
    margin-bottom: 24px;
  }
  
  .format-chip {
    padding: 6px 14px;
    font-size: 0.75rem;
  }
  
  .editor-view {
    padding: 16px;
  }
  
  .bento-grid {
    gap: 14px;
  }
  
  .bento-card {
    padding: 20px;
    border-radius: 24px;
  }
  
  .canvas-card {
    height: 55vh;
    max-height: 450px;
    min-height: 350px;
  }
  
  .card-toolbar {
    padding: 14px 18px;
    gap: 12px;
  }
  
  .toolbar-btn {
    width: 38px;
    height: 38px;
  }
  
  .toolbar-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .file-badge {
    font-size: 0.85rem;
    gap: 8px;
  }
  
  .canvas-container {
    padding: 24px;
  }
  
  .zoom-controls {
    bottom: 20px;
    padding: 8px 14px;
    gap: 8px;
  }
  
  .zoom-btn {
    width: 34px;
    height: 34px;
  }
  
  .zoom-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .zoom-level {
    min-width: 50px;
    font-size: 0.85rem;
  }
  
  .card-header {
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
  }
  
  .card-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .card-header h3 {
    font-size: 1rem;
  }
  
  .value-badge {
    padding: 5px 12px;
    font-size: 0.75rem;
  }
  
  .dimension-grid {
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .dim-input input {
    padding: 12px 14px;
    font-size: 0.9rem;
  }
  
  .link-toggle {
    width: 44px;
    height: 44px;
    margin-top: 20px;
  }
  
  .scale-chips {
    gap: 8px;
  }
  
  .chip {
    padding: 10px;
    font-size: 0.8rem;
  }
  
  .format-selector {
    gap: 8px;
  }
  
  .format-option {
    padding: 16px 12px;
  }
  
  .format-name {
    font-size: 0.85rem;
  }
  
  .filter-sliders {
    gap: 16px;
  }
  
  .filter-row {
    gap: 14px;
  }
  
  .filter-row span {
    width: 80px;
    font-size: 0.8rem;
  }
  
  .transform-actions,
  .history-actions {
    gap: 10px;
  }
  
  .action-chip {
    padding: 14px;
    gap: 8px;
  }
  
  .action-chip svg {
    width: 24px;
    height: 24px;
  }
  
  .chip-label {
    font-size: 0.7rem;
  }
  
  .stats-card {
    gap: 20px;
  }
  
  .stat-number {
    font-size: 1.75rem;
  }
  
  .stat-divider {
    height: 45px;
  }
  
  .actions-card {
    gap: 12px;
    padding: 18px;
  }
  
  .btn-reset,
  .btn-download {
    padding: 16px;
    font-size: 0.9rem;
    gap: 10px;
  }
  
  .btn-reset svg,
  .btn-download svg {
    width: 20px;
    height: 20px;
  }
  
  .footer {
    padding: 24px 20px;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  
  .footer p {
    font-size: 0.85rem;
  }
  
  .footer-credit {
    flex-direction: column;
    gap: 12px;
  }
  
  .credit-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
  }
  
  #toast-container {
    bottom: 32px;
  }
  
  .toast {
    padding: 16px 24px;
    font-size: 0.9rem;
    min-width: 280px;
  }
}

/* Mobile Portrait - 480px to 640px */
@media (max-width: 640px) {
  .header {
    padding: 14px 16px;
  }
  
  .logo {
    font-size: 1rem;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
  }
  
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  
  .upload-card {
    padding: 50px 30px;
    border-radius: 28px;
  }
  
  .upload-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 20px;
  }
  
  .upload-card h1 {
    font-size: 1.75rem;
  }
  
  .upload-card p {
    font-size: 0.95rem;
  }
  
  .editor-view {
    padding: 12px;
  }
  
  .bento-grid {
    gap: 12px;
  }
  
  .bento-card {
    padding: 18px;
    border-radius: 20px;
  }
  
  .canvas-card {
    height: 50vh;
    max-height: 400px;
    min-height: 320px;
  }
  
  .card-toolbar {
    padding: 12px 16px;
    gap: 10px;
  }
  
  .toolbar-btn {
    width: 36px;
    height: 36px;
  }
  
  .file-badge {
    font-size: 0.8rem;
  }
  
  .canvas-container {
    padding: 20px;
  }
  
  .zoom-controls {
    bottom: 16px;
    padding: 6px 12px;
  }
  
  .zoom-btn {
    width: 32px;
    height: 32px;
  }
  
  .zoom-level {
    font-size: 0.8rem;
  }
  
  .card-header {
    gap: 10px;
    margin-bottom: 14px;
  }
  
  .card-icon {
    width: 36px;
    height: 36px;
  }
  
  .card-header h3 {
    font-size: 0.95rem;
  }
  
  .dimension-grid {
    gap: 10px;
  }
  
  .dim-input input {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .link-toggle {
    width: 40px;
    height: 40px;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .actions-card {
    flex-direction: column;
    padding: 16px;
  }
  
  .btn-reset,
  .btn-download {
    width: 100%;
  }
  
  .footer {
    padding: 20px 16px;
  }
}

/* Small Mobile - Below 480px */
@media (max-width: 480px) {
  .orb-1,
  .orb-2,
  .orb-3 {
    filter: blur(80px);
    opacity: 0.4;
  }
  
  .header {
    padding: 12px 14px;
  }
  
  .upload-card {
    padding: 40px 24px;
  }
  
  .upload-icon {
    width: 80px;
    height: 80px;
  }
  
  .upload-card h1 {
    font-size: 1.5rem;
  }
  
  .canvas-card {
    height: 45vh;
    max-height: 350px;
    min-height: 280px;
  }
  
  .canvas-container {
    padding: 16px;
  }
  
  .zoom-controls {
    scale: 0.9;
  }
  
  .filter-row span {
    width: 70px;
    font-size: 0.75rem;
  }
  
  .action-chip {
    padding: 12px;
  }
  
  .action-chip svg {
    width: 22px;
    height: 22px;
  }
  
  .chip-label {
    font-size: 0.65rem;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* GPU Acceleration */
.bento-card,
.upload-card,
.toolbar-btn,
.zoom-btn,
.action-chip,
.btn-download,
.btn-reset {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
