:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary-color: #06b6d4;
  --accent-color: #10b981;
  --dark-heading: #0f172a;
  --dark-body: #334155;
  --dark-muted: #64748b;
  --light-bg: #f8fafc;
  --card-border: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--dark-body);
  background-color: #ffffff;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--dark-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--primary-color) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Hero Section */
.hero-section {
  background: radial-gradient(circle at 50% 20%, #eef2ff 0%, #ffffff 80%);
  padding: 60px 0 40px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #e0e7ff;
  color: #4338ca;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.75rem;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 18px;
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--dark-muted);
  max-width: 720px;
  margin: 0 auto 35px;
}

/* Upload Card / Dropzone */
.uploader-wrapper {
  max-width: 820px;
  margin: 0 auto;
}

.dropzone-box {
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 45px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--primary-color);
  background: #f8faff;
  transform: translateY(-2px);
}

.dropzone-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.btn-upload-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 14px 34px;
  font-size: 1.05rem;
  border-radius: 50px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.2s ease;
}

.btn-upload-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}

.sample-images {
  margin-top: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sample-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid #e2e8f0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.sample-thumb:hover {
  transform: scale(1.08);
  border-color: var(--primary-color);
}

/* Editor Workspace Container */
.editor-container {
  display: none;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--card-border);
  overflow: hidden;
  margin-top: 30px;
}

.canvas-viewport {
  position: relative;
  background-color: #f1f5f9;
  /* Checkerboard pattern for transparency */
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
}

.canvas-viewport canvas {
  max-width: 100%;
  max-height: 520px;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  /* Ensure canvas renders transparency cleanly with checkerboard showing through */
  background-image: linear-gradient(45deg, #cbd5e1 25%, transparent 25%),
                    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #cbd5e1 75%),
                    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* Background Replacement Options */
.bg-picker-bar {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-dot.active, .color-dot:hover {
  transform: scale(1.15);
  border-color: var(--primary-color);
}

.color-dot.transparent-dot {
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
                    linear-gradient(-45deg, #ccc 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #ccc 75%),
                    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 10px 10px;
}

/* Compare Slider (Before/After) */
.comparison-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  user-select: none;
}

/* Feature Cards & Badges */
.feature-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all 0.25s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 18px;
}

/* SEO Content Styles */
.seo-section {
  padding: 60px 0;
  background-color: #ffffff;
}

.seo-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 35px;
  background-color: #ffffff;
}

.prose p {
  color: #475569;
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.prose h3 {
  font-size: 1.5rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

/* FAQ Accordion */
.accordion-button:not(.collapsed) {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.accordion-button:focus {
  box-shadow: none;
  border-color: rgba(79, 70, 229, 0.2);
}

/* Ad slots styling */
.ad-container {
  margin: 30px auto;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.85rem;
  overflow: hidden;
}

/* Footer */
footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 55px 0 25px;
  border-top: 1px solid #1e293b;
}

footer a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s;
}

footer a:hover {
  color: #38bdf8;
}

/* Admin Dashboard Styles */
.admin-sidebar {
  background: #0f172a;
  min-height: 100vh;
  color: #e2e8f0;
}

.admin-sidebar a {
  color: #94a3b8;
  padding: 10px 16px;
  display: block;
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 4px;
}

.admin-sidebar a:hover, .admin-sidebar a.active {
  background-color: #1e293b;
  color: #ffffff;
}

.stat-card {
  border-radius: 12px;
  border: 1px solid var(--card-border);
  padding: 22px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════
   Editor Toolbar (new responsive 2-row design)
══════════════════════════════════════════════════════════ */
.editor-toolbar {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid var(--card-border);
}

/* Row 1 — background swatches */
.toolbar-bg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  flex-wrap: wrap;
}

.toolbar-section-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--dark-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  margin-right: 4px;
}

.swatch-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  background: var(--sw, #fff);
  padding: 0;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  flex-shrink: 0;
}
.swatch:hover,
.swatch.active {
  transform: scale(1.2);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79,70,229,.18);
}

/* Transparent checkerboard swatch */
.swatch--transparent {
  background-image:
    linear-gradient(45deg,#ccc 25%,transparent 25%),
    linear-gradient(-45deg,#ccc 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#ccc 75%),
    linear-gradient(-45deg,transparent 75%,#ccc 75%);
  background-size: 10px 10px;
  background-color: #fff;
}

/* Custom color picker swatch */
.swatch--picker {
  background: linear-gradient(135deg,#f59e0b,#ec4899,#3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .85rem;
  position: relative;
  overflow: hidden;
}
.swatch--picker input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
}

/* Row 2 — action buttons */
.toolbar-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--card-border);
}

/* Editor action buttons */
.editor-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 50px;
  font-weight: 600;
  font-size: .88rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.editor-btn--outline {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--dark-body);
}
.editor-btn--outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: #f5f3ff;
}
.editor-btn--danger {
  background: #fff;
  border-color: #fca5a5;
  color: #ef4444;
}
.editor-btn--danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}
.editor-btn--download {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}
.editor-btn--download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16,185,129,.4);
}

/* ═══════════════════════════════════════════════════════
   Editor Loader Overlay (class-based, no Bootstrap toggle)
══════════════════════════════════════════════════════════ */
.editor-loader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.editor-loader-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid #e2e8f0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: bgapp-spin .75s linear infinite;
  margin-bottom: 18px;
  flex-shrink: 0;
}
@keyframes bgapp-spin { to { transform: rotate(360deg); } }

.editor-loader-success {
  font-size: 3.5rem;
  color: #10b981;
  margin-bottom: 14px;
  animation: bgapp-popIn .3s cubic-bezier(.175,.885,.32,1.275);
  flex-shrink: 0;
}
@keyframes bgapp-popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.editor-loader-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-heading);
  text-align: center;
  padding: 0 24px;
  max-width: 360px;
}

/* ═══════════════════════════════════════════════════════
   Responsive tweaks
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .dropzone-box {
    padding: 30px 15px;
  }
}

@media (max-width: 575px) {
  .toolbar-bg-row   { padding: 10px 12px; gap: 8px; }
  .swatch           { width: 26px; height: 26px; }
  .toolbar-action-row { padding: 8px 12px; gap: 6px; }
  .editor-btn       { padding: 8px 13px; font-size: .82rem; }
  .editor-loader-text { font-size: .95rem; }
}

