/* ════════════════════════════════════
   ELMO HAIRSTYLER — Design System
   ════════════════════════════════════ */

:root {
  --navy:   #0D1B2A;
  --teal:   #12A89B;
  --gold:   #D4A843;
  --cream:  #F9F5EF;
  --white:  #FFFFFF;
  --grey1:  #F4F0EA;
  --grey2:  #E0D9CF;
  --grey3:  #9A9080;
  --grey4:  #6B6358;
  --dark:   #1C1410;
  --teal-d: #0D8A7F;
  --teal-l: #1FC5B6;
  --gold-d: #B8922E;
  --shadow: 0 4px 24px rgba(13,27,42,0.10);
  --shadow-lg: 0 8px 48px rgba(13,27,42,0.18);
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--navy);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ═══ BUTTONS ═══ */
.btn-primary {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.btn-primary:hover { background: var(--teal-d); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(18,168,155,0.35); }

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--grey2);
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

.btn-hero {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 16px 40px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.01em;
}
.btn-hero:hover { background: var(--gold-d); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(212,168,67,0.4); }

.btn-upload {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-upload:hover { background: var(--teal); }
.btn-upload.btn-camera { background: var(--teal); }
.btn-upload.btn-camera:hover { background: var(--teal-d); }

.btn-change-photo {
  background: none;
  border: none;
  color: var(--grey3);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--transition);
  display: block;
  margin: 8px auto 0;
}
.btn-change-photo:hover { color: var(--teal); }

/* ═══ HEADER ═══ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,27,42,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner {
  display: flex; align-items: center; gap: 32px;
  max-width: 1200px; margin: 0 auto;
  padding: 16px 24px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; margin-right: auto; }
.logo-icon { font-size: 22px; }
.logo-text { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.logo-text em { color: var(--gold); font-style: italic; }
.nav { display: flex; gap: 28px; }
.nav a { color: rgba(255,255,255,0.75); font-size: 14px; font-weight: 500; transition: color var(--transition); }
.nav a:hover { color: var(--gold); }

/* ═══ HERO ═══ */
.hero {
  background: var(--navy);
  padding: 80px 24px;
  overflow: hidden;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 60px;
}
.hero-text { flex: 1; color: #fff; }
.hero-tag {
  color: var(--teal);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 20px;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 24px;
}
.hero-text h1 em { color: var(--gold); font-style: italic; }
.hero-sub { color: rgba(255,255,255,0.65); font-size: 17px; max-width: 460px; margin-bottom: 36px; line-height: 1.7; }

.hero-preview { flex: 0 0 380px; }
.hero-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 24px;
  position: relative;
}
.hero-card-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: var(--navy);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 14px; border-radius: 20px; text-transform: uppercase;
}
.hero-card-imgs { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero-card-img {
  flex: 1; height: 180px; border-radius: 12px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 12px;
  font-size: 13px; font-weight: 600; color: #fff;
  letter-spacing: 0.05em;
}
.before-img {
  background: linear-gradient(160deg, #2d4a6e 0%, #1a2e45 100%);
  border: 2px solid rgba(255,255,255,0.1);
}
.after-img {
  background: linear-gradient(160deg, #0f6b62 0%, #0a4a43 100%);
  border: 2px solid rgba(18,168,155,0.4);
}
.hero-card-arrow { color: var(--gold); font-size: 24px; flex-shrink: 0; }
.hero-card-label { text-align: center; color: rgba(255,255,255,0.5); font-size: 12px; }

/* ═══ SECTIONS COMMON ═══ */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--navy);
}
.section-header p { color: var(--grey3); font-size: 16px; }

/* ═══ STYLER SECTION ═══ */
.styler-section { padding: 72px 0; background: var(--cream); }
.styler-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 32px;
  align-items: start;
}

/* LEFT PANEL */
.photo-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--grey2);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 480px;
}

/* Upload Zone */
.upload-zone {
  padding: 48px 32px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  min-height: 480px;
  justify-content: center;
  border: 3px dashed var(--grey2);
  margin: 16px;
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
  cursor: pointer;
}
.upload-zone.drag-over { border-color: var(--teal); background: rgba(18,168,155,0.03); }
.upload-zone h3 { font-family: var(--font-display); font-size: 22px; color: var(--navy); }
.upload-zone p { color: var(--grey3); font-size: 14px; max-width: 280px; }
.upload-icon { font-size: 48px; }
.upload-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.upload-hint { font-size: 12px; color: var(--grey3); }

/* Camera Zone */
.camera-zone { padding: 16px; text-align: center; }
.camera-zone video { width: 100%; border-radius: var(--radius-sm); max-height: 380px; object-fit: cover; }
.camera-controls { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }

/* Photo Loaded */
.photo-loaded { padding: 16px; }
.result-area {}

.result-tabs {
  display: flex; gap: 0;
  background: var(--grey1);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 12px;
}
.tab {
  flex: 1; padding: 8px; border: none;
  background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--grey3); border-radius: 6px;
  transition: var(--transition);
}
.tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.img-wrapper {
  width: 100%; aspect-ratio: 3/4;
  background: var(--grey1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.img-wrapper img { width: 100%; height: 100%; object-fit: cover; }

/* Processing Overlay */
.processing-overlay {
  position: absolute; inset: 0;
  background: rgba(13,27,42,0.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  color: #fff; z-index: 10;
}
.processing-overlay p { font-size: 15px; font-weight: 600; }
.processing-sub { font-size: 12px !important; font-weight: 400 !important; color: rgba(255,255,255,0.6) !important; }

.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-result {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 32px; text-align: center; color: var(--grey3); font-size: 14px; line-height: 1.6;
}

.result-actions { display: flex; gap: 12px; margin-top: 12px; justify-content: center; }

/* Before/After Slider */
.slider-container { }
.slider-wrapper {
  position: relative; width: 100%;
  aspect-ratio: 3/4; overflow: hidden;
  border-radius: var(--radius-sm);
  user-select: none;
}
.slider-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slider-after-wrap {
  position: absolute; inset: 0;
  overflow: hidden;
  width: 50%;
}
.slider-divider {
  position: absolute; top: 0; bottom: 0;
  width: 3px; background: #fff;
  left: 50%; transform: translateX(-50%);
  cursor: ew-resize;
  display: flex; align-items: center; justify-content: center;
}
.slider-handle {
  width: 36px; height: 36px;
  background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--navy); font-weight: 700;
  box-shadow: var(--shadow);
  cursor: ew-resize;
}
.slider-range {
  width: 100%; margin-top: 12px;
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--grey2); outline: none; cursor: pointer;
}
.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal); cursor: pointer;
  box-shadow: 0 2px 8px rgba(18,168,155,0.4);
}
.slider-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--grey3); font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-top: 4px;
}

/* Status Bar */
.status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: #fff; border: 1px solid var(--grey2);
  border-radius: var(--radius-sm);
  margin-top: 12px; font-size: 13px; font-weight: 500;
}
.status-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grey2);
  flex-shrink: 0;
}
.status-indicator.ok { background: #22c55e; }
.status-indicator.error { background: #ef4444; }
.status-indicator.processing { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* RIGHT PANEL */
.styler-right { }

.filters { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 16px; border-radius: 50px;
  border: 2px solid var(--grey2);
  background: #fff; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--grey4);
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--teal); color: var(--teal); }
.filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Styles Grid */
.styles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 28px;
}
.styles-grid::-webkit-scrollbar { width: 4px; }
.styles-grid::-webkit-scrollbar-track { background: transparent; }
.styles-grid::-webkit-scrollbar-thumb { background: var(--grey2); border-radius: 2px; }

.style-card {
  background: #fff;
  border: 2px solid var(--grey2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.style-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.style-card.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(18,168,155,0.3); }
.style-card.selected .style-card-check { display: flex; }
.style-card.hidden { display: none; }

.style-card-thumb {
  height: 120px;
  position: relative; overflow: hidden;
}
.style-thumb-canvas {
  width: 100%; height: 100%;
}
.style-card-check {
  display: none;
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal); color: #fff;
  font-size: 12px; align-items: center; justify-content: center;
  font-weight: 700;
}
.style-card-info { padding: 8px; }
.style-card-name { font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.style-card-cat { font-size: 10px; color: var(--grey3); text-transform: uppercase; letter-spacing: 0.06em; }
.style-card-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--navy); color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
}

/* Color Section */
.color-section { background: #fff; border: 1px solid var(--grey2); border-radius: var(--radius); padding: 20px; }
.color-section h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 14px; }
.colors-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer;
}
.color-swatch-circle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid transparent;
  transition: var(--transition);
  position: relative;
}
.color-swatch:hover .color-swatch-circle { border-color: var(--teal); transform: scale(1.1); }
.color-swatch.selected .color-swatch-circle { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(18,168,155,0.3); }
.color-swatch-name { font-size: 9px; color: var(--grey3); font-weight: 500; text-align: center; max-width: 44px; line-height: 1.2; }

/* ═══ HOW IT WORKS ═══ */
.how-section { padding: 80px 0; background: var(--navy); }
.how-section .section-header h2 { color: #fff; }
.how-section .section-header p { color: rgba(255,255,255,0.55); }
.steps { display: flex; align-items: center; gap: 24px; justify-content: center; flex-wrap: wrap; }
.step {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 36px 28px; text-align: center;
  flex: 1; min-width: 200px; max-width: 280px;
  color: #fff;
}
.step-num { font-family: var(--font-display); font-size: 48px; color: rgba(212,168,67,0.3); font-weight: 700; line-height: 1; margin-bottom: 8px; }
.step-icon { font-size: 32px; margin-bottom: 12px; }
.step h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 10px; }
.step p { color: rgba(255,255,255,0.6); font-size: 14px; line-height: 1.7; }
.step-arrow { font-size: 32px; color: var(--gold); opacity: 0.5; }

/* ═══ BROWSE SECTION ═══ */
.browse-section { padding: 80px 0; background: var(--grey1); }
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.browse-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--grey2);
  transition: var(--transition);
  cursor: pointer;
}
.browse-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--teal); }
.browse-card-thumb { height: 200px; }
.browse-card-thumb canvas { width: 100%; height: 100%; }
.browse-card-info { padding: 14px; }
.browse-card-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.browse-card-meta { font-size: 12px; color: var(--grey3); }
.browse-card-cta {
  margin-top: 10px; display: inline-block;
  color: var(--teal); font-size: 12px; font-weight: 600;
}

/* ═══ FOOTER ═══ */
.footer { background: var(--dark); padding: 36px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-logo { display: flex; align-items: center; gap: 8px; color: #fff; margin-right: auto; }
.footer-copy { color: rgba(255,255,255,0.4); font-size: 12px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: rgba(255,255,255,0.5); font-size: 13px; transition: color var(--transition); }
.footer-links a:hover { color: var(--gold); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .styler-layout { grid-template-columns: 1fr; }
  .hero-inner { flex-direction: column; }
  .hero-preview { width: 100%; }
  .nav { display: none; }
  .styles-grid { grid-template-columns: repeat(3, 1fr); max-height: 360px; }
}

@media (max-width: 600px) {
  .styles-grid { grid-template-columns: repeat(2, 1fr); }
  .browse-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
  .hero { padding: 48px 24px; }
}
