/* ============================================
   simplytoolz — Design System
   Modern dark theme with glassmorphism
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors */
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.1);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(139, 92, 246, 0.5);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-heading: #f8fafc;

  /* Accent gradient */
  --accent-1: #8b5cf6;
  --accent-2: #6366f1;
  --accent-3: #3b82f6;
  --gradient-primary: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  --gradient-subtle: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.15),
    rgba(59, 130, 246, 0.15)
  );

  /* Category colors */
  --cat-image: #f472b6;
  --cat-text: #34d399;
  --cat-dev: #60a5fa;
  --cat-gen: #fbbf24;
  --cat-conv: #a78bfa;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background animated gradient */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      ellipse at 20% 20%,
      rgba(139, 92, 246, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 80%,
      rgba(59, 130, 246, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(99, 102, 241, 0.04) 0%,
      transparent 70%
    );
  z-index: -1;
  pointer-events: none;
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-3);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: none;
  min-width: 140px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
}

.lang-dropdown.open {
  display: block;
}

.lang-option {
  display: block;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.lang-option:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.lang-option.active {
  color: var(--accent-1);
  background: rgba(139, 92, 246, 0.1);
}

/* ---------- Hero Section ---------- */
.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: var(--gradient-subtle);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-1);
  font-size: 0.8rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: 999px;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.hero h1 .gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Category Sections ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.category {
  margin-bottom: var(--space-3xl);
}

.category-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.category-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.category-icon.image {
  background: rgba(244, 114, 182, 0.15);
}

.category-icon.text {
  background: rgba(52, 211, 153, 0.15);
}

.category-icon.dev {
  background: rgba(96, 165, 250, 0.15);
}

.category-icon.gen {
  background: rgba(251, 191, 36, 0.15);
}

.category-icon.conv {
  background: rgba(167, 139, 250, 0.15);
}

.category-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* ---------- Tool Cards Grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.tool-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
}

.tool-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tool-card-arrow {
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: color var(--transition-fast);
}

.tool-card:hover .tool-card-arrow {
  color: var(--accent-1);
}

/* ---------- Tool Page Layout ---------- */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.tool-header {
  margin-bottom: var(--space-xl);
}

.tool-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.tool-breadcrumb a {
  color: var(--text-muted);
}

.tool-breadcrumb a:hover {
  color: var(--accent-1);
}

.tool-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.tool-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Tool workspace */
.tool-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-1);
  background: rgba(139, 92, 246, 0.05);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.dropzone-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Textarea / Input */
.input-group {
  margin-bottom: var(--space-md);
}

.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.input-field:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

textarea.input-field {
  resize: vertical;
  min-height: 150px;
  font-family: "Courier New", monospace;
  line-height: 1.5;
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.input-field option {
  background: #1e1e3a;
  color: #e2e8f0;
  padding: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(139, 92, 246, 0.3);
}

.btn-icon {
  padding: var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Output area */
.output-area {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  min-height: 100px;
  position: relative;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.output-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  padding: var(--space-md);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}

.stat-value.success {
  color: #34d399;
}

.stat-value.warning {
  color: #fbbf24;
}

/* Options row */
.options-row {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: var(--space-md);
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  min-width: 150px;
}

.option-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Range slider */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-1);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

/* Toggle buttons */
.toggle-group {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.toggle-btn {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-btn.active {
  background: var(--accent-1);
  color: white;
}

.toggle-btn:hover:not(.active) {
  background: var(--bg-card-hover);
}

/* Preview image */
.preview-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.preview-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.preview-box img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.preview-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Notification toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-left: 3px solid #34d399;
}

.toast.error {
  border-left: 3px solid #f87171;
}

/* ---------- Ad Containers ---------- */
.ad-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  margin: var(--space-lg) 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.ad-sidebar {
  min-height: 250px;
}

/* ---------- SEO Content Section ---------- */
.seo-content {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.seo-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
}

.seo-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: var(--space-lg) 0 var(--space-sm);
}

.seo-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.seo-content ul {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.seo-content li {
  margin-bottom: var(--space-xs);
  line-height: 1.6;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-2xl) var(--space-lg);
  margin-top: var(--space-3xl);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ---------- Color Picker Specific ---------- */
.color-display {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
  transition: background var(--transition-fast);
}

.color-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ---------- Password Strength ---------- */
.strength-meter {
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  margin-top: var(--space-sm);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition:
    width var(--transition-normal),
    background var(--transition-normal);
}

.strength-fill.weak {
  width: 25%;
  background: #f87171;
}

.strength-fill.fair {
  width: 50%;
  background: #fbbf24;
}

.strength-fill.good {
  width: 75%;
  background: #60a5fa;
}

.strength-fill.strong {
  width: 100%;
  background: #34d399;
}

/* ---------- Diff Highlights ---------- */
.diff-added {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.diff-removed {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  text-decoration: line-through;
}

.diff-line {
  padding: 2px 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

/* ---------- QR Code ---------- */
.qr-output {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
}

.qr-output canvas,
.qr-output img {
  border-radius: var(--radius-sm);
  background: white;
  padding: var(--space-md);
}

/* ---------- Unit Converter ---------- */
.converter-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) 0;
}

.swap-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.swap-btn:hover {
  background: var(--accent-1);
  color: white;
  transform: rotate(180deg);
}

/* ---------- Two Column Layout (tool + sidebar ad) ---------- */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.tool-main {
  min-width: 0;
}

.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: var(--space-md);
}

.tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius-sm) - 2px);
  transition: all var(--transition-fast);
  text-align: center;
}

.tab.active {
  background: var(--accent-1);
  color: white;
}

.tab:hover:not(.active) {
  color: var(--text-primary);
}

/* ---------- Checkbox / Switch ---------- */
.switch-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border-radius: 11px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  left: 2px;
  top: 2px;
  transition: all var(--transition-fast);
}

.switch input:checked + .switch-slider {
  background: var(--accent-1);
  border-color: var(--accent-1);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
  background: white;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    display: none;
  }

  .header-nav .nav-link {
    display: none;
  }

  .preview-container {
    grid-template-columns: 1fr;
  }

  .options-row {
    flex-direction: column;
  }

  .color-inputs-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .tool-workspace {
    padding: var(--space-md);
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

.tool-card:nth-child(1) {
  animation-delay: 0.05s;
}

.tool-card:nth-child(2) {
  animation-delay: 0.1s;
}

.tool-card:nth-child(3) {
  animation-delay: 0.15s;
}

.tool-card:nth-child(4) {
  animation-delay: 0.2s;
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Pulse animation for processing */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.processing {
  animation: pulse 1.5s ease infinite;
}

/* ---------- Legal Content Pages ---------- */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.legal-content {
  line-height: 1.8;
}

.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: var(--space-xl) 0 var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-color);
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
}

.legal-content ul {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

.legal-content li {
  margin-bottom: var(--space-xs);
}

.legal-content strong {
  color: var(--text-primary);
}

/* ---------- Palette Grid ---------- */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
}

.palette-swatch {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  transition: transform var(--transition-fast);
}

.palette-swatch:hover {
  transform: scale(1.05);
}

/* ---------- Drop Zone ---------- */
.drop-zone:hover {
  border-color: var(--accent-1) !important;
}

@media (max-width: 480px) {
  .palette-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Search ---------- */
.search-container {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 44px 14px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-normal);
}

.search-input:focus {
  border-color: var(--accent-1);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-hover);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-clear:hover {
  background: var(--accent-1);
  color: white;
}

.search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
  font-size: 1rem;
}

.search-no-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

/* ---------- 404 Error Page ---------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
}

.error-icon {
  margin-bottom: var(--space-lg);
}

.error-glitch {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 900;
  color: var(--text-heading);
  position: relative;
  display: inline-block;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%,
  90%,
  100% {
    text-shadow: none;
    transform: none;
  }
  92% {
    transform: translate(-2px, 2px);
  }
  94% {
    transform: translate(2px, -2px);
  }
  96% {
    transform: translate(-1px, -1px);
  }
  98% {
    transform: translate(1px, 1px);
  }
}

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.error-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 440px;
}

.error-actions {
  margin-bottom: var(--space-2xl);
}

.error-suggestions {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.error-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.error-links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.error-link {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.error-link:hover {
  border-color: var(--accent-1);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* ---------- Cookie Banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  backdrop-filter: blur(16px);
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.5;
}

.cookie-text a {
  color: var(--accent-1);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.cookie-btn {
  padding: var(--space-xs) var(--space-md) !important;
  font-size: 0.8rem !important;
}

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
    padding: var(--space-md);
  }

  .error-links {
    flex-direction: column;
  }
}
