/* =============================================
   StegoVault — Advanced Steganography App
   Design: Cyberpunk-Terminal meets Clean Pro
   ============================================= */

:root {
  --bg:          #0b0e14;
  --bg-panel:    #111520;
  --bg-card:     #161c2a;
  --bg-input:    #0d1119;
  --border:      rgba(255,255,255,0.07);
  --border-glow: rgba(0,255,180,0.25);
  --accent:      #00ffb4;
  --accent2:     #0099ff;
  --accent3:     #ff4f8b;
  --text:        #e8eaf0;
  --text-dim:    #6b7599;
  --text-muted:  #3d445e;
  --success:     #00e676;
  --warning:     #ffab40;
  --error:       #ff5252;
  --font-mono:   'Space Mono', monospace;
  --font-body:   'DM Sans', sans-serif;
  --radius:      12px;
  --radius-sm:   6px;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px rgba(0,255,180,0.15);
  --transition:  0.22s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg:          #f0f2f8;
  --bg-panel:    #ffffff;
  --bg-card:     #f8f9fd;
  --bg-input:    #eef0f7;
  --border:      rgba(0,0,0,0.08);
  --border-glow: rgba(0,160,100,0.3);
  --accent:      #00a86b;
  --accent2:     #0066cc;
  --accent3:     #cc2255;
  --text:        #1a1d2e;
  --text-dim:    #5a6080;
  --text-muted:  #aab0c8;
  --shadow:      0 4px 24px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 16px rgba(0,168,107,0.12);
}

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

html { scroll-behavior: smooth; }

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

/* Noise overlay */
.noise-overlay {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; opacity: 0.4;
}

/* ── HEADER ── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  font-size: 22px; color: var(--accent);
  animation: spin-slow 12s linear infinite;
  display: inline-block;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.logo-text {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.header-controls { display: flex; align-items: center; gap: 12px; }
.btn-icon {
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

.version-tag {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 1px;
  color: var(--accent); background: rgba(0,255,180,0.08);
  border: 1px solid rgba(0,255,180,0.2);
  padding: 3px 8px; border-radius: 4px;
}

/* ── HERO ── */
.hero {
  position: relative;
  text-align: center;
  padding: 80px 24px 60px;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,255,180,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,180,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 100% at center, black 40%, transparent 100%);
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 20px;
}
.title-line { display: block; }
.title-line.accent {
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  text-shadow: 0 0 40px rgba(0,255,180,0.3);
}
[data-theme="light"] .title-line.accent {
  -webkit-text-stroke: 1px var(--accent);
  text-shadow: none;
}

.hero-sub {
  max-width: 520px; margin: 0 auto 28px;
  color: var(--text-dim); font-size: 15px; line-height: 1.7;
}

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.badge {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 10px; border-radius: 4px;
  text-transform: uppercase;
}

/* ── APP GRID ── */
.app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: 0 24px;
}
@media (max-width: 768px) {
  .app-grid { grid-template-columns: 1fr; }
}

/* ── PANELS ── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: background var(--transition);
}
.panel:hover { border-color: rgba(255,255,255,0.12); }

.panel-header {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 22px;
}
.panel-label {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--accent);
  letter-spacing: 2px; opacity: 0.7;
}
.panel-header h2 {
  font-size: 17px; font-weight: 600; letter-spacing: -0.3px;
}

/* ── DROP ZONE ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(0,255,180,0.04);
  box-shadow: var(--shadow-glow);
}
.drop-icon {
  font-size: 36px; color: var(--accent);
  display: block; margin-bottom: 14px;
  animation: pulse-hex 3s ease-in-out infinite;
}
@keyframes pulse-hex {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}
.drop-text { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.drop-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 18px; }

/* ── IMAGE PREVIEW ── */
.image-preview-wrap { margin-top: 0; }
.preview-tabs {
  display: flex; gap: 2px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 12px;
}
.tab {
  flex: 1; padding: 7px; border: none; border-radius: 5px;
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  background: none; color: var(--text-dim); cursor: pointer;
  transition: all var(--transition);
}
.tab.active {
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.canvas-container {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  max-height: 300px;
  display: flex; align-items: center; justify-content: center;
}
canvas {
  max-width: 100%; max-height: 300px;
  object-fit: contain; display: block;
}
canvas.hidden { display: none; }

.image-meta {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-dim);
  margin-top: 8px; letter-spacing: 0.3px;
}

.btn-ghost { background: none; border: none; color: var(--text-dim); cursor: pointer; font-family: var(--font-body); font-size: 12px; padding: 4px 8px; border-radius: 4px; transition: all var(--transition); }
.btn-ghost:hover { color: var(--error); }
.btn-sm { margin-top: 10px; }

/* ── CAPACITY BAR ── */
.capacity-bar-wrap { margin-top: 18px; }
.capacity-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-dim); margin-bottom: 6px;
  font-family: var(--font-mono);
}
.capacity-track {
  height: 4px; background: var(--bg-input);
  border-radius: 2px; overflow: hidden;
}
.capacity-fill {
  height: 100%; width: 0%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.5s ease, background 0.3s ease;
}
.capacity-fill.warn { background: linear-gradient(90deg, var(--warning), var(--error)); }

/* ── MODE SWITCH ── */
.mode-switch {
  display: flex; gap: 4px; margin-bottom: 28px;
  background: var(--bg-input); border-radius: var(--radius-sm);
  padding: 4px;
}
.mode-btn {
  flex: 1; padding: 10px;
  border: none; border-radius: 7px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  background: none; color: var(--text-dim); cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.mode-btn.active {
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.mode-icon { font-size: 16px; }

/* ── FORM FIELDS ── */
.form-section { animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.field-group { margin-bottom: 20px; }
.field-label {
  display: block; font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 8px;
}

.textarea-wrap { position: relative; }
textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body); font-size: 14px;
  resize: vertical; min-height: 110px;
  transition: border-color var(--transition);
  outline: none;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,255,180,0.08); }

.char-counter {
  position: absolute; bottom: 10px; right: 12px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
}

.input-wrap { position: relative; }
input[type="password"], input[type="text"] {
  width: 100%; padding: 11px 44px 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color var(--transition);
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,255,180,0.08); }

.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text-dim);
  transition: color var(--transition); padding: 0;
}
.eye-btn:hover { color: var(--accent); }

/* Strength bar */
.strength-bar-wrap {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
}
.strength-track {
  flex: 1; height: 3px;
  background: var(--bg-input); border-radius: 2px; overflow: hidden;
}
.strength-fill {
  height: 100%; width: 0%; border-radius: 2px;
  transition: width 0.4s ease, background 0.4s ease;
}
.strength-label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-dim); min-width: 50px; text-align: right;
}

/* Checkboxes */
.options-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
  user-select: none;
}
.checkbox-label input { display: none; }
.checkbox-box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px; display: grid; place-items: center;
  transition: all var(--transition); background: var(--bg-input);
}
.checkbox-label input:checked ~ .checkbox-box {
  background: var(--accent); border-color: var(--accent);
}
.checkbox-label input:checked ~ .checkbox-box::after {
  content: '✓'; font-size: 10px; color: #000; font-weight: 700;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 20px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  letter-spacing: 0.2px;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #000;
  box-shadow: 0 4px 16px rgba(0,255,180,0.25);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,255,180,0.35);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-outline {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text); font-size: 13px;
  padding: 8px 16px; width: auto;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-accent {
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px rgba(0,255,180,0.1);
}
.btn-accent:hover:not(:disabled) {
  background: rgba(0,255,180,0.08);
  box-shadow: 0 0 24px rgba(0,255,180,0.2);
  transform: translateY(-1px);
}

.btn-spinner {
  display: inline-block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESULT BOX ── */
.download-section { margin-top: 20px; }
.divider { height: 1px; background: var(--border); margin-bottom: 20px; }
.download-note {
  text-align: center; font-size: 11px; color: var(--text-muted);
  margin-top: 8px; font-family: var(--font-mono);
}

.result-box {
  margin-top: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px;
  animation: fade-in 0.3s ease;
}
.result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.result-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent);
  font-family: var(--font-mono);
}
.btn-ghost-sm {
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-size: 11px;
  padding: 3px 10px; border-radius: 4px;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.btn-ghost-sm:hover { border-color: var(--accent); color: var(--accent); }

.result-text {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text); word-break: break-all;
  white-space: pre-wrap; max-height: 160px; overflow-y: auto;
  line-height: 1.6;
}
.result-meta {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-muted); margin-top: 10px; line-height: 1.8;
}

/* ── TOAST ── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 999;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px; color: var(--text);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  max-width: 320px;
  animation: slide-in 0.3s ease;
}
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.fade-out { animation: slide-out 0.3s ease forwards; }
@keyframes slide-out {
  to { transform: translateX(110%); opacity: 0; }
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--accent2); }
.toast-icon { font-size: 16px; flex-shrink: 0; }

/* ── PROGRESS OVERLAY ── */
.progress-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.progress-modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px; text-align: center;
  min-width: 280px;
  box-shadow: var(--shadow);
}
.progress-icon {
  font-size: 40px; color: var(--accent);
  display: block; margin-bottom: 16px;
}
.progress-icon.spinning { animation: spin 1.2s linear infinite; }
.progress-label { font-size: 14px; color: var(--text-dim); margin-bottom: 20px; }
.progress-bar-wrap {
  height: 4px; background: var(--bg-input);
  border-radius: 2px; overflow: hidden; margin-bottom: 10px;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.1s linear;
}
.progress-pct {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
}

/* ── INFO SECTION ── */
.info-section {
  max-width: 1100px; margin: 0 auto 60px; padding: 0 24px;
}
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.info-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}
.info-card:hover {
  border-color: rgba(0,255,180,0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.info-icon { font-size: 28px; margin-bottom: 12px; display: block; }
.info-card h3 {
  font-size: 14px; font-weight: 700;
  margin-bottom: 8px; color: var(--text);
}
.info-card p { font-size: 12px; color: var(--text-dim); line-height: 1.7; }

/* ── FOOTER ── */
.footer {
  text-align: center; padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.footer strong { color: var(--accent); }

/* ── UTILITIES ── */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: rgba(0,255,180,0.2); color: var(--accent); }

/* ── MOBILE ── */
@media (max-width: 600px) {
  .header { padding: 14px 16px; }
  .hero { padding: 50px 16px 40px; }
  .hero-title { letter-spacing: -1px; }
  .app-grid { padding: 0 16px; }
  .panel { padding: 20px; }
  .info-section { padding: 0 16px; }
  .toast-container { left: 16px; right: 16px; }
  .toast { max-width: 100%; }
}