/* ════════════════════════════════════════════════════════════
   TechPackr · Vectorizer page
   Standalone. Procesa en cliente con VTracer WASM.
   ════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0d0f1a;
  --surface:   #11131f;
  --surface2:  #181a28;
  --surface3:  #1f2230;
  --border:    #2a2d3c;
  --text:      #e8e8ed;
  --text2:     #b4b6c4;
  --text3:     #7a7d8d;
  --accent:    #6c63ff;
  --accent2:   #00c49a;
  --danger:    #e63946;
}

* { box-sizing: border-box; }
/* hidden DEBE ganar contra reglas de display:flex/grid que vienen abajo.
   Sin !important, el loader y el SVG aparecían siempre porque las reglas
   .vc-loader { display:flex } y .vc-preview-svg { display:flex } sobreescribían
   el atributo hidden del HTML. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(ellipse at top, rgba(108,99,255,.10), transparent 60%) var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Topbar */
.vc-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.vc-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.vc-brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 800; font-size: 14px;
  border-radius: 8px;
}
.vc-brand-tag {
  font-size: 10px;
  background: var(--accent2);
  color: #04221c;
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 4px;
  font-weight: 800;
  letter-spacing: .04em;
}
.vc-back { font-size: 13px; color: var(--text2); }
.vc-back:hover { color: var(--text); }

/* Hero */
.vc-hero { text-align: center; padding: 48px 24px 24px; max-width: 700px; margin: 0 auto; }
.vc-h1 {
  font-size: clamp(28px, 4vw, 38px);
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #fff 30%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.vc-sub { color: var(--text2); font-size: 15px; margin: 0; }
.vc-hint {
  margin: 18px auto 0;
  max-width: 560px;
  background: rgba(108,99,255,.08);
  border: 1px solid rgba(108,99,255,.25);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text2);
  text-align: left;
  line-height: 1.6;
}
.vc-hint b { color: var(--text); font-weight: 700; }

/* Wrap */
.vc-wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Drop zone */
.vc-drop {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: var(--surface);
}
.vc-drop:hover, .vc-drop.is-drag, .vc-drop:focus {
  border-color: var(--accent);
  background: rgba(108,99,255,.06);
  outline: none;
}
.vc-drop-inner { pointer-events: none; }
.vc-drop-icon { font-size: 42px; margin-bottom: 14px; color: var(--accent2); }
.vc-drop-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.vc-drop-sub { color: var(--text3); font-size: 13px; }

/* Workspace */
.vc-workspace { display: grid; grid-template-columns: 260px 1fr; gap: 20px; margin-top: 8px; }
@media (max-width: 820px) { .vc-workspace { grid-template-columns: 1fr; } }

.vc-side { display: flex; flex-direction: column; gap: 16px; }
.vc-side-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.vc-side-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text3);
  font-weight: 700;
  margin-bottom: 12px;
}

.vc-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--text2); }
.vc-row span { font-weight: 600; color: var(--text2); }
.vc-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.vc-input:focus { border-color: var(--accent); }

.vc-btn {
  width: 100%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
  margin-bottom: 6px;
}
.vc-btn:hover { background: var(--surface3); }
.vc-btn:disabled { opacity: .55; cursor: wait; }
.vc-btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.vc-btn--primary:hover { opacity: .92; background: var(--accent); }
.vc-btn--ghost { background: transparent; }

.vc-meta { font-size: 12px; color: var(--text3); margin-bottom: 12px; line-height: 1.6; }
.vc-meta b { color: var(--text2); font-weight: 700; }

/* Preview */
.vc-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vc-preview-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.vc-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: .15s;
}
.vc-tab:hover { color: var(--text2); }
.vc-tab--active { color: var(--accent); border-bottom-color: var(--accent); }

.vc-preview-box {
  flex: 1;
  min-height: 420px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Checker background to ver transparencias */
  background-image:
    linear-gradient(45deg, var(--surface2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface2) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.vc-preview-img { max-width: 100%; max-height: 480px; object-fit: contain; }
.vc-preview-svg { max-width: 100%; max-height: 480px; display: flex; align-items: center; justify-content: center; }
.vc-preview-svg svg { max-width: 100%; max-height: 480px; height: auto; }

.vc-preview-split { position: relative; width: 100%; max-height: 480px; }
.vc-preview-split-half { width: 100%; }

/* Loader */
.vc-loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
  background: rgba(13, 15, 26, .85);
  backdrop-filter: blur(4px);
  z-index: 5;
}
.vc-loader-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vcSpin .8s linear infinite;
}
.vc-loader-text { color: var(--text2); font-size: 13px; font-weight: 600; }
@keyframes vcSpin { to { transform: rotate(360deg); } }

/* Toast */
.vc-toast {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 9999;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  max-width: 90vw;
}
.vc-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.vc-toast.is-err { background: var(--danger); }
