/* ==========================================================================
   ImageSwift Web — Design System & Styles
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0a0d14;
  --bg-secondary: #121824;
  --bg-card: rgba(20, 27, 41, 0.75);
  --bg-card-hover: rgba(28, 38, 58, 0.85);
  --bg-glass: rgba(18, 24, 38, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-focus: rgba(99, 102, 241, 0.5);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glass-focus: rgba(99, 102, 241, 0.6);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #94a3b8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.12);
}

/* Reset & Base */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

/* Ambient Background Glow */
.app-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  transition: transform 0.5s ease;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -100px;
  left: 10%;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  bottom: 5%;
  right: 5%;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  top: 40%;
  left: 45%;
  animation: floatOrb 26s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Layout Container - Centered, Fluid, and Symmetric */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3.5vw, 40px);
  box-sizing: border-box;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 0;
  width: 100%;
}

.header-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3.5vw, 40px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Brand Icon — Free Default: Electric Indigo / Cyan Modern */
.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  color: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

/* Brand Icon — PRO Mode: Royal Gold Luxury Medallion */
[data-pro="true"] .brand-icon,
.pro-active .brand-icon {
  background: linear-gradient(135deg, #fef08a 0%, #fbbf24 30%, #f59e0b 65%, #d97706 100%) !important;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5), 0 0 12px rgba(251, 191, 36, 0.35) !important;
  border: 1px solid rgba(254, 240, 138, 0.6) !important;
}

[data-pro="true"] .brand-icon svg,
.pro-active .brand-icon svg {
  color: #78350f !important;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.6));
}

[data-pro="true"] .brand-icon::after,
.pro-active .brand-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 35%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 65%
  );
  transform: rotate(25deg);
  animation: goldShimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes goldShimmer {
  0% { transform: translateY(-120%) rotate(25deg); }
  35% { transform: translateY(120%) rotate(25deg); }
  100% { transform: translateY(120%) rotate(25deg); }
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Badge Web — Free Mode vs PRO Mode */
.badge-web {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

[data-pro="true"] .badge-web,
.pro-active .badge-web,
.badge-web.badge-pro-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(254, 240, 138, 0.5) !important;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4) !important;
}

/* PRO Step Accent & Buttons */
[data-pro="true"] .step-num-accent,
.pro-active .step-num-accent {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.45) !important;
  border: none !important;
  color: #ffffff !important;
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.privacy-badge svg {
  width: 15px;
  height: 15px;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* Main Content */
.main-content {
  position: relative;
  z-index: 10;
  padding: 28px 0 60px;
}

/* Hero Split Grid (2-Column Architecture: Left Input / Right Output) */
.hero-split-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .hero-split-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.hero-col {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hero-col-card {
  height: 100%;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color var(--transition-fast);
}

.hero-input-card {
  justify-content: flex-start;
}

.hero-output-card {
  justify-content: space-between;
  gap: 14px;
}

.hero-dropzone {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 26px 18px;
  min-height: 420px;
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.025);
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.hero-dropzone:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.hero-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
  width: 100%;
  box-sizing: border-box;
}

.hero-col-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.18);
  color: var(--accent-primary);
  border: 1.5px solid rgba(99, 102, 241, 0.4);
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-num-accent {
  background: var(--accent-gradient);
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.hero-col-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-col-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.hero-badge-tag svg {
  width: 14px;
  height: 14px;
}

/* Active Format Pill */
.active-format-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.active-format-pill small {
  font-weight: 500;
  color: var(--text-muted);
}

/* Output Format Chips */
.output-format-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.format-chips-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chips-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-sub);
}

.format-chips-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .format-chips-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
}

.format-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 3px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  outline: none;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.format-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.format-chip.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
}

.format-chip .chip-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.format-chip.active .chip-title {
  color: var(--accent-primary);
}

[data-theme="light"] .format-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .format-chip:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .format-chip.active {
  background: #eff6ff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

.chip-badge {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

.chip-badge-primary { color: #818cf8; }
.chip-badge-nextgen { color: #38bdf8; }
.chip-badge-doc { color: #f87171; }
.chip-badge-vector { color: #fbbf24; }

/* Output Quality Box */
.output-quality-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

[data-theme="light"] .output-quality-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.quality-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quality-label-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.quality-label-text svg {
  width: 15px;
  height: 15px;
  color: var(--accent-primary);
}

.quality-preset-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.qpreset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.qpreset-label-full {
  display: inline;
  white-space: nowrap;
}

.qpreset-label-short {
  display: none;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .qpreset-label-full {
    display: none !important;
  }
  .qpreset-label-short {
    display: inline !important;
    font-size: 0.72rem;
    font-weight: 700;
  }
}

.qpreset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.qpreset-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 700;
}

.qpreset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qpreset-icon svg,
.qpreset-icon i {
  width: 13px;
  height: 13px;
  display: inline-block;
  vertical-align: middle;
}

.custom-range-hero {
  margin-top: 2px;
}

.smart-quality-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}

.smart-quality-hint svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Quick Settings Grid */
.hero-quick-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .hero-quick-settings-grid {
    grid-template-columns: 1fr;
  }
}

.hero-setting-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

[data-theme="light"] .hero-setting-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.hero-setting-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.hero-setting-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent-primary);
}

.color-picker-compact {
  gap: 6px;
}

.color-picker-compact .color-option {
  font-size: 0.74rem;
  padding: 4px 6px;
}

.custom-select-sm {
  padding: 6px 28px 6px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.custom-input-sm {
  padding: 5px 8px;
  font-size: 0.78rem;
}

/* Hero Output Action Bar */
.hero-output-action-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.btn-hero-action {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-hero-action svg {
  width: 20px;
  height: 20px;
}

.hero-count-pill {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 22px;
  text-align: center;
}

.hero-action-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
}

/* Drop Zone Base */
.dropzone-section {
  margin-bottom: 24px;
}

.drop-zone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 42px 20px;
  text-align: center;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.drop-icon-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent-primary);
  transition: var(--transition);
}

.drop-zone:hover .drop-icon-wrapper {
  transform: scale(1.1);
  background: var(--accent-gradient);
  color: white;
}

.drop-main-icon {
  width: 36px;
  height: 36px;
}

.drop-zone h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-zone-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 22px;
}

.drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.supported-formats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.format-label {
  font-size: 0.78rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.format-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  transition: var(--transition);
}

.tag-featured {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
  font-weight: 700;
}

.tag-raw {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.35);
  color: #f472b6;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  user-select: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-glass);
  color: var(--text-muted);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}

.btn-accent {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
}

.btn-glow {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
}

.btn-glow:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.65);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

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

/* Controls Section */
.controls-section {
  padding: 12px 18px;
  margin-bottom: 22px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-title svg {
  width: 22px;
  height: 22px;
  color: var(--accent-primary);
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.35));
}

.panel-title h3 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stats-counter {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  letter-spacing: 0.02em;
}

.badge-sub {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-color: var(--border-glass);
}

[data-theme="light"] .badge-sub {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* Controls Grid - Spacious, full-width responsive layout */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }
}

/* Control Card Container */
.control-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: var(--transition);
  position: relative;
}

.control-group:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .control-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .control-group:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.control-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.control-label svg {
  width: 17px;
  height: 17px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.value-pill {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .value-pill {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

/* Custom Select & Inputs */
.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.custom-select, .custom-input {
  width: 100%;
  padding: 12px 38px 12px 14px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
  appearance: none;
  color-scheme: dark;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.custom-select:hover, .custom-input:hover {
  border-color: rgba(99, 102, 241, 0.45);
}

.custom-select:focus, .custom-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.custom-select option {
  background-color: #121824;
  color: #f8fafc;
  padding: 10px;
}

.custom-select optgroup {
  background-color: #0d121c;
  color: #818cf8;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 0;
}

[data-theme="light"] .custom-select,
[data-theme="light"] .custom-input {
  color-scheme: light;
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .custom-select:focus,
[data-theme="light"] .custom-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .custom-select option {
  background-color: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .custom-select optgroup {
  background-color: #f1f5f9;
  color: #4f46e5;
}

/* In-App Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  animation: slideUpToast 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s ease;
}

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

.toast-info { border-left: 4px solid var(--accent-primary); }
.toast-info svg { color: var(--accent-primary); }

.toast-success { border-left: 4px solid var(--success); }
.toast-success svg { color: var(--success); }

.toast-error { border-left: 4px solid var(--danger); }
.toast-error svg { color: var(--danger); }

.spin {
  animation: spinAnim 1s linear infinite;
}

@keyframes spinAnim {
  100% { transform: rotate(360deg); }
}

.select-chevron {
  position: absolute;
  right: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Range Slider */
.custom-range {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  transition: var(--transition);
  cursor: pointer;
  margin: 6px 0;
}

[data-theme="light"] .custom-range {
  background: #e2e8f0;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2.5px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 14px rgba(99, 102, 241, 0.7);
}

.range-marks {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  gap: 4px;
  margin-top: 4px;
  width: 100%;
  box-sizing: border-box;
}

.range-mark-full {
  display: inline;
}

.range-mark-short {
  display: none;
}

@media (max-width: 600px) {
  .range-mark-full {
    display: none !important;
  }
  .range-mark-short {
    display: inline !important;
    font-size: 0.68rem;
  }
}

/* Custom Resize Row */
.custom-resize-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.resize-x {
  color: var(--text-sub);
  font-weight: bold;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

/* Color Picker Row (Transparency Chips) */
.color-picker-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 2px 0;
}

.color-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}

[data-theme="light"] .color-option {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.color-option:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-main);
}

.color-option input[type="radio"] {
  display: none;
}

.color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  transition: transform 0.15s ease;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.color-option:has(input[type="radio"]:checked) {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .color-option:has(input[type="radio"]:checked) {
  background: #eef2ff;
  border-color: var(--accent-primary);
  color: #4338ca;
}

.color-option input[type="radio"]:checked + .color-swatch {
  transform: scale(1.15);
  border-color: var(--accent-primary);
}

.swatch-transparent {
  background: repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 50% / 6px 6px;
}

/* ==========================================================================
   Herramientas Avanzadas (Acordeón Desplegable y No Invasivo)
   ========================================================================== */
.advanced-tools-wrapper {
  margin-top: 0;
  margin-bottom: 0;
}

.advanced-tools-toggle {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  outline: none;
  box-sizing: border-box;
  overflow: hidden;
}

.advanced-tools-toggle:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.4);
}

.advanced-tools-toggle.open {
  border-style: solid;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.06);
}

.toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.toggle-title {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.toggle-feature-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 6px;
}

@media (max-width: 900px) {
  .toggle-feature-pills {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .toggle-action-label {
    display: none !important;
  }
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

.mini-pill svg {
  width: 12px;
  height: 12px;
  color: var(--accent-primary);
}

.toggle-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-action-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.adv-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pro-featured-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(99, 102, 241, 0.06) 100%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

.pro-featured-card:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .pro-featured-card {
  background: linear-gradient(135deg, #fffbfb 0%, #fbfaff 100%);
  border-color: #fca5a5;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.06);
}

[data-theme="light"] .mini-pill {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.toggle-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.toggle-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.toggle-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.advanced-tools-toggle.open .toggle-arrow {
  transform: rotate(180deg);
  color: var(--accent-primary);
}

.advanced-tools-panel {
  margin-top: 14px;
  animation: advSlideDown 0.25s ease-out forwards;
}

@keyframes advSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.advanced-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 860px) {
  .advanced-tools-grid {
    grid-template-columns: 1fr;
  }
  .toggle-sub {
    display: none;
  }
}

.advanced-tool-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
}

.advanced-tool-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.035);
}

.adv-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.adv-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.adv-card-label svg {
  width: 17px;
  height: 17px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.adv-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.adv-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.adv-input-col {
  display: flex;
  flex-direction: column;
}

.adv-input-group {
  display: flex;
  align-items: center;
  width: 200px;
}

.adv-input-group input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  font-size: 0.85rem;
}

.adv-unit-select {
  width: 65px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
  padding: 8px 6px;
  font-size: 0.82rem;
}

.adv-quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.35);
}

.chip-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* Filtros y Sliders */
.filter-chip-group {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.filter-chip:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.3);
}

.filter-chip.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.adv-sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.adv-slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
  font-size: 0.74rem;
}

.custom-range-sm {
  height: 4px;
}

.custom-input-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
}

/* Escenario de Previsualización en Vivo de Filtros */
.filter-live-preview-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px;
}

.btn-micro {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-micro svg {
  width: 12px;
  height: 12px;
}

.btn-micro:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.btn-micro.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.filter-live-preview-stage {
  width: 100%;
  background: #090d16;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-preview-canvas {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  display: block;
}

.filter-preview-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--accent-light, #a5b4fc);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* EXIF & Privacy */
.adv-badge-safe {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.adv-exif-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 197, 94, 0.15);
}

/* Reorder Hint & Draggable Cards */
.queue-reorder-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.queue-reorder-hint svg {
  width: 13px;
  height: 13px;
  color: var(--accent-primary);
}

.card-drag-handle {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 3;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-drag-handle svg {
  width: 15px;
  height: 15px;
}

.card-drag-handle:hover {
  opacity: 1;
  transform: scale(1.08);
}

.card-drag-handle:active {
  cursor: grabbing;
}

.image-card.dragging {
  opacity: 0.4;
  transform: scale(0.96);
  border: 2px dashed var(--accent-primary);
}

.image-card.drag-over {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

/* Light Theme Overrides */
[data-theme="light"] .advanced-tools-toggle {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .advanced-tools-toggle:hover {
  background: #f1f5f9;
  border-color: var(--accent-primary);
}

[data-theme="light"] .advanced-tools-toggle.open {
  background: #eef2ff;
  border-color: var(--accent-primary);
}

[data-theme="light"] .advanced-tool-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .chip-btn {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

[data-theme="light"] .filter-chip {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

[data-theme="light"] .queue-reorder-hint {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* Actions Bar */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  margin-top: 4px;
  border-top: 1px solid var(--border-glass);
}

.left-actions, .right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Progress Container */
.progress-container {
  margin-top: 0;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-percent {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-sub-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.savings-text {
  color: var(--success);
  font-weight: 600;
}

/* Queue Section */
.queue-section {
  margin-bottom: 24px;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.queue-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.queue-actions-group .btn {
  padding: 8px 16px;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

.queue-actions-group #btnConvertAll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
}

.queue-actions-group #btnClearList {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.queue-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.queue-view-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 3px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.toggle-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
}

.toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--text-sub);
}

.empty-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Image Grid */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.image-grid.list-view {
  grid-template-columns: 1fr;
}

/* Image Card */
.image-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.image-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-sm);
}

.card-thumb-wrapper {
  height: 150px;
  background: #00000020;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.card-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.card-thumb-wrapper:hover .card-thumb {
  transform: scale(1.05);
}

.card-overlay-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  backdrop-filter: blur(4px);
}

.card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-filename {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.card-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-pending { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.status-converting { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.status-success { background: var(--success-bg); color: var(--success); }
.status-error { background: var(--danger-bg); color: var(--danger); }

.card-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-sub);
}

.size-change {
  font-weight: 600;
}

.size-reduced { color: var(--success); }
.size-increased { color: var(--warning); }

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-glass);
}

.btn-card-sm {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn-card-download {
  background: var(--success);
  color: white;
}

.btn-card-download:hover {
  filter: brightness(1.1);
}

.btn-card-delete {
  background: transparent;
  color: var(--text-sub);
}

.btn-card-delete:hover {
  color: var(--danger);
}

/* List View specific card styles */
.image-grid.list-view .image-card {
  flex-direction: row;
  height: 72px;
  align-items: center;
}

.image-grid.list-view .card-thumb-wrapper {
  width: 90px;
  height: 100%;
  flex-shrink: 0;
}

.image-grid.list-view .card-body {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.image-grid.list-view .card-actions {
  border-top: none;
  padding-top: 0;
}


/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

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

.modal-dialog {
  width: 100%;
  max-width: 580px;
  padding: 24px;
  border-radius: var(--radius-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.preview-dialog {
  max-width: 820px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title svg {
  color: var(--accent-primary);
}

.icon-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.icon-btn-sm:hover { color: var(--text-main); }

.feature-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.feature-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.feature-item svg {
  width: 22px;
  height: 22px;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.feature-item h5 {
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.shortcuts-box {
  background: rgba(99, 102, 241, 0.08);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.shortcuts-box h5 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.shortcuts-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

kbd {
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Before / After Preview Modal */
.preview-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.preview-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-badge-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.preview-badge-label.converted {
  color: var(--success);
}

.preview-img-box {
  height: 280px;
  background: #00000030;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-meta-info {
  font-size: 0.78rem;
  color: var(--text-sub);
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-glass);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 clamp(16px, 3.5vw, 48px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand {
  font-weight: 700;
  color: var(--text-main);
}

.footer-badge {
  font-size: 0.68rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  display: inline-block;
}

.lang-selector-footer {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
}

.lang-selector-footer .lang-select {
  font-size: 0.78rem;
  color: var(--text-muted);
}

[data-theme="light"] .lang-selector-footer {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Responsiveness & Mobile Navigation Optimization
   ========================================================================== */

/* PRO Label responsive helper classes */
.pro-label-full {
  display: inline;
}

.pro-label-short {
  display: none;
}

@media (max-width: 768px) {
  /* Strict Viewport & Symmetric Container Centering */
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
  }

  .container,
  .header-container {
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Ultra-sleek single-line mobile navigation bar */
  .app-header {
    padding: 8px 0;
  }

  .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .brand-container {
    gap: 8px;
    flex-shrink: 0;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-icon svg {
    width: 18px;
    height: 18px;
  }

  .brand-text h1 {
    font-size: 1.15rem;
    gap: 6px;
    margin: 0;
  }

  /* Eliminate clutter and vertical saturation on mobile header */
  .badge-web,
  .brand-tagline,
  .privacy-badge,
  #btnInfo,
  .header-actions .lang-selector-wrapper {
    display: none !important;
  }

  /* Hide mini feature pills on mobile accordion toggle to prevent horizontal expansion */
  .toggle-feature-pills {
    display: none !important;
  }

  /* Header actions on a single sleek horizontal tier */
  .header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    width: auto;
  }

  /* Sleek PRO pill badge */
  .btn-pro-glow {
    padding: 6px 12px;
    font-size: 0.76rem;
    gap: 4px;
    letter-spacing: 0.02em;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  }

  .btn-pro-glow svg {
    width: 13px;
    height: 13px;
  }

  .pro-label-full {
    display: none !important;
  }

  .pro-label-short {
    display: inline !important;
    font-weight: 800;
  }

  /* Compact Install App button as sleek circular icon */
  .btn-install-app {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .btn-install-app .install-text {
    display: none !important;
  }

  .btn-install-app svg {
    width: 15px;
    height: 15px;
  }

  /* Compact icon button for theme toggle */
  .icon-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .icon-btn svg {
    width: 15px;
    height: 15px;
  }

  /* Symmetric Hero Cards on Mobile */
  .hero-split-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
    width: 100%;
  }

  .hero-col-card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .hero-dropzone {
    min-height: 300px;
    padding: 20px 12px;
  }

  .hero-output-card {
    gap: 12px;
  }

  .hero-col-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .hero-col-title {
    gap: 8px;
  }

  .hero-col-title h3 {
    font-size: 1rem;
  }

  .hero-col-subtitle {
    font-size: 0.74rem;
    max-width: 160px;
  }

  /* Single-Tier Status Counter (No vertical wrapping) */
  .stats-counter {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
  }

  .stats-counter .badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    white-space: nowrap;
    line-height: 1.2;
  }

  .format-chips-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .format-chip {
    padding: 6px 3px;
    min-height: 44px;
  }

  .format-chip .chip-title {
    font-size: 0.78rem;
  }

  .format-chip .chip-badge {
    font-size: 0.58rem;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .footer-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
  }

  .actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .left-actions, .right-actions {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .preview-comparison {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container,
  .header-container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .app-header {
    padding: 6px 0;
  }

  .header-container {
    gap: 4px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .brand-icon svg {
    width: 16px;
    height: 16px;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }

  .header-actions {
    gap: 4px;
  }

  /* On narrow mobile screens, collapse Install App to a sleek circular icon */
  .btn-install-app {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .btn-install-app .install-text {
    display: none !important;
  }

  .btn-pro-glow {
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  .btn-pro-glow svg {
    width: 12px;
    height: 12px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  /* Symmetric Card Spacing */
  .hero-col-card {
    padding: 14px 10px;
  }

  .hero-dropzone {
    min-height: 250px;
    padding: 16px 8px;
  }

  .drop-zone-content h2 {
    font-size: 1.15rem;
  }

  .drop-zone-sub {
    font-size: 0.76rem;
    margin-bottom: 14px;
  }

  .drop-actions {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 14px auto;
    gap: 6px;
  }

  .drop-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 9px 12px;
    font-size: 0.82rem;
  }

  .supported-formats .format-label {
    font-size: 0.68rem;
    margin-bottom: 4px;
  }

  .supported-formats .format-tags {
    gap: 4px;
  }

  .supported-formats .tag {
    font-size: 0.64rem;
    padding: 2px 5px;
  }

  .hero-col-title h3 {
    font-size: 0.94rem;
  }

  .hero-col-subtitle {
    font-size: 0.7rem;
    max-width: 130px;
  }

  .stats-counter {
    gap: 4px;
  }

  .stats-counter .badge {
    font-size: 0.66rem;
    padding: 2px 5px;
  }

  .quality-preset-chips {
    gap: 4px;
  }

  .qpreset-btn {
    padding: 5px 2px;
    font-size: 0.66rem;
  }

  .controls-section {
    padding: 14px 10px;
  }
}

/* ==========================================================================
   ImageSwift Web — Internationalization (i18n) & PRO Monetization Styles
   ========================================================================== */

/* Language Selector */
.lang-selector-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px 10px 4px 10px;
  transition: var(--transition);
}

.lang-selector-wrapper:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.globe-icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  margin-right: 6px;
  pointer-events: none;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  padding-right: 18px;
  cursor: pointer;
  outline: none;
}

.lang-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.lang-chevron {
  position: absolute;
  right: 8px;
  width: 13px;
  height: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

/* PRO Golden Glow Button */
.btn-pro-glow {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
  transition: var(--transition);
  animation: proPulse 2.8s infinite ease-in-out;
}

.btn-pro-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
  filter: brightness(1.1);
}

.btn-pro-active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  animation: none;
}

@keyframes proPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 26px rgba(245, 158, 11, 0.6); }
}

/* PRO Badge Indicator */
.badge-pro-pill {
  font-size: 0.65rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

/* Watermark Control Group (Spans across all columns as a PRO banner) */
#watermarkGroup {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

[data-theme="light"] #watermarkGroup {
  background: linear-gradient(135deg, #fffdfa 0%, #fbfaff 100%);
  border-color: #fde68a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.06);
}

#watermarkGroup:hover {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.12);
}

.watermark-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 10px;
}

[data-theme="light"] .watermark-box {
  background: #ffffff;
  border-color: #e2e8f0;
}

.watermark-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
  align-items: center;
}

@media (max-width: 640px) {
  .watermark-inputs-grid {
    grid-template-columns: 1fr;
  }
}

/* Selector de tipo de marca de agua (Segmented Control) */
.watermark-type-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.wm-type-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.wm-type-btn svg {
  width: 14px;
  height: 14px;
}

.wm-type-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.wm-type-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Fila de logo subido */
.wm-logo-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

/* Escenario de Previsualización en Vivo */
.wm-live-preview-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px;
}

.wm-live-preview-stage {
  width: 100%;
  background: #090d16;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wm-preview-canvas {
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
  display: block;
}

/* PDF Multipágina Options Box */
.pdf-options-box {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  animation: fadeIn 0.3s ease;
}

[data-theme="light"] .pdf-options-box {
  background: linear-gradient(135deg, #f8faff 0%, #fffdf5 100%);
  border-color: #fde68a;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}

.pdf-settings-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 10px;
}

[data-theme="light"] .pdf-settings-box {
  background: #ffffff;
  border-color: #e2e8f0;
}

.pdf-settings-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.pdf-setting-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-sublabel {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.custom-select-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

/* Input with Icon Container */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon .custom-input {
  padding-left: 42px;
  width: 100%;
}

.feedback-error {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
}

[data-theme="light"] .feedback-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* Modals PRO Styles */
.pro-dialog {
  max-width: 580px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.2);
}

.pro-hero-header {
  text-align: center;
  padding: 10px 0 20px 0;
  border-bottom: 1px solid var(--border-glass);
}

.pro-lifetime-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.pro-pricing-block {
  margin: 16px 0 8px 0;
}

.pro-price-tag {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.pro-price-period {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.pro-feature-list {
  list-style: none;
  padding: 16px 0;
  margin: 0;
}

.pro-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 7px 0;
}

.pro-feature-list li i {
  color: #10b981;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pro-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.btn-buy-pro {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-buy-pro:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 26px rgba(245, 158, 11, 0.55);
}

.pro-link-secondary {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-align: center;
  transition: var(--transition);
}

.pro-link-secondary:hover {
  color: var(--accent-primary);
}

/* Activation Form */
.activate-form-group {
  margin-bottom: 16px;
}

.activate-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.activate-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.activate-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.activate-feedback {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}

.feedback-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

.feedback-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* ==========================================================================
   Install App (PWA) Button & Modal
   ========================================================================== */
.btn-install-app {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light, #818cf8);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-install-app:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--accent-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-install-app svg {
  width: 15px;
  height: 15px;
}

[data-theme="light"] .btn-install-app {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .btn-install-app:hover {
  background: rgba(99, 102, 241, 0.16);
  color: #4338ca;
}

/* Install Modal Dialog */
.install-dialog {
  max-width: 580px;
}

.install-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.install-platforms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.install-platform-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition);
}

.install-platform-card:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(3px);
}

.platform-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-light, #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-icon svg {
  width: 20px;
  height: 20px;
}

.platform-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.platform-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.platform-content strong {
  color: var(--accent-light, #a5b4fc);
}

/* ==========================================================================
   Estudio de Previsualización y Edición de PDF (PDF Studio)
   ========================================================================== */
.pdf-studio-dialog {
  max-width: 1040px;
  width: 95vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
}

.pdf-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-glass);
  flex-wrap: wrap;
  gap: 14px;
}

.pdf-studio-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  margin-top: 2px;
}

.pdf-studio-header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pdf-global-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pdf-studio-body {
  display: flex;
  gap: 18px;
  flex: 1;
  min-height: 480px;
  overflow: hidden;
  padding: 16px 0;
}

/* Tira lateral de miniaturas */
.pdf-studio-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.pdf-sidebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.pdf-sidebar-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pdf-thumbnails-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-thumb-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.pdf-thumb-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.07);
}

.pdf-thumb-card.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
}

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

.thumb-page-num {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent-light, #a5b4fc);
  font-family: var(--font-mono);
}

.thumb-actions {
  display: flex;
  gap: 3px;
}

.thumb-btn-mini {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  border-radius: 3px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.thumb-btn-mini svg {
  width: 12px;
  height: 12px;
}

.thumb-btn-mini:hover:not(:disabled) {
  background: var(--accent-primary);
  color: #fff;
}

.thumb-btn-mini.btn-thumb-delete:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.thumb-btn-mini:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.thumb-preview-box {
  width: 100%;
  height: 90px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
}

.thumb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.thumb-footer {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb-filename {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Escenario Central con Hoja Real */
.pdf-studio-stage-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.4) 0%, rgba(10, 15, 29, 0.8) 100%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  overflow: hidden;
  position: relative;
}

/* Barra de herramientas flotante */
.pdf-stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  margin-bottom: 10px;
  z-index: 5;
  flex-wrap: wrap;
  gap: 8px;
}

.page-indicator-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-light, #a5b4fc);
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-full);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.tool-btn svg {
  width: 14px;
  height: 14px;
}

.tool-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
  border-color: var(--accent-primary);
}

.tool-btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border-color: #ef4444;
}

.zoom-value {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  color: var(--text-main);
}

/* Visor de Hoja de Papel */
.pdf-paper-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: auto;
  min-height: 350px;
}

.pdf-sheet {
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: aspect-ratio 0.25s ease, width 0.25s ease, height 0.25s ease;
}

.pdf-sheet-margin {
  flex: 1;
  margin: 10px;
  border: 1px dashed rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border-radius: 2px;
}

.pdf-sheet-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#pdfSheetImage {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-sheet-footer-page {
  position: absolute;
  bottom: 2px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-mono);
}

/* Navegación y Pie del Escenario */
.pdf-stage-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-page-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.nav-page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pdf-stage-info-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Pie del modal */
.pdf-studio-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
  flex-wrap: wrap;
  gap: 12px;
}

.pdf-footer-left {
  display: flex;
  align-items: center;
}

.pdf-guarantee-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pdf-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px) {
  .pdf-studio-body {
    flex-direction: column;
  }
  .pdf-studio-sidebar {
    width: 100%;
    height: 140px;
  }
  .pdf-thumbnails-list {
    flex-direction: row;
    overflow-x: auto;
  }
  .pdf-thumb-card {
    min-width: 110px;
  }
}

/* ==========================================================================
   Zero Horizontal Overflow & Strict Mobile Viewport Shield
   ========================================================================== */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  position: relative !important;
}

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

.main-content,
.container,
.hero-split-grid,
.hero-col,
.hero-col-card,
.hero-input-card,
.hero-output-card,
.hero-dropzone,
.drop-zone-content,
.output-format-section,
.output-quality-box,
.hero-quick-settings-grid,
.controls-section,
.advanced-tools-wrapper,
.advanced-tools-toggle,
.queue-container,
.actions-bar {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .hero-col-card {
    overflow: hidden !important;
  }
  .hero-dropzone {
    overflow: hidden !important;
  }
}



