/**
 * LUI IMAGE OPTIMIZER — Stylesheet
 * Cyber HUD & Glassmorphism Design System
 * 100% Client-Side Privacy Suite by Lui Visual (luifierey.my.id)
 */

:root {
  --bg-main: #020617;
  --bg-card: rgba(10, 15, 30, 0.85);
  --bg-card-hover: rgba(15, 23, 42, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.35);
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.4);
  --neon-green: #00ff88;
  --neon-green-glow: rgba(0, 255, 136, 0.35);
  --neon-purple: #a855f7;
  --neon-pink: #ec4899;
  --text-main: #f8fafc;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-hud: 'Plus Jakarta Sans', sans-serif;
  --font-logo: 'Orbitron', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  height: 100%;
}

html, body {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Cyber Ambient Grid & Floating Glowing Orbs */
.bg-grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

.bg-orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.20) 0%, rgba(0, 136, 255, 0.07) 45%, transparent 70%);
  top: -100px;
  left: -100px;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0.06) 45%, transparent 70%);
  bottom: 50px;
  right: -150px;
}

.bg-orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.16) 0%, rgba(0, 255, 136, 0.05) 45%, transparent 70%);
  top: 40%;
  right: 25%;
}

@media (max-width: 768px) {
  .hud-nav, .glassmorphism, .hud-bottom-bar, .glass-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(10, 15, 30, 0.95) !important;
  }
}

@keyframes orbFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, 30px, 0) scale(1.08); }
  100% { transform: translate3d(-30px, 50px, 0) scale(0.95); }
}

/* Glassmorphism Utility */
.glassmorphism {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
}

/* HUD Navigation Bar */
.hud-nav {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  box-shadow: none;
}

.nav-container {
  width: 100%;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.brand-logo-link:hover {
  transform: scale(1.02);
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.75));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.brand-logo-link:hover .brand-logo-img {
  transform: scale(1.08);
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.95));
}

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

.brand-title {
  font-family: var(--font-logo, 'Orbitron', sans-serif);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  display: block;
  white-space: nowrap;
  color: #ffffff;
  line-height: 1.2;
}

.text-gradient {
  color: var(--neon-cyan, #00f0ff);
  background: none;
  -webkit-text-fill-color: initial;
  font-weight: 900;
}

.brand-sub {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--neon-cyan, #00f0ff);
  display: block;
  white-space: nowrap;
  margin-top: 2px;
}

.brand-sub-author {
  color: #ffffff;
}

/* Nav Actions (Right) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tool Dropdown Menu */
.tool-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.tool-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 13, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f0f4fc;
  padding: 6px 14px;
  border-radius: 10px;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 38px;
}

.tool-dropdown-btn:hover, .tool-dropdown-wrap.open .tool-dropdown-btn {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  color: #fff;
}

.tool-dropdown-btn .dropdown-arrow {
  font-size: 0.65rem;
  transition: transform 0.25s ease;
}

.tool-dropdown-wrap.open .dropdown-arrow {
  transform: rotate(180deg);
}

.tool-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: rgba(10, 13, 24, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 240, 255, 0.15);
  z-index: 1000;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-dropdown-wrap.open .tool-dropdown-menu {
  display: block;
}

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

.dropdown-header {
  padding: 6px 12px 8px;
  font-size: 0.65rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 800;
  color: var(--text-dim, #8e9bb8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #f0f4fc;
  transition: all 0.18s ease;
}
.dropdown-item i {
  color: var(--neon-cyan) !important;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(3px);
  color: #fff;
}

.dropdown-item.active {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.dropdown-item-title {
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.dropdown-item-desc {
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.68rem;
  color: #8e9bb8;
}

.hud-btn-support, .btn-sawer-nav, .btn-support-nav {
  height: 38px;
  background: rgba(0, 240, 255, 0.08);
  border: 1.5px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  text-decoration: none;
}
.hud-btn-support i, .btn-sawer-nav i, .btn-support-nav i {
  color: var(--neon-cyan) !important;
  transition: color 0.2s ease;
}
.hud-btn-support:hover, .btn-sawer-nav:hover, .btn-support-nav:hover {
  background: var(--neon-cyan);
  color: #07090e;
  box-shadow: 0 0 18px var(--neon-cyan-glow);
  transform: translateY(-1px);
}
.hud-btn-support:hover i, .btn-sawer-nav:hover i, .btn-support-nav:hover i {
  color: #07090e !important;
}

.btn-back-main, .btn-nav-back {
  height: 38px;
  width: 38px;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1.5px solid var(--neon-cyan);
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  transition: all 0.2s ease;
}
.btn-back-main:hover, .btn-nav-back:hover {
  background: var(--neon-cyan);
  color: #07090e;
  box-shadow: 0 0 18px var(--neon-cyan-glow);
  transform: translateY(-1px);
}

.btn-back-main:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-1px);
}

/* Main Container */
.main-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 30px 24px 40px 24px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero-section {
  margin-bottom: 24px;
}

.text-center {
  text-align: center;
}

.hero-title {
  font-family: var(--font-hud);
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffffff;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Dropzone Section */
.dropzone-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 30px auto;
}

.dropzone-card {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 50px 30px;
  text-align: center;
  border: 2px dashed rgba(0, 240, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(10, 15, 30, 0.7);
}

.dropzone-card:hover, .dropzone-card.dragover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.05);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.2);
  transform: translateY(-3px);
}

.file-input-hidden {
  display: none;
}

.dropzone-icon-wrap {
  margin-bottom: 18px;
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 12px var(--neon-cyan-glow));
}

.dropzone-title {
  font-family: var(--font-hud);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  margin-bottom: 8px;
}

.dropzone-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.btn-select-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 30px;
  background: linear-gradient(135deg, #00f0ff, #0088ff);
  color: #020617;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  transition: all 0.25s ease;
}

.btn-select-file:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.dropzone-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #cbd5e1;
}

.text-cyan { color: var(--neon-cyan) !important; }
.text-yellow { color: #f59e0b !important; }

.clipboard-hint {
  margin-top: 16px;
  font-size: 0.78rem;
  color: #64748b;
}

.clipboard-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: #e2e8f0;
}

/* Editor Workspace (Clean 2-Column Layout) */
.editor-workspace {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  margin-bottom: 40px;
  align-items: start;
}

@media (max-width: 1024px) {
  .editor-workspace {
    grid-template-columns: 1fr;
  }
}

/* Stage Panel (Left) */
.stage-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-card {
  position: relative;
  background: #090c16;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkerboard-pattern {
  background-color: #0f1322;
  background-image: 
    linear-gradient(45deg, #161c32 25%, transparent 25%), 
    linear-gradient(-45deg, #161c32 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #161c32 75%), 
    linear-gradient(-45deg, transparent 75%, #161c32 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.canvas-container {
  position: relative;
  width: 100%;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  user-select: none;
  overflow: hidden;
}

.canvas-container.can-pan {
  cursor: grab;
}

.canvas-container.is-panning {
  cursor: grabbing !important;
}

/* Split Comparison Slider */
.comparison-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 520px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  user-select: none;
  touch-action: none;
  --split-pos: 50%;
  transform-origin: center center;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.canvas-container.is-panning .comparison-wrapper {
  transition: none !important;
}

#resultCanvas {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
}

.comparison-before-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  clip-path: polygon(0 0, var(--split-pos, 50%) 0, var(--split-pos, 50%) 100%, 0 100%);
  z-index: 10;
}

#beforeCanvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.comparison-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split-pos, 50%);
  width: 3px;
  transform: translateX(-50%);
  background: var(--neon-cyan);
  cursor: ew-resize;
  z-index: 25;
  box-shadow: 0 0 14px var(--neon-cyan);
}

.divider-thumb, .comparison-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #020617;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.7);
  pointer-events: none;
}

/* Floating Badges (Sebelum & Sesudah) */
.split-label, .comp-badge {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-hud);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 30;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.split-label.label-before, .comp-badge-before {
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

.split-label.label-after, .comp-badge-after {
  right: 12px;
  background: rgba(8, 47, 73, 0.9);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

/* Floating Stage Controls (Zoom / Pan / Reset) */
.stage-toolbar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 15, 30, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px 8px;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.stage-tool-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.stage-tool-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.zoom-level-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--neon-cyan);
  padding: 0 6px;
  min-width: 44px;
  text-align: center;
}

/* Sidebar Panel (Right) */
.sidebar-panel {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.block-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-hud);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #f8fafc;
}

.block-sub-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 4px;
}

.tab-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Mode Switcher Tabs */
.mode-tabs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.mode-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #94a3b8;
  font-family: var(--font-hud);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.mode-tab-btn i {
  font-size: 0.85rem;
}

/* Tab Panels */
.tab-content-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.2s ease;
}

.tab-content-panel.active {
  display: flex;
}

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

/* Auto Preset Pills & Buttons */
.preset-pill-group,
.auto-presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.preset-pill-btn,
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: #cbd5e1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.preset-pill-btn:hover,
.preset-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.preset-pill-btn.active,
.preset-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(15, 23, 42, 0.9));
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

.preset-pill-btn .pill-title,
.preset-btn .preset-title {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
}

.preset-pill-btn.active .pill-title,
.preset-btn.active .preset-title {
  color: var(--neon-cyan);
}

.preset-pill-btn .pill-sub,
.preset-btn .preset-desc {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.35;
}

/* Target Input Row */
.target-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.target-input-wrap {
  flex: 1;
}

.target-number-field {
  width: 100%;
  padding: 10px 12px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s ease;
}

.target-number-field:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.target-unit-dropdown {
  padding: 10px 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.btn-apply-target {
  padding: 10px 14px;
  background: linear-gradient(135deg, #00f0ff, #0088ff);
  border: none;
  border-radius: 10px;
  color: #020617;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-apply-target:hover {
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}

/* Quick Presets Grid */
.quick-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.btn-quick-preset {
  padding: 7px 4px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quick-preset:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-quick-preset.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.target-status-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.7rem;
  color: #94a3b8;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.4;
  margin-top: 4px;
}

.target-status-note i {
  margin-top: 2px;
}

/* Cyber Range Slider */
.slider-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.val-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.cyber-range-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
}

.cyber-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cyber-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-scale-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #64748b;
  margin-top: -2px;
}

/* Format & Scale Chips Grids */
.format-chips-grid, .scale-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
  gap: 6px;
  width: 100%;
}

.format-chip-btn, .scale-chip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #cbd5e1;
  font-family: var(--font-hud);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
}

.format-chip-btn:hover, .scale-chip-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.format-chip-btn.active, .scale-chip-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Real-Time Stats Card */
.stats-card-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-header-title {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.savings-badge-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: #020617;
  background: linear-gradient(135deg, #00ff88, #00f0ff);
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.stats-table-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-divider-arrow {
  color: #64748b;
  font-size: 0.85rem;
}

.stat-label {
  font-size: 0.68rem;
  color: #94a3b8;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 800;
}

.stat-val-orig {
  color: #cbd5e1;
}

.stat-val-res {
  color: var(--neon-cyan);
}

.stat-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #64748b;
}

/* Export Actions */
.export-action-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-download-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #00f0ff, #0088ff);
  border: none;
  border-radius: 12px;
  color: #020617;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  transition: all 0.25s ease;
}

.btn-download-primary:hover {
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.7);
  transform: translateY(-2px);
}

.sub-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-sub-action {
  padding: 9px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #cbd5e1;
  font-family: var(--font-hud);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-sub-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Unified Bottom Bar */
.hud-bottom-bar {
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  width: 100%;
  border-radius: 20px 20px 0 0;
  border-bottom: none;
  border-left: none;
  border-right: none;
  margin-top: auto;
}

.bottom-bar-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.bottom-bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.brand-name {
  color: #cbd5e1;
}

.brand-divider {
  color: #475569;
}

.brand-suite {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--neon-cyan);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-family: var(--font-hud);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 240, 255, 0.3);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* =========================================================
   RESPONSIVE DESIGN SYSTEM (MOBILE, TABLET, DESKTOP)
   ========================================================= */

@media (max-width: 1024px) {
  .editor-workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .stage-card {
    min-height: 420px;
  }

  .canvas-container {
    min-height: 420px;
  }
}

@media (max-width: 768px) {
  /* HUD Navigation */
  .nav-container {
    padding: 10px 14px;
    gap: 8px;
  }

  .brand-logo-img {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 0.88rem;
    letter-spacing: 0.5px;
  }

  .brand-sub {
    font-size: 0.58rem;
  }

  .tool-dropdown-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
    min-height: 34px;
  }

  .dropdown-btn-label {
    display: none;
  }

  .hud-btn-support {
    padding: 5px 10px;
    font-size: 0.7rem;
    min-height: 34px;
  }

  .support-label {
    display: none;
  }

  .btn-back-main {
    width: 34px;
    height: 34px;
  }

  /* Hero Section */
  .hero-section {
    padding: 20px 12px 14px;
  }

  .hero-title {
    font-size: 1.45rem;
    letter-spacing: 1px;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  /* Dropzone Section */
  .dropzone-card {
    padding: 28px 16px;
    border-radius: 16px;
  }

  .dropzone-icon-wrap {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
    margin-bottom: 14px;
  }

  .dropzone-title {
    font-size: 1.15rem;
  }

  .dropzone-desc {
    font-size: 0.78rem;
    margin-bottom: 18px;
  }

  .btn-select-file {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.85rem;
  }

  .dropzone-badges {
    gap: 6px;
  }

  .badge-item {
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  /* Stage & Split View */
  .stage-card {
    min-height: 300px;
    border-radius: 14px;
  }

  .canvas-container {
    min-height: 300px;
    padding: 10px;
  }

  .comparison-wrapper {
    max-height: 380px;
  }

  #resultCanvas, #beforeCanvas {
    max-height: 380px;
  }

  .divider-thumb, .comparison-handle {
    width: 32px;
    height: 32px;
    font-size: 0.72rem;
  }

  .split-label {
    font-size: 0.6rem;
    padding: 3px 7px;
    top: 8px;
  }

  .split-label.label-before { left: 8px; }
  .split-label.label-after { right: 8px; }

  /* Floating Zoom Toolbar */
  .stage-toolbar {
    bottom: 8px;
    padding: 3px 6px;
    gap: 4px;
  }

  .stage-tool-btn {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
  }

  .zoom-level-badge {
    font-size: 0.68rem;
    min-width: 36px;
    padding: 0 4px;
  }

  /* Sidebar Controls */
  .sidebar-panel {
    padding: 16px 12px;
    border-radius: 16px;
    gap: 14px;
  }

  .sidebar-tabs-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .sidebar-tab-btn {
    padding: 8px 4px;
    font-size: 0.7rem;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
  }

  .sidebar-tab-btn i {
    font-size: 0.85rem;
  }

  /* Quick presets grid */
  .quick-presets-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .btn-quick-preset {
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  /* Format chips & scale chips */
  .format-chips-grid, .scale-chips-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .format-chip-btn, .scale-chip-btn {
    padding: 8px 4px;
    font-size: 0.72rem;
  }

  /* Stats Card Table */
  .stats-table-grid {
    padding: 10px;
    gap: 8px;
  }

  .stat-val {
    font-size: 0.95rem;
  }

  .stat-meta {
    font-size: 0.68rem;
  }

  /* Action Buttons */
  .btn-download-primary {
    padding: 14px 18px;
    font-size: 0.82rem;
  }

  .btn-sub-action {
    padding: 10px;
    font-size: 0.75rem;
  }

  /* HUD Footer */
  .bottom-bar-container {
    padding: 12px 14px;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.25rem;
  }

  .stage-card {
    min-height: 260px;
  }

  .canvas-container {
    min-height: 260px;
  }

  .comparison-wrapper {
    max-height: 300px;
  }

  #resultCanvas, #beforeCanvas {
    max-height: 300px;
  }

  .format-chips-grid, .scale-chips-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-val {
    font-size: 0.85rem;
  }
}

