/* ==========================================================================
   ImageStrix — All-in-One Client-Side & AI Image Suite
   Created by VA Developers (https://vadevelopers.in)
   Design System & Premium Aesthetics
   ========================================================================== */

:root {
  /* Color Tokens - Modern Electric Iris & Violet Creative Palette */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.28);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;

  /* Neutrals (Light Mode Default) */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.75);

  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #6366f1;

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

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.35);

  /* Transitions */
  --transition-fast: all 0.15s ease;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark Mode Tokens */
body.dark-mode {
  --bg-main: #080c14;
  --bg-card: #111827;
  --bg-card-hover: #172033;
  --bg-subtle: #1f293d;
  --bg-glass: rgba(17, 24, 39, 0.88);
  --bg-glass-card: rgba(17, 24, 39, 0.72);

  --border-light: #1f293d;
  --border-subtle: #162032;
  --border-focus: #818cf8;

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

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 30px -5px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 25px 50px -12px rgba(99, 102, 241, 0.4);
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.45);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* Ambient Glow Orbs */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

body.dark-mode .glow-orb {
  opacity: 0.32;
}

.glow-orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -120px;
  left: 10%;
}

.glow-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  top: 35%;
  right: -150px;
  animation-duration: 25s;
  animation-delay: -5s;
}

.glow-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: 5%;
  left: -100px;
  animation-duration: 30s;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

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

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.25;
  font-weight: 700;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.brand-badge {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-title .brand-ai-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #ffffff;
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
  padding: 0.5rem 0.25rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-pill, 9999px);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.5rem 1.15rem;
  font-size: 0.85rem;
}

.btn-md {
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-light);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-icon-toggle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

body.dark-mode .pill-badge {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.75rem;
}

.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-light);
}

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

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-media-wrapper {
  position: relative;
}

.hero-banner-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-banner-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 30px 60px rgba(99, 102, 241, 0.3);
}

.hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.hero-banner-overlay-badge {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #ffffff;
}

.overlay-badge-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.overlay-badge-text strong {
  display: block;
  font-size: 0.9rem;
}

.overlay-badge-text span {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ==========================================================================
   Tools Hub Section
   ========================================================================== */
.tools-section {
  padding: 5rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: 2.35rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Tools Toolbar: Search & Categories */
.tools-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}

.search-box-wrap {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.tools-search-input {
  width: 100%;
  padding: 0.95rem 1.2rem 0.95rem 3rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.tools-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-clear-btn {
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: none;
}

/* Category Filter Tabs */
.category-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-tab-btn {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.category-tab-btn:hover {
  color: var(--primary);
  border-color: var(--border-focus);
}

.category-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 20px var(--primary-glow);
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.tool-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  transition: var(--transition-fast);
}

body.dark-mode .tool-card-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.tool-card:hover .tool-card-icon {
  background: var(--primary-gradient);
  color: #ffffff;
  transform: scale(1.08);
}

/* Custom Tool Colors */
.tool-card[data-badge="AI"] .tool-card-icon {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  color: #a855f7;
}

.tool-card[data-badge="AI"]:hover .tool-card-icon {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
}

.tool-badge-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-ai {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #ffffff;
}

.badge-popular {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

body.dark-mode .badge-popular {
  color: #34d399;
}

.badge-utility {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.tool-card-title {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.tool-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.tool-card-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-footer span {
  transform: translateX(4px);
}

/* Empty search state */
.tools-empty-state {
  display: none;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

/* ==========================================================================
   AI Features Showcase Section
   ========================================================================== */
.ai-showcase-section {
  padding: 5rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.ai-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.ai-card {
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.ai-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.ai-icon-large {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.ai-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.65rem;
}

.ai-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.ai-card-btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ==========================================================================
   Security & FAQ Sections
   ========================================================================== */
.security-section, .steps-section, .faq-section {
  padding: 5rem 0;
}

.security-grid, .steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.security-card, .step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.security-card:hover, .step-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.sec-icon, .step-num {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.sec-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.step-num {
  background: var(--primary-gradient);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
}

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

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

.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-chevron {
  transition: transform 0.3s ease;
  color: var(--text-dim);
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
}

.faq-item.active .faq-answer {
  display: block;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

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

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 1.15rem;
  color: var(--text-main);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Interactive Tool Workspace Modal
   ========================================================================== */
.tool-workspace-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-main);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.tool-workspace-overlay.active {
  display: flex;
}

.workspace-header {
  height: 68px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.workspace-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.workspace-title-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.workspace-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.workspace-back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-card-hover);
}

.workspace-title-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.workspace-icon-mini {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.workspace-heading {
  font-size: 1.15rem;
  font-weight: 700;
}

.workspace-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Upload Dropzone */
.workspace-dropzone {
  width: 100%;
  max-width: 680px;
  margin: auto;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-xl);
  padding: 4rem 2rem;
  text-align: center;
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.workspace-dropzone:hover, .workspace-dropzone.drag-over {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  box-shadow: 0 0 30px var(--primary-glow);
  transform: scale(1.01);
}

.dropzone-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

body.dark-mode .dropzone-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.workspace-dropzone h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.workspace-dropzone p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Workspace Editor Split Layout (Canvas Preview + Controls) */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  width: 100%;
  max-width: 1380px;
  height: 100%;
  min-height: calc(100vh - 140px);
}

.editor-preview-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 480px;
}

.canvas-viewport {
  position: relative;
  max-width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  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;
}

body.dark-mode .canvas-viewport {
  background-image: 
    linear-gradient(45deg, #1f2937 25%, transparent 25%), 
    linear-gradient(-45deg, #1f2937 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #1f2937 75%), 
    linear-gradient(-45deg, transparent 75%, #1f2937 75%);
}

.canvas-viewport canvas, .canvas-viewport img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
}

/* Compare Split Slider (Before / After) */
.comparison-container {
  position: relative;
  max-width: 100%;
  max-height: 68vh;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  user-select: none;
}

.comparison-before, .comparison-after {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.comparison-overlay-wrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  border-right: 3px solid #ffffff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
}

.comparison-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #ffffff;
  cursor: ew-resize;
  z-index: 10;
}

.comparison-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.25rem;
}

/* Controls Panel */
.editor-controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  max-height: calc(100vh - 140px);
}

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

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

.control-input, .control-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition-fast);
}

.control-input:focus, .control-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.control-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Preset buttons grid */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 0.5rem;
}

.preset-chip {
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.preset-chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

body.dark-mode .preset-chip.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* Passport Sheet Preview */
.passport-sheet-preview {
  display: grid;
  gap: 8px;
  background: #ffffff;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

/* Crop Box Handles */
.crop-overlay-box {
  position: absolute;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: move;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: 2px;
}

.crop-handle.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-handle.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-handle.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-handle.br { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Processing Modal */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.processing-overlay.active {
  display: flex;
}

.processing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.25rem;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.spinner-ring {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.processing-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

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

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.4rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 500;
  animation: slideToast 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success .toast-icon { color: var(--accent-emerald); }
.toast-error .toast-icon { color: var(--accent-pink); }
.toast-info .toast-icon { color: var(--primary); }

@keyframes slideToast {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .hero-desc {
    margin: 0 auto 2rem;
  }

  .hero-cta-group, .hero-stats-row {
    justify-content: center;
  }

  .editor-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .ai-showcase-grid, .security-grid, .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .hero-title {
    font-size: 2.35rem;
  }

  .ai-showcase-grid, .security-grid, .steps-grid {
    grid-template-columns: 1fr;
  }

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

  .workspace-content {
    padding: 1rem;
  }
}
