/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #0066FF;
  --orange:  #FF6600;
  --dark:    #0a0f1e;
  --card:    #111827;
  --border:  #1f2d45;
  --text:    #e2e8f0;
  --muted:   #94a3b8;
  --radius:  12px;
}

body {
  font-family: 'Ubuntu', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--border); }
.nav-active { color: var(--blue) !important; }

/* ── Ad slots ────────────────────────────────────────────────────────────── */
.ad-slot {
  padding: 12px 0;
  min-height: 60px;
  text-align: center;
}

/* ── Page content (about, privacy, blog articles) ────────────────────────── */
.page-content { padding: 32px 20px 60px; }

.prose h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.prose h3 { font-size: 1.05rem; font-weight: 700; color: var(--blue); margin: 20px 0 8px; }
.prose p  { color: var(--muted); line-height: 1.75; margin-bottom: 14px; font-size: 0.95rem; }
.prose ul, .prose ol { color: var(--muted); line-height: 1.75; margin: 0 0 14px 20px; font-size: 0.95rem; }
.prose li { margin-bottom: 6px; }
.prose a  { color: var(--blue); text-decoration: underline; }
.prose strong { color: var(--text); }

.blog-breadcrumb { font-size: 0.85rem; margin-bottom: 16px !important; }
.blog-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 24px !important; border-bottom: 1px solid var(--border); padding-bottom: 16px; }

.blog-cta {
  background: rgba(0,102,255,0.07);
  border: 1px solid rgba(0,102,255,0.25);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin: 32px 0;
}
.blog-cta h3 { color: var(--text); font-size: 1.1rem; margin-bottom: 16px; }

/* ── Blog grid ───────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 32px 20px 60px;
}
.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.blog-card-tag {
  display: inline-block;
  background: rgba(0,102,255,0.12);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}
.blog-card h2 { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.blog-card h2 a { color: var(--text); text-decoration: none; }
.blog-card h2 a:hover { color: var(--blue); }
.blog-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; flex: 1; }
.read-more { color: var(--blue); font-size: 0.85rem; font-weight: 500; text-decoration: none; }
.read-more:hover { text-decoration: underline; }

/* ── Footer links ────────────────────────────────────────────────────────── */
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.8rem; }
.footer-links a:hover { color: var(--blue); }

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: #080d1a;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-nova { color: var(--blue); }
.logo-tech { color: var(--text); }

.tagline {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0a0f1e 0%, #0d1929 100%);
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.usage-badge {
  display: inline-block;
  background: rgba(0, 102, 255, 0.12);
  border: 1px solid rgba(0, 102, 255, 0.3);
  color: var(--blue);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
}

.usage-badge.limit-reached {
  background: rgba(255, 102, 0, 0.12);
  border-color: rgba(255, 102, 0, 0.3);
  color: var(--orange);
}

/* ── Tool Wrapper ────────────────────────────────────────────────────────── */
.tool-wrapper {
  padding: 40px 20px;
  flex: 1;
}

/* ── Upload Zone ─────────────────────────────────────────────────────────── */
.upload-zone {
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover {
  border-color: var(--blue);
  background: rgba(0, 102, 255, 0.04);
}

.upload-zone.drag-over {
  border-color: var(--blue);
  background: rgba(0, 102, 255, 0.08);
  transform: scale(1.01);
}

.upload-zone.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.upload-icon {
  color: var(--blue);
  margin-bottom: 16px;
}

.upload-label {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 8px;
}

.upload-label .link {
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

.upload-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Progress ────────────────────────────────────────────────────────────── */
.progress-wrap {
  text-align: center;
  padding: 40px 0;
}

.progress-bar {
  background: var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #00c6ff);
  border-radius: 999px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-label {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Error ───────────────────────────────────────────────────────────────── */
.error-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-top: 16px;
  font-size: 0.92rem;
}

/* ── Result ──────────────────────────────────────────────────────────────── */
.result-wrap {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.result-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #0c1420;
}

.tab {
  flex: 1;
  padding: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Ubuntu', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: rgba(0, 102, 255, 0.05);
}

.result-view {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080d1a;
}

.tab-panel {
  width: 100%;
  text-align: center;
}

.tab-panel img {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ── Compare Slider ──────────────────────────────────────────────────────── */
.compare-panel {
  padding: 0;
}

.compare-container {
  position: relative;
  display: inline-block;
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
}

.compare-container img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
}

#imgCompareRight {
  position: absolute;
  top: 0; left: 0;
  clip-path: inset(0 0 0 50%);
}

.compare-divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: white;
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  cursor: ew-resize;
}

/* ── Result Actions ──────────────────────────────────────────────────────── */
.result-actions {
  display: flex;
  gap: 12px;
  padding: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--blue);
  color: white;
}

.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-secondary:hover { background: #2a3a54; }

.usage-info {
  padding: 0 20px 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Steps bar ───────────────────────────────────────────────────────────── */
.steps-bar {
  background: #0c1420;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.steps-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}

.step.active { color: var(--blue); }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  font-size: 0.75rem;
  font-weight: 700;
}

.step.active .step-num {
  background: var(--blue);
  color: white;
}

.step-arrow { color: var(--border); font-size: 1.1rem; }

/* ── Paint step ──────────────────────────────────────────────────────────── */
.paint-header {
  margin-bottom: 16px;
}

.paint-instructions {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.paint-instructions strong { color: var(--text); }

.brush-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
}

.brush-controls input[type=range] {
  accent-color: var(--blue);
  width: 120px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* ── Canvas wrap ─────────────────────────────────────────────────────────── */
.canvas-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  background: #080d1a;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: crosshair;
  touch-action: none;
}

#imageCanvas {
  display: block;
  width: 100%;
  height: auto;
}

#maskCanvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.paint-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ── Features ────────────────────────────────────────────────────────────── */
.features {
  background: #080d1a;
  border-top: 1px solid var(--border);
  padding: 60px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  text-align: center;
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: #080d1a;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}

.footer p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.footer a { color: var(--blue); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; text-align: center; }
  .hero { padding: 40px 0 30px; }
  .upload-zone { padding: 40px 20px; }
  .result-actions { flex-direction: column; }
  .btn { width: 100%; }
}
