/* ============================
   Le Legend'Hair — Simulateur
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
  --black: #0a0a0a;
  --dark: #1a1a1a;
  --darker: #111111;
  --gold: #c9a96e;
  --gold-light: #dfc698;
  --cream: #f5f0e8;
  --white: #fefefe;
  --gray: #888;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--black);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header */
.header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  background: linear-gradient(180deg, var(--darker) 0%, var(--black) 100%);
}

.logo {
  max-width: 280px;
  height: auto;
  margin-bottom: 0.5rem;
  filter: brightness(1.1);
}

.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.header .subtitle {
  font-size: 0.85rem;
  color: var(--gray);
  font-weight: 300;
}

/* Privacy banner */
.privacy-banner {
  background: var(--darker);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: var(--radius);
  padding: 0.7rem 1.2rem;
  margin: 0.8rem auto;
  max-width: 500px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.privacy-banner .icon {
  font-size: 1.1rem;
}

/* Steps container */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

/* Step sections */
.step {
  display: none;
  animation: fadeIn 0.4s ease;
}

.step.active {
  display: block;
}

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

/* Step header */
.step-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--cream);
}

/* Progress bar */
.progress-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dark);
  border: 1px solid var(--gold);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201, 169, 110, 0.4);
}

.progress-dot.done {
  background: var(--gold);
}

/* Gender select */
.gender-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gender-card {
  background: var(--dark);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gender-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.gender-card.selected {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.1);
}

.gender-card .emoji {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  display: block;
}

.gender-card .label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--cream);
}

/* Mode selection */
.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mode-card {
  background: var(--dark);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mode-card:hover {
  border-color: var(--gold);
  transform: translateX(4px);
}

.mode-card.selected {
  border-color: var(--gold);
  background: rgba(201, 169, 110, 0.1);
}

.mode-card .mode-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.mode-card .mode-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  color: var(--cream);
}

.mode-card .mode-info p {
  font-size: 0.8rem;
  color: var(--gray);
}

/* Options grid (haircuts / colors) */
.options-section {
  margin-bottom: 1.5rem;
}

.options-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  color: var(--gold-light);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

/* Option cards with photo thumbnails */
.option-card {
  background: var(--dark);
  border: 2px solid rgba(201, 169, 110, 0.15);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.3);
}

.option-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  background-size: cover;
  background-position: center top;
}

.option-label {
  padding: 0.5rem 0.3rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--cream);
  font-weight: 500;
}

.option-card.selected .option-label {
  color: var(--gold-light);
}

/* Color swatches */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.color-chip {
  background: var(--dark);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0.6rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-chip:hover {
  border-color: var(--gold);
}

.color-chip.selected {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.3);
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin: 0 auto 0.4rem;
  border: 2px solid rgba(255,255,255,0.1);
}

.color-chip .color-name {
  font-size: 0.7rem;
  color: var(--gray);
}

/* Camera section */
.camera-area {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 60vh;
  background: var(--darker);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 2px solid rgba(201, 169, 110, 0.2);
}

.camera-area video,
.camera-area canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65%;
  height: 55%;
  border: 2px dashed rgba(201, 169, 110, 0.4);
  border-radius: 50%;
  pointer-events: none;
}

.camera-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--gold);
  background: rgba(0,0,0,0.7);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* Upload alternative */
.upload-section {
  text-align: center;
  margin-top: 0.8rem;
}

.upload-section .divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.8rem 0;
  color: var(--gray);
  font-size: 0.8rem;
}

.upload-section .divider::before,
.upload-section .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.upload-btn:hover {
  background: rgba(201, 169, 110, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--black);
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.3);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
}

.btn-secondary:hover {
  background: rgba(201, 169, 110, 0.1);
}

.btn-capture {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid var(--cream);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.btn-capture:hover {
  transform: scale(1.05);
}

.btn-capture:active {
  transform: scale(0.95);
}

.btn-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.btn-row .btn {
  flex: 1;
}

/* Result page */
.result-container {
  text-align: center;
}

.result-images {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 55vh;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 2px solid rgba(201, 169, 110, 0.3);
  background: var(--darker);
}

.result-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slider comparison */
.comparison-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 55vh;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 2px solid rgba(201, 169, 110, 0.3);
  cursor: col-resize;
  user-select: none;
}

.comparison-slider .img-before,
.comparison-slider .img-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comparison-slider .img-before {
  clip-path: inset(0 50% 0 0);
}

.comparison-slider .slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--gold);
  transform: translateX(-50%);
  z-index: 2;
}

.comparison-slider .slider-handle::after {
  content: '⟨ ⟩';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--gold);
  color: var(--black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.comparison-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: -0.5rem;
  margin-bottom: 0.8rem;
  padding: 0 0.5rem;
}

.result-summary {
  background: var(--dark);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

.result-summary .tag {
  display: inline-block;
  background: rgba(201, 169, 110, 0.15);
  color: var(--gold-light);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--dark);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.8rem;
  color: var(--gray);
}

.loading-tips {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--gray);
  font-style: italic;
  max-width: 280px;
  text-align: center;
  line-height: 1.4;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.2);
}

/* Responsive */
@media (min-width: 768px) {
  .container {
    padding: 2rem;
  }
  
  .options-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .color-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 480px) {
  .options-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Animations */
.flash {
  animation: flash 0.3s ease;
}

@keyframes flash {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}
