/* ============================================================
   VecDroid — PNG to Android VectorDrawable Converter
   style.css — Complete Design System
   ============================================================ */

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0f;
  --bg2:       #0f0f1a;
  --bg3:       #13131f;
  --surface:   #16162a;
  --surface2:  #1c1c30;
  --border:    rgba(99, 102, 241, 0.18);
  --border2:   rgba(255,255,255,0.07);

  --indigo:    #6366f1;
  --violet:    #8b5cf6;
  --purple:    #a78bfa;
  --emerald:   #10b981;
  --amber:     #f59e0b;
  --rose:      #f43f5e;
  --cyan:      #06b6d4;

  --text:      #e8e8f0;
  --text2:     #9898b8;
  --text3:     #5c5c7a;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow:    0 4px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 64px rgba(0,0,0,0.6);
  --glow:      0 0 40px rgba(99,102,241,0.25);

  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

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

/* ── Background Orbs ─────────────────────────────────────── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -200px; left: -200px;
  animation: float1 18s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: 40%; right: -150px;
  animation: float2 22s ease-in-out infinite;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: -100px; left: 30%;
  animation: float3 26s ease-in-out infinite;
}
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(60px,40px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-50px,60px)} }
@keyframes float3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,-50px)} }

/* ── Header ──────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border2);
  padding: 0 24px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 32px; height: 32px; flex-shrink: 0; }
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e8e8f0, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-nav { display: flex; gap: 8px; align-items: center; }
.badge {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a78bfa;
}
.badge-alt {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.3);
  color: #34d399;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: 72px 24px 48px;
  max-width: 780px;
  margin: 0 auto;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text2);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}
.hero-sub code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 1px 6px;
  border-radius: 4px;
  color: #a78bfa;
}

/* ── App Container ───────────────────────────────────────── */
.app-container {
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Controls Bar ────────────────────────────────────────── */
.controls-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.control-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.control-select {
  appearance: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 6px 28px 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239898b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.control-select:focus { border-color: var(--indigo); }
.control-range {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.control-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99,102,241,0.5);
  transition: transform 0.15s;
}
.control-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.control-value {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--purple);
  min-width: 18px;
  text-align: center;
}
.btn-reconvert {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 16px;
  border: 1px solid var(--indigo);
  border-radius: var(--radius-sm);
  background: rgba(99,102,241,0.12);
  color: var(--indigo);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-reconvert svg { width: 16px; height: 16px; }
.btn-reconvert:hover:not(:disabled) {
  background: rgba(99,102,241,0.25);
  box-shadow: 0 0 16px rgba(99,102,241,0.3);
}
.btn-reconvert:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-reconvert.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dropzone ────────────────────────────────────────────── */
.dropzone {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 3px;
  background: linear-gradient(135deg, rgba(99,102,241,0.4), rgba(139,92,246,0.4), rgba(6,182,212,0.2));
  transition: all 0.3s;
}
.dropzone.drag-over {
  background: linear-gradient(135deg, rgba(99,102,241,0.8), rgba(139,92,246,0.8), rgba(6,182,212,0.5));
  box-shadow: var(--glow);
  transform: scale(1.01);
}
.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 40px;
  border-radius: calc(var(--radius-xl) - 3px);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}
.dropzone-inner:hover { background: var(--surface2); }
.dropzone-icon {
  width: 72px; height: 72px;
  opacity: 0.8;
  animation: pulse-icon 3s ease-in-out infinite;
}
@keyframes pulse-icon {
  0%,100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
}
.dropzone-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.dropzone-sub { font-size: 0.9rem; color: var(--text2); }
.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  color: white;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.btn-upload:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99,102,241,0.55);
}
.dropzone-hint { font-size: 0.78rem; color: var(--text3); margin-top: 4px; }

/* ── Preview Area ────────────────────────────────────────── */
.preview-area { margin-top: 24px; }
.preview-area.hidden { display: none; }

/* ── File Info Bar ───────────────────────────────────────── */
.file-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.file-info-left { display: flex; align-items: center; gap: 12px; }
.file-thumb {
  width: 40px; height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface2);
  flex-shrink: 0;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-meta { display: flex; flex-direction: column; gap: 2px; }
.file-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.file-size { font-size: 0.78rem; color: var(--text2); }
.btn-clear {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-clear svg { width: 16px; height: 16px; }
.btn-clear:hover { background: rgba(244,63,94,0.15); border-color: var(--rose); color: var(--rose); }

/* ── Split Preview ───────────────────────────────────────── */
.split-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
  margin-bottom: 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border2);
  background: rgba(0,0,0,0.2);
}
.panel-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 100px;
}
.original-tag {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--amber);
}
.vector-tag {
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--purple);
}
.panel-dims { font-size: 0.75rem; font-family: var(--mono); color: var(--text3); }
.panel-canvas {
  flex: 1;
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  overflow: hidden;
}
.preview-img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}
.svg-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  padding: 16px;
}
.svg-preview-wrap svg {
  max-width: 100%;
  max-height: 320px;
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.4));
  transition: filter 0.2s;
}

/* Vector panel bg variants */
#panelVector .panel-canvas { background: #1a1a2e; }
#panelVector.bg-light .svg-preview-wrap svg,
#panelVector.bg-checker .svg-preview-wrap svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}
#panelVector.bg-checker .panel-canvas {
  background-color: #888;
  background-image:
    linear-gradient(45deg, #555 25%, transparent 25%),
    linear-gradient(-45deg, #555 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #555 75%),
    linear-gradient(-45deg, transparent 75%, #555 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
#panelVector.bg-light .panel-canvas { background: #f0f0f8; }

/* Background toggle */
.bg-toggle {
  display: flex;
  padding: 10px 12px;
  gap: 6px;
  border-top: 1px solid var(--border2);
  background: rgba(0,0,0,0.15);
}
.bg-btn {
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.bg-btn.active, .bg-btn:hover {
  background: rgba(99,102,241,0.2);
  border-color: var(--indigo);
  color: var(--purple);
}

/* Divider */
.split-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
}
.divider-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  box-shadow: 0 0 20px rgba(99,102,241,0.5);
  animation: pulse-arrow 2s ease-in-out infinite;
}
@keyframes pulse-arrow {
  0%,100% { box-shadow: 0 0 20px rgba(99,102,241,0.5); }
  50% { box-shadow: 0 0 30px rgba(139,92,246,0.7); }
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,15,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  font-size: 0.9rem;
  color: var(--text2);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.loading-overlay.active { opacity: 1; pointer-events: all; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── XML Section ─────────────────────────────────────────── */
.xml-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.xml-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border2);
  background: rgba(0,0,0,0.2);
  flex-wrap: wrap;
  gap: 10px;
}
.xml-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.xml-title svg { width: 18px; height: 18px; color: var(--indigo); }
.xml-actions { display: flex; gap: 8px; }
.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover {
  border-color: var(--indigo);
  color: var(--text);
  background: rgba(99,102,241,0.1);
}
.btn-download {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2));
  border-color: rgba(99,102,241,0.4);
  color: var(--purple);
}
.btn-download:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.35), rgba(139,92,246,0.35)) !important;
  box-shadow: 0 0 16px rgba(99,102,241,0.3);
}
.xml-body {
  max-height: 380px;
  overflow: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.xml-body::-webkit-scrollbar { width: 6px; }
.xml-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.xml-code {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre;
  overflow-x: auto;
}
.xml-stats {
  padding: 10px 20px;
  border-top: 1px solid var(--border2);
  font-size: 0.75rem;
  color: var(--text3);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.xml-stat { display: flex; gap: 6px; }
.xml-stat span:last-child { color: var(--purple); font-family: var(--mono); }

/* XML Syntax Highlight Colors */
.xml-tag    { color: #7dd3fc; }
.xml-attr   { color: #86efac; }
.xml-val    { color: #fca5a5; }
.xml-str    { color: #fde68a; }
.xml-cmt    { color: #6b7280; font-style: italic; }
.xml-ns     { color: #a78bfa; }

/* ── Usage Card ──────────────────────────────────────────── */
.usage-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.usage-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.usage-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.usage-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  transition: border-color 0.2s;
}
.usage-step:hover { border-color: rgba(99,102,241,0.3); }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(99,102,241,0.4);
}
.step-text {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
}
.step-text code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 1px 5px;
  border-radius: 4px;
  color: #a78bfa;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 100px;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s;
  opacity: 0;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { border-color: rgba(16,185,129,0.4); color: #34d399; }
.toast.error   { border-color: rgba(244,63,94,0.4);  color: #fb7185; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border2);
  font-size: 0.8rem;
  color: var(--text3);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .split-preview {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .split-divider {
    width: auto;
    height: 40px;
    transform: rotate(90deg);
  }
  .controls-bar {
    gap: 12px;
  }
  .btn-reconvert { margin-left: 0; width: 100%; justify-content: center; }
  .xml-header { flex-direction: column; align-items: flex-start; }
  .xml-actions { width: 100%; }
  .btn-icon { flex: 1; justify-content: center; }
}
