/* ===== ROOT DESIGN SYSTEM ===== */
:root {
  --bg: #09090e;
  --surface: #12101b;
  --surface-2: #1c182d;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --accent: #ff0080; /* Pink Cyberpunk */
  --accent-2: #00f2fe; /* Cyan */
  --accent-3: #f59e0b;
  --danger: #ef4444;
  --text: #e8eaf6;
  --text-muted: #7b7fa3;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --transition: 0.2s ease;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background orbs */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: float 15s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--accent); top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 450px; height: 450px; background: var(--accent-2); bottom: -150px; right: -100px; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: #6028ff; top: 40%; left: 40%; animation-delay: -10s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.05); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ===== APP CONTAINER ===== */
.app-container {
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===== HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 15px rgba(255, 0, 128, 0.5));
}
.header-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-logo p { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }

/* ===== TABS ===== */
.main-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 1.5rem;
  max-width: 600px;
}
.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); background: var(--glass); }
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 0, 128, 0.4);
}
.tab-icon { font-size: 1.1rem; }

/* ===== PANELS & GRID ===== */
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.panel-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .panel-grid { grid-template-columns: 1fr; } }
.steg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) { .steg-grid { grid-template-columns: 1fr; } }

.settings-col { display: flex; flex-direction: column; gap: 1.5rem; }
.output-col { display: flex; flex-direction: column; gap: 1.5rem; height: 100%;}

/* ===== GLASS PANEL ===== */
.glass-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}

/* ===== FORM FIELDS ===== */
.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}
.field-textarea, .field-input {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  transition: all var(--transition);
  resize: vertical;
}
.field-textarea:focus, .field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 0, 128, 0.15);
}
.select-input { font-family: 'Inter', sans-serif; cursor: pointer; }
.field-meta {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem;
}

.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap .field-input { padding-right: 3rem; }
.toggle-pw-btn {
  position: absolute; right: 10px; background: none; border: none; cursor: pointer;
  font-size: 1.1rem; opacity: 0.5; transition: opacity var(--transition);
}
.toggle-pw-btn:hover { opacity: 1; }

/* Custom slider */
.custom-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  outline: none;
  margin-top: 0.5rem;
}
.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent);
}

.setting-row { display: flex; justify-content: space-between; align-items: center; }
.setting-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.val-badge {
  background: rgba(255, 0, 128, 0.15);
  color: var(--accent);
  padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}

/* Capacity bar */
.capacity-bar-wrap { height: 4px; background: rgba(255,255,255,0.06); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.capacity-bar-fill { height: 100%; width: 0%; background: var(--accent-2); transition: width 0.3s ease, background 0.3s ease; }
.capacity-over { background: var(--danger) !important; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border: none; border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e11d48); color: #fff;
  box-shadow: 0 4px 15px rgba(255,0,128,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(255,0,128,0.5); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent-2), #0284c7); color: #fff;
  box-shadow: 0 4px 15px rgba(0,242,254,0.3);
}
.btn-accent:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,242,254,0.5); }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-outline {
  background: transparent; border: 1px solid var(--glass-border); color: var(--text);
}
.btn-outline:hover { background: var(--glass); border-color: rgba(255,255,255,0.2); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }
.btn-full { width: 100%; }

/* ===== DROPZONE & IMAGE ===== */
.dropzone {
  border: 2px dashed var(--glass-border); border-radius: var(--radius-sm);
  padding: 2rem 1.5rem; text-align: center; cursor: pointer;
  transition: all var(--transition); background: rgba(0,0,0,0.2);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent); background: rgba(255,0,128,0.05); transform: scale(1.02);
}
.drop-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.dropzone p { color: var(--text-muted); font-size: 0.85rem; }

.image-preview-wrap {
  margin-top: 1rem; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--glass-border);
}
.image-preview-wrap img { width: 100%; max-height: 250px; object-fit: contain; background: #000; display: block; }
.image-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 1rem; background: rgba(0,0,0,0.5); font-size: 0.75rem; color: var(--text-muted);
}
.file-name-display {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1rem; padding: 0.75rem 1rem; background: rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--accent-2);
}

/* ===== CANVAS OUTPUT ===== */
.canvas-panel {
  display: flex; flex-direction: column; min-height: 500px;
}
.canvas-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--glass-border);
}
.canvas-container {
  flex: 1;
  background: #000; /* Dark background for SVG container */
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: auto;
  min-height: 400px;
}
.empty-state { text-align: center; color: var(--text-muted); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

/* In-canvas SVG */
#svg-output-wrap svg {
  display: block; margin: 0 auto; max-width: 100%; height: auto;
}

/* Info card */
.info-card {
  background: rgba(0, 242, 254, 0.05);
  border-left: 3px solid var(--accent-2);
  padding: 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.info-card h4 { color: var(--accent-2); font-size: 0.9rem; margin-bottom: 0.5rem; }
.info-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ===== UTILS ===== */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }

.output-box {
  background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
}
.output-text {
  font-family: 'JetBrains Mono', monospace; font-size: 0.88rem; line-height: 1.6;
  word-break: break-all; white-space: pre-wrap; color: #a5f3fc;
}
.error-box {
  margin-top: 1rem; padding: 1rem; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm); color: #fca5a5; font-size: 0.85rem;
}
.toast-inline {
  margin-top: 1rem; padding: 0.75rem 1rem; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius-sm); color: #a7f3d0; font-size: 0.85rem;
}

.app-footer { margin-top: 3rem; text-align: center; color: var(--text-muted); font-size: 0.78rem; border-top: 1px solid var(--glass-border); padding: 1.5rem; }

/* ===== MAGNIFIER LENS ===== */
#magnifier-glass {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  pointer-events: none;
  border: 2px solid var(--accent-2);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4), inset 0 0 20px rgba(0,0,0,0.6);
  background-color: var(--surface);
  overflow: hidden;
  z-index: 100;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
#magnifier-glass svg {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  transform: scale(var(--zoom, 4)); /* dynamic via JS */
  transform-origin: center center; /* dynamic via JS */
  pointer-events: none;
}
