/* themes.css: Toy Box's own mapping of the character palette onto --ink / --cream / --candy-* (what claymorphism.css, site_toybox.css and the Toy Box pages read)
   and the .theme-picker component. The palette itself is character_palette.css. */
/* ========================================
   APPLY THEME VARIABLES
   Map theme variables to component properties
   ======================================== */

/* Update candy color references to use theme variables */
:root, [data-theme] {
  --candy-blue: var(--theme-primary);
  --candy-blue-dark: var(--theme-primary-dark);
  --candy-green: var(--theme-secondary);
  --candy-green-dark: var(--theme-secondary-dark);
  --candy-pink: var(--theme-accent);
  --candy-pink-dark: var(--theme-accent-dark);
  --candy-yellow: var(--theme-highlight);
  --candy-yellow-dark: var(--theme-highlight-dark);
  --candy-orange: var(--theme-extra-1);
  --candy-purple: var(--theme-extra-2);
  
  --cream: var(--theme-bg);
  --cream-warm: var(--theme-bg-warm);
  
  --ink: var(--theme-text);
  --ink-light: var(--theme-text-light);
  --ink-muted: var(--theme-text-muted);
}

/* ========================================
   THEME PICKER COMPONENT STYLES
   ======================================== */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.theme-option {
  position: relative;
  padding: 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 4px solid transparent;
  background: var(--cream);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.9),
    inset -1px -1px 2px rgba(0, 0, 0, 0.03),
    0 4px 0 rgba(0, 0, 0, 0.06),
    0 6px 12px rgba(0, 0, 0, 0.08);
}

.theme-option:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.9),
    inset -1px -1px 2px rgba(0, 0, 0, 0.03),
    0 6px 0 rgba(0, 0, 0, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.12);
}

.theme-option.active {
  border-color: var(--theme-primary);
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.9),
    inset -1px -1px 2px rgba(0, 0, 0, 0.03),
    0 4px 0 var(--theme-primary-dark),
    0 6px 12px rgba(0, 0, 0, 0.08);
}

.theme-option.active::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--theme-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 0 var(--theme-primary-dark);
}

.theme-preview {
  display: flex;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.theme-preview-swatch {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.3),
    0 2px 0 rgba(0, 0, 0, 0.1);
}

.theme-name {
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  color: var(--theme-text);
}

/* Theme preview swatches for each theme */
.theme-option[data-preview="candy"] .theme-preview-swatch:nth-child(1) { background: #00C2FF; }
.theme-option[data-preview="candy"] .theme-preview-swatch:nth-child(2) { background: #7FFF00; }
.theme-option[data-preview="candy"] .theme-preview-swatch:nth-child(3) { background: #FF69B4; }
.theme-option[data-preview="candy"] .theme-preview-swatch:nth-child(4) { background: #FFE135; }

.theme-option[data-preview="ocean"] .theme-preview-swatch:nth-child(1) { background: #0EA5E9; }
.theme-option[data-preview="ocean"] .theme-preview-swatch:nth-child(2) { background: #14B8A6; }
.theme-option[data-preview="ocean"] .theme-preview-swatch:nth-child(3) { background: #6366F1; }
.theme-option[data-preview="ocean"] .theme-preview-swatch:nth-child(4) { background: #22D3EE; }

.theme-option[data-preview="forest"] .theme-preview-swatch:nth-child(1) { background: #22C55E; }
.theme-option[data-preview="forest"] .theme-preview-swatch:nth-child(2) { background: #84CC16; }
.theme-option[data-preview="forest"] .theme-preview-swatch:nth-child(3) { background: #F59E0B; }
.theme-option[data-preview="forest"] .theme-preview-swatch:nth-child(4) { background: #EAB308; }

.theme-option[data-preview="sunset"] .theme-preview-swatch:nth-child(1) { background: #F97316; }
.theme-option[data-preview="sunset"] .theme-preview-swatch:nth-child(2) { background: #EC4899; }
.theme-option[data-preview="sunset"] .theme-preview-swatch:nth-child(3) { background: #EF4444; }
.theme-option[data-preview="sunset"] .theme-preview-swatch:nth-child(4) { background: #FBBF24; }

.theme-option[data-preview="galaxy"] .theme-preview-swatch:nth-child(1) { background: #8B5CF6; }
.theme-option[data-preview="galaxy"] .theme-preview-swatch:nth-child(2) { background: #6366F1; }
.theme-option[data-preview="galaxy"] .theme-preview-swatch:nth-child(3) { background: #EC4899; }
.theme-option[data-preview="galaxy"] .theme-preview-swatch:nth-child(4) { background: #F0ABFC; }

.theme-option[data-preview="strawberry"] .theme-preview-swatch:nth-child(1) { background: #F43F5E; }
.theme-option[data-preview="strawberry"] .theme-preview-swatch:nth-child(2) { background: #EC4899; }
.theme-option[data-preview="strawberry"] .theme-preview-swatch:nth-child(3) { background: #F97316; }
.theme-option[data-preview="strawberry"] .theme-preview-swatch:nth-child(4) { background: #FCD34D; }

.theme-option[data-preview="mint"] .theme-preview-swatch:nth-child(1) { background: #2DD4BF; }
.theme-option[data-preview="mint"] .theme-preview-swatch:nth-child(2) { background: #34D399; }
.theme-option[data-preview="mint"] .theme-preview-swatch:nth-child(3) { background: #38BDF8; }
.theme-option[data-preview="mint"] .theme-preview-swatch:nth-child(4) { background: #A7F3D0; }

.theme-option[data-preview="lavender"] .theme-preview-swatch:nth-child(1) { background: #A78BFA; }
.theme-option[data-preview="lavender"] .theme-preview-swatch:nth-child(2) { background: #818CF8; }
.theme-option[data-preview="lavender"] .theme-preview-swatch:nth-child(3) { background: #F472B6; }
.theme-option[data-preview="lavender"] .theme-preview-swatch:nth-child(4) { background: #C4B5FD; }

.theme-option[data-preview="dark-midnight"] .theme-preview-swatch:nth-child(1) { background: #3B82F6; }
.theme-option[data-preview="dark-midnight"] .theme-preview-swatch:nth-child(2) { background: #8B5CF6; }
.theme-option[data-preview="dark-midnight"] .theme-preview-swatch:nth-child(3) { background: #EC4899; }
.theme-option[data-preview="dark-midnight"] .theme-preview-swatch:nth-child(4) { background: #06B6D4; }

.theme-option[data-preview="dark-charcoal"] .theme-preview-swatch:nth-child(1) { background: #64748B; }
.theme-option[data-preview="dark-charcoal"] .theme-preview-swatch:nth-child(2) { background: #10B981; }
.theme-option[data-preview="dark-charcoal"] .theme-preview-swatch:nth-child(3) { background: #F59E0B; }
.theme-option[data-preview="dark-charcoal"] .theme-preview-swatch:nth-child(4) { background: #6366F1; }

.theme-option[data-preview="dark-obsidian"] .theme-preview-swatch:nth-child(1) { background: #00F5FF; }
.theme-option[data-preview="dark-obsidian"] .theme-preview-swatch:nth-child(2) { background: #A78BFA; }
.theme-option[data-preview="dark-obsidian"] .theme-preview-swatch:nth-child(3) { background: #F472B6; }
.theme-option[data-preview="dark-obsidian"] .theme-preview-swatch:nth-child(4) { background: #FCD34D; }

.theme-option[data-preview="dark-emerald"] .theme-preview-swatch:nth-child(1) { background: #10B981; }
.theme-option[data-preview="dark-emerald"] .theme-preview-swatch:nth-child(2) { background: #22C55E; }
.theme-option[data-preview="dark-emerald"] .theme-preview-swatch:nth-child(3) { background: #84CC16; }
.theme-option[data-preview="dark-emerald"] .theme-preview-swatch:nth-child(4) { background: #14B8A6; }

.theme-option[data-preview="dark-amethyst"] .theme-preview-swatch:nth-child(1) { background: #A855F7; }
.theme-option[data-preview="dark-amethyst"] .theme-preview-swatch:nth-child(2) { background: #EC4899; }
.theme-option[data-preview="dark-amethyst"] .theme-preview-swatch:nth-child(3) { background: #8B5CF6; }
.theme-option[data-preview="dark-amethyst"] .theme-preview-swatch:nth-child(4) { background: #F0ABFC; }

.theme-option[data-preview="citrus"] .theme-preview-swatch:nth-child(1) { background: #FFFF7C; }
.theme-option[data-preview="citrus"] .theme-preview-swatch:nth-child(2) { background: #E0F7A4; }
.theme-option[data-preview="citrus"] .theme-preview-swatch:nth-child(3) { background: #F7643F; }
.theme-option[data-preview="citrus"] .theme-preview-swatch:nth-child(4) { background: #48A9B8; }
