:root {
  --wf-bg: #0f0a12;
  --wf-surface: #1a1421;
  --wf-surface-2: #261e2f;
  --wf-accent: #ff4d9d;
  --wf-accent-glow: rgba(255, 77, 157, 0.4);
  --wf-text: #f0e6f5;
  --wf-text-muted: #a091af;
  --wf-border: #3d314a;
  
  --wf-space-xs: 8px;
  --wf-space-sm: 16px;
  --wf-space-md: 24px;
  --wf-space-lg: 32px;
  --wf-space-xl: 48px;
  --wf-space-2xl: 80px;

  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

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

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

.app-container {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Styling */
.sidebar {
  background-color: var(--wf-surface);
  border-right: 1px solid var(--wf-border);
  display: flex;
  flex-direction: column;
  padding: var(--wf-space-md);
  overflow-y: auto;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: var(--wf-space-sm);
  margin-bottom: var(--wf-space-xl);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--wf-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-text {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  background: linear-gradient(45deg, var(--wf-accent), #ff9eb5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-section {
  margin-bottom: var(--wf-space-xl);
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--wf-text-muted);
  margin-bottom: var(--wf-space-sm);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wf-space-xs);
}

.tool-btn {
  background: var(--wf-surface-2);
  border: 1px solid var(--wf-border);
  color: var(--wf-text);
  padding: var(--wf-space-sm);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wf-space-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 0.8rem;
}

.tool-btn:hover {
  border-color: var(--wf-accent);
  transform: translateY(-2px);
  background: var(--wf-border);
}

.tool-btn.active {
  background: var(--wf-accent);
  border-color: var(--wf-accent);
  color: white;
}

/* Canvas Area */
.canvas-area {
  background-color: #080509;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: var(--wf-space-xl);
}

.editor-workspace {
  position: relative;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
  max-height: 90vh;
}

.base-image {
  display: block;
  max-height: 80vh;
  border-radius: 4px;
}

/* Hair Extensions Overlays */
.hair-extension {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
  opacity: 0.9;
}

/* Right Panel: Settings */
.settings-panel {
  background-color: var(--wf-surface);
  border-left: 1px solid var(--wf-border);
  padding: var(--wf-space-md);
  overflow-y: auto;
}

.slider-group {
  margin-bottom: var(--wf-space-lg);
}

.label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--wf-space-xs);
}

.slider-label {
  font-size: 0.85rem;
  color: var(--wf-text);
}

.slider-val {
  font-size: 0.85rem;
  color: var(--wf-accent);
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--wf-accent);
  background: var(--wf-surface-2);
  height: 6px;
  border-radius: 3px;
  appearance: none;
}

.brush-preview {
  width: 100%;
  height: 60px;
  background: var(--wf-surface-2);
  border: 1px solid var(--wf-border);
  border-radius: 8px;
  margin-top: var(--wf-space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brush-dot {
  background: var(--wf-accent);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--wf-accent-glow);
}

/* Action Bar */
.action-bar {
  position: absolute;
  bottom: var(--wf-space-md);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 20, 33, 0.8);
  backdrop-filter: blur(12px);
  padding: var(--wf-space-sm) var(--wf-space-lg);
  border-radius: 100px;
  border: 1px solid var(--wf-border);
  display: flex;
  gap: var(--wf-space-md);
  align-items: center;
  z-index: 10;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--wf-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--wf-space-xs);
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 20px;
  transition: background 0.2s;
}

.action-btn:hover {
  background: var(--wf-surface-2);
}

.btn-primary {
  background: var(--wf-accent);
  color: white;
  font-weight: 600;
}

.btn-primary:hover {
  background: #ff66ac;
}

/* Cake Design Specific UI */
.hair-preset-card {
  background: var(--wf-surface-2);
  border: 1px solid var(--wf-border);
  border-radius: 12px;
  padding: var(--wf-space-sm);
  margin-bottom: var(--wf-space-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}

.hair-preset-card:hover {
  border-color: var(--wf-accent);
}

.hair-preset-thumb {
  height: 80px;
  background: #332a3d;
  border-radius: 8px;
  margin-bottom: var(--wf-space-xs);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG Overlays for "Continuity" */
.continuity-path {
  fill: none;
  stroke: #4d2e2e; /* Matching her hair color */
  stroke-width: 4;
  stroke-linecap: round;
  filter: blur(1px);
}

.continuity-glow {
  fill: none;
  stroke: var(--wf-accent);
  stroke-width: 1;
  opacity: 0.3;
}

@keyframes drawHair {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

.anim-hair {
  stroke-dasharray: 100;
  animation: drawHair 2s ease-out infinite;
}
