/* ==========================================================================
   OptiPixel Studio - Modern Design System & Styles
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #070a12;
  --bg-secondary: #0e1424;
  --bg-tertiary: #162035;
  --bg-card: rgba(18, 26, 44, 0.7);
  --bg-card-hover: rgba(26, 38, 64, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  --border-active: #6366f1;

  --accent-cyan: #06b6d4;
  --accent-cyan-light: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --gradient-brand: linear-gradient(135deg, #06b6d4 0%, #6366f1 50%, #a855f7 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);

  /* Elevation & Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  /* Dimensions & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

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

/* Ambient Background Lights */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-blob {
  position: absolute;
  filter: blur(120px);
  border-radius: 50%;
  opacity: 0.25;
  animation: pulseBlob 12s ease-in-out infinite alternate;
}

.blob-1 {
  top: -10%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: var(--accent-indigo);
}

.blob-2 {
  top: 30%;
  right: -5%;
  width: 450px;
  height: 450px;
  background: var(--accent-cyan);
  animation-delay: -4s;
}

.blob-3 {
  bottom: -10%;
  left: 10%;
  width: 600px;
  height: 600px;
  background: var(--accent-purple);
  animation-delay: -8s;
}

@keyframes pulseBlob {
  0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
  50% { transform: scale(1.15) translate(30px, -20px); opacity: 0.32; }
  100% { transform: scale(0.9) translate(-20px, 30px); opacity: 0.18; }
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header & Navbar (Guaranteed Single-Line Fit) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 0;
  transition: all 0.3s ease;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap !important;
  gap: 0.75rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-logo img, .brand-logo svg {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.logo-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-cyan-light);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: nowrap !important;
  flex-shrink: 0;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  transition: color 0.2s;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 1024px) {
  .desktop-only-link {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 0.45rem 0;
  }
  .brand-logo span {
    font-size: 1rem !important;
  }
  .brand-logo img {
    width: 26px !important;
    height: 26px !important;
  }
  .logo-badge {
    display: none !important;
  }
  .coffee-text {
    display: none !important;
  }
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 3.5rem 0 2rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-cyan-light);
  margin-bottom: 1.25rem;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.hero-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 2rem;
}

/* Privacy & Feature Highlights */
.feature-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.badge-item svg {
  color: var(--accent-cyan);
}

/* Workspace Tabs Switcher */
.tab-nav-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

/* PDF Subtools Switcher */
.pdf-subtools-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.pdf-subtool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  background: rgba(14, 20, 36, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pdf-subtool-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.pdf-subtool-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-indigo);
  color: var(--accent-cyan-light);
}

/* PDF Page Grid & Items */
.pdf-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 20, 36, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.75rem;
}

.pdf-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pdf-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.pdf-page-card {
  background: rgba(14, 20, 36, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}

.pdf-page-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-md);
}

.page-num-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #fff;
  z-index: 5;
}

.pdf-page-thumb {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #1e293b;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Visual Annotation Toolbar & Canvas */
.annotation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 20, 36, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.annotation-tools-group {
  display: flex;
  gap: 0.4rem;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan-light);
}

.annotation-controls-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-picker-input {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

.annotation-page-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pdf-canvas-viewport {
  width: 100%;
  max-height: 650px;
  overflow: auto;
  background: #070a12;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.pdf-canvas-wrapper {
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  background: #ffffff;
  display: inline-block;
  line-height: 0;
}

#pdfBaseCanvas {
  display: block;
  max-width: 100%;
  height: auto;
}

#pdfAnnotationCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 2;
}

.pdf-text-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Detected Text Hover Box */
.pdf-detected-text-box {
  position: absolute;
  pointer-events: auto;
  border: 1.5px dashed var(--accent-indigo);
  background: rgba(99, 102, 241, 0.15);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
  z-index: 22;
}

.pdf-detected-text-box:hover {
  background: rgba(6, 182, 212, 0.35);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.7);
}

/* Pro Floating Interactive Text Widget */
.pdf-pro-text-widget {
  position: absolute;
  pointer-events: auto;
  z-index: 50;
  display: inline-flex;
  flex-direction: column;
  user-select: none;
}

.pdf-pro-text-widget.selected {
  outline: 2px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

/* Floating Mini Toolbar */
.text-mini-toolbar {
  display: none;
  align-items: center;
  gap: 0.35rem;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  white-space: nowrap;
  z-index: 100;
}

.pdf-pro-text-widget.selected .text-mini-toolbar {
  display: flex;
}

.mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  min-width: 24px;
  height: 26px;
}

.mini-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
}

.mini-btn.active {
  background: rgba(99, 102, 241, 0.4);
  border-color: var(--accent-indigo);
  color: var(--accent-cyan-light);
}

.mini-select {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}

.mini-color-input {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  background: none;
  padding: 0;
}

/* Widget Header & Drag Handle */
.widget-drag-handle {
  display: none;
  align-items: center;
  gap: 0.25rem;
  background: var(--accent-indigo);
  color: #fff;
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  cursor: grab;
  width: fit-content;
}

.pdf-pro-text-widget.selected .widget-drag-handle {
  display: flex;
}

.widget-drag-handle:active {
  cursor: grabbing;
}

/* Text Input Inside Pro Widget */
.pdf-pro-text-textarea {
  background: transparent;
  border: 1px dashed rgba(6, 182, 212, 0.5);
  padding: 4px 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: #000000;
  outline: none;
  resize: none;
  min-width: 140px;
  min-height: 32px;
  overflow: hidden;
  line-height: 1.25;
  border-radius: 3px;
}

.pdf-pro-text-widget.bg-white .pdf-pro-text-textarea {
  background: #ffffff;
}

.pdf-pro-text-widget.bg-yellow .pdf-pro-text-textarea {
  background: rgba(254, 240, 138, 0.9);
}

.pdf-pro-text-widget.bg-trans .pdf-pro-text-textarea {
  background: transparent;
}

.pdf-pro-text-textarea:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.95);
}

/* Transparency Checkerboard Pattern */
.checkerboard-bg {
  background-color: #1e293b;
  background-image: 
    linear-gradient(45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(-45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #0f172a 75%), 
    linear-gradient(-45deg, transparent 75%, #0f172a 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
}

/* Ad Banner Containers */
.ad-slot-horizontal {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 1.5rem auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.ad-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: absolute;
  top: 4px;
  right: 8px;
}

.ad-placeholder-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main Studio Layout */
.studio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  margin-bottom: 3rem;
  transition: border-color 0.3s;
}

.studio-card:focus-within {
  border-color: var(--border-glow);
}

/* Upload Dropzone */
.dropzone-container {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 3.5rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.03) 0%, rgba(6, 182, 212, 0.01) 100%);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dropzone-container:hover,
.dropzone-container.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.dropzone-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  transition: transform 0.3s ease;
}

.dropzone-container:hover .dropzone-icon {
  transform: scale(1.1);
  background: rgba(6, 182, 212, 0.2);
  color: #fff;
}

.dropzone-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dropzone-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.dropzone-formats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.format-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Global Controls Toolbar */
.toolbar-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 1.75rem;
  background: rgba(14, 20, 36, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.control-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan-light);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Custom Range Slider */
.range-slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #38bdf8;
}

/* Select & Radio Buttons */
.custom-select {
  width: 100%;
  background: #131b2e;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.custom-input {
  width: 100%;
  background: #131b2e;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
}

.custom-input:focus {
  border-color: var(--accent-indigo);
}

.options-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-indigo);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Floating Action & Stats Bar */
.stats-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  margin: 2rem 0 1.5rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.stats-info {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-metric {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.stat-number.saved {
  color: var(--accent-emerald);
}

.stats-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-main);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.5);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.825rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* File Grid / Cards */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.file-card {
  background: rgba(14, 20, 36, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  transition: all 0.25s ease;
}

.file-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.thumb-preview {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.card-details {
  flex-grow: 1;
  overflow: hidden;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.file-meta {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.2rem;
}

.card-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.size-pill {
  color: var(--text-muted);
}

.savings-pill {
  font-weight: 700;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.savings-pill.negative {
  color: var(--accent-amber);
}

.card-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.card-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.card-remove-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.15);
}

/* Before / After Comparison Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

/* Image Split Slider Comparison */
.comparison-container {
  position: relative;
  width: 100%;
  max-width: 750px;
  height: 420px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-color);
  user-select: none;
}

.comparison-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.comparison-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-right: 2px solid var(--accent-cyan);
}

.comparison-overlay img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.comparison-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background: var(--accent-cyan);
  color: #070a12;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.8);
  pointer-events: none;
  z-index: 10;
}

.comparison-label {
  position: absolute;
  bottom: 12px;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #fff;
  z-index: 5;
}

.comparison-label.orig {
  left: 12px;
}

.comparison-label.comp {
  right: 12px;
}

/* Informational & SEO Content Sections */
.info-section {
  padding: 4rem 0;
}

.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-number {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-cyan-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-mono);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.step-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* FAQ Accordion */
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.25rem 1.5rem;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-icon {
  transition: transform 0.3s ease;
  color: var(--accent-cyan);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-bottom: 1.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: rgba(7, 10, 18, 0.9);
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-cyan-light);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  animation: slideInToast 0.3s ease forwards;
}

.toast.success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.info {
  border-left: 4px solid var(--accent-cyan);
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0 1.25rem;
  }
  
  .navbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .studio-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .dropzone-container {
    padding: 2rem 1rem;
  }

  .toolbar-section {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
  }

  .stats-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1rem;
  }

  .stats-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stats-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .stats-actions .btn {
    width: 100%;
  }

  .comparison-container {
    height: 250px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.85rem;
  }

  .feature-badges {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .file-grid {
    grid-template-columns: 1fr;
  }
}

/* AI Background Remover Styles & Mobile Optimizations */
.checkerboard-bg {
  background-color: #0f1522;
  background-image: 
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

#bgCompareWrapper {
  touch-action: none;
  -webkit-touch-callout: none;
}

#bgCompareHandle {
  touch-action: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#bgCompareHandle:active, #bgCompareHandle:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 22px rgba(6, 182, 212, 1);
}

#bgBrushOverlayCanvas {
  touch-action: none;
}

.bg-brush-btn.active {
  background: var(--accent-cyan) !important;
  color: #000 !important;
  font-weight: 700 !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.bg-mode-btn {
  min-height: 38px;
  font-size: 0.88rem;
  padding: 0.45rem 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .bg-mode-btn {
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
    font-size: 0.82rem;
    padding: 0.5rem 0.6rem;
  }

  #bgCompareWrapper {
    max-width: 100% !important;
  }

  #bgCompareHandle {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.75rem !important;
  }

  .bg-brush-btn {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.8rem !important;
  }

  #bgBrushSizeSlider {
    width: 80px !important;
  }
}

/* Visual Background Swatches Strip */
.bg-swatches-strip {
  -ms-overflow-style: none;
}
.bg-swatches-strip::-webkit-scrollbar {
  display: none;
}

.bg-swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 8px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.bg-swatch-item:active {
  transform: scale(0.92);
}

.swatch-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.bg-swatch-item.active .swatch-circle {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.6);
  transform: scale(1.08);
}

.swatch-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.bg-swatch-item.active .swatch-label {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Mobile-First Tab Navigation Bar */
.tab-nav-container {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 0.5rem;
  overflow-x: auto !important;
  padding: 0.5rem 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  width: 100%;
}

.tab-nav-container::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover, .tab-btn:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.tab-btn:active {
  transform: scale(0.96);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25)) !important;
  color: var(--text-primary) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
  font-weight: 700;
}
