/* ==========================================================================
   CSS Box Shadow Generator — CodeYantra
   Design tokens + core styles
   ========================================================================== */

:root {
  /* Brand */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-glow: rgba(37, 99, 235, 0.18);

  /* Surface (light mode) */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  /* Radius */
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Shadows (chrome shadows, not the generated ones) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.05);

  /* Type */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-fast: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode overrides */
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-soft: #1a2436;
  --border: #24304a;
  --border-strong: #324159;

  --text-primary: #f1f5f9;
  --text-secondary: #b8c2d4;
  --text-muted: #6b7c98;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
  min-height: 100vh;
}

img,
svg {
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-mark {
  font-size: 20px;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.nav-link {
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: color 0.2s var(--ease-fast), background-color 0.2s var(--ease-fast);
}

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

.nav-link.is-active {
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: border-color 0.2s var(--ease-fast), color 0.2s var(--ease-fast), transform 0.2s var(--ease-fast);
  position: relative;
}

.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary-light);
}

.theme-toggle .icon {
  position: absolute;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease-fast);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.header-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: color 0.2s var(--ease-fast), background-color 0.2s var(--ease-fast);
}

.header-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

/* ==========================================================================
   Main / App shell
   ========================================================================== */

.app {
  padding: 56px 32px 100px;
}

.app-inner {
  max-width: 1280px;
  margin: 0 auto;
  animation: fadeInUp 0.6s var(--ease) both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.page-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 640px;
}

.page-subtitle {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.6;
}

.workspace {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

/* ==========================================================================
   Panel shell
   ========================================================================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  transition: box-shadow 0.35s var(--ease), background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease-fast);
}

.icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn svg {
  transition: transform 0.4s var(--ease);
}

.icon-btn:hover svg {
  transform: rotate(-15deg);
}

/* ==========================================================================
   Controls
   ========================================================================== */

.control-group {
  margin-bottom: 22px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.control-row label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.control-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  min-width: 48px;
  text-align: center;
}

[data-theme="dark"] .control-value {
  background: rgba(37, 99, 235, 0.18);
}

/* Custom slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, var(--border) 50%, var(--border) 100%);
  outline: none;
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease-fast);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s var(--ease-fast), box-shadow 0.15s var(--ease-fast);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px var(--primary-glow);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s var(--ease-fast), box-shadow 0.15s var(--ease-fast);
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px var(--primary-glow);
}

.slider::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: transparent;
}

.slider:active::-webkit-slider-thumb {
  transform: scale(1.05);
}

/* Color inputs */
.color-group {
  display: flex;
  gap: 16px;
}

.color-field {
  flex: 1;
}

.color-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  transition: border-color 0.2s var(--ease-fast);
}

.color-input-wrap:hover {
  border-color: var(--border-strong);
}

.color-input-wrap span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Toggle switch */
.toggle-group {
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding-top: 18px;
}

.toggle-label span:first-child {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background-color 0.25s var(--ease-fast);
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
  transition: transform 0.25s var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}

/* ==========================================================================
   Preview panel
   ========================================================================== */

.preview-panel {
  display: flex;
  flex-direction: column;
}

.preview-stage {
  border-radius: var(--radius-md);
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
  background-size: 20px 20px;
  background-color: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  min-height: 360px;
  border: 1px solid var(--border);
}

.preview-card {
  width: 220px;
  height: 220px;
  background: var(--bg, #ffffff);
  transition: box-shadow 0.15s var(--ease-fast), border-radius 0.15s var(--ease-fast), background-color 0.15s var(--ease-fast);
}

/* ==========================================================================
   Code block
   ========================================================================== */

.code-block {
  margin-top: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f172a;
}

.code-block-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #1a2436;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red {
  background: #f87171;
}
.dot-yellow {
  background: #fbbf24;
}
.dot-green {
  background: #34d399;
}

.code-filename {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  flex: 1;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  transition: all 0.2s var(--ease-fast);
}

.copy-btn:hover {
  background: var(--primary);
  color: #fff;
}

.copy-btn.copied {
  background: #10b981;
  color: #fff;
}

.code-pre {
  padding: 20px 16px 24px;
  overflow-x: auto;
}

.code-pre code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: #93c5fd;
  white-space: pre;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--text-primary);
  color: var(--surface);
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xl);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 200;
}

.toast svg {
  color: #34d399;
  flex-shrink: 0;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.heart {
  display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.2s var(--ease-fast);
}

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

.footer-dot {
  color: var(--text-muted);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.panel {
  animation: fadeInUp 0.6s var(--ease) both;
}

.controls-panel {
  animation-delay: 0.05s;
}

.preview-panel {
  animation-delay: 0.12s;
}
