/* ============================================
   NEUMORPHIC PORTFOLIO - GLOBAL STYLES
   ============================================ */

:root {
  --bg: #eff2f9;
  --surface: #f1f5f9;
  --muted: #b5bfc6;
  --text: #2b3440;
  --textSoft: #7e909e;

  --shadowLight: #fcfcfc;
  --shadowDark: rgba(22, 27, 29, 0.23);

  /* Pour le bottom-fade */
  --fade-color: 239, 242, 249;

  /* Pour le curseur */
  --cursor-dot: #6b7280;
  --cursor-ring: #9ca3af;
  --cursor-hover: #000000;

  /* Pour les icônes */
  --icon-color: #4b5563;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #1c1c1c;
  --surface: #191919;
  --muted: #757575;
  --text: #e5e7eb;
  --textSoft: #9ca3af;

  --shadowLight: rgba(55, 55, 55, 0.7);
  --shadowDark: rgba(0, 0, 0, 0.5);

  /* Pour le bottom-fade */
  --fade-color: 19, 19, 19;

  /* Pour le curseur */
  --cursor-dot: #9ca3af;
  --cursor-ring: #6b7280;
  --cursor-hover: #e5e7eb;

  /* Pour les icônes */
  --icon-color: #d1d5db;
}

html,
body {
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  position: relative;
}
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  filter: opacity(10);
  z-index: 1000;
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::after {
  filter: opacity(0.7);
  mix-blend-mode: screen;
}
.bg-neu {
  background: var(--bg);
}
.surface-neu {
  background: var(--surface);
}
.text-soft {
  color: var(--textSoft);
}
.text-strong {
  color: var(--text);
}
.icon-color {
  color: var(--icon-color);
}

/* Icon helper */
.lucide {
  width: 18px;
  height: 18px;
}

/* Bottom fade overlay: soft gradient + blur, with masked edge (no overflow-hidden needed) */
.bottom-fade {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5rem; /* default ~ h-14 */
  z-index: 50;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(
    to top,
    rgba(var(--fade-color), 0.92),
    rgba(var(--fade-color), 0.55) 40%,
    rgba(var(--fade-color), 0) 100%
  );
  /* Makes the top edge feathered (the fade is even smoother) */
  -webkit-mask-image: linear-gradient(
    to top,
    rgba(0, 0, 0, 1),
    rgba(0, 0, 0, 0)
  );
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}
@media (min-width: 768px) {
  .bottom-fade {
    height: 6rem;
  } /* md ~ h-24 */
}

/* Outer shadows (x/y -5/+5 blur 10 ; -10/+10 blur 20 ; -20/+20 blur 40) */
.neu-sm {
  background: var(--surface);
  border-radius: 1.25rem;
  box-shadow:
    -5px -5px 10px var(--shadowLight),
    5px 5px 10px var(--shadowDark);
}
.neu-md {
  background: var(--surface);
  border-radius: 1.25rem;
  box-shadow:
    -10px -10px 10px var(--shadowLight),
    10px 10px 10px var(--shadowDark);
}
.neu-lg {
  background: var(--surface);
  border-radius: 1.5rem;
  box-shadow:
    -10px -10px 15px var(--shadowLight),
    10px 10px 15px var(--shadowDark);
}

/* Embossed / raised big typography (like the Pinterest ref) */
.neu-emboss {
  /* darker than background so it's readable */
  color: var(--surface);
  text-shadow:
    -5px -5px 10px var(--shadowLight),
    5px 5px 10px var(--shadowDark);
}
.neu-emboss-soft {
  color: var(--surface);
  text-shadow:
    -8px -8px 16px var(--shadowLight),
    8px 8px 16px var(--shadowDark);
}

/* Minimal "browser bar" line (top pill + 3 dots) */
.neu-browser {
  background: var(--surface);
  border-radius: 9999px;
  box-shadow:
    -10px -10px 20px var(--shadowLight),
    10px 10px 20px var(--shadowDark);
}
.neu-dot {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: var(--surface);
  box-shadow:
    inset -5px -5px 10px var(--shadowLight),
    inset 5px 5px 10px var(--shadowDark);
}

/* Inner shadows (same values but inset) */
.neu-inset-sm {
  background: var(--surface);
  border-radius: 9999px;
  box-shadow:
    inset -5px -5px 10px var(--shadowLight),
    inset 5px 5px 10px var(--shadowDark);
}
.neu-inset-md {
  background: var(--surface);
  border-radius: 1rem;
  box-shadow:
    inset -2px -2px 5px var(--shadowLight),
    inset 2px 2px 5px var(--shadowDark);
}

/* Soft fade/reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease,
    filter 0.7s ease;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Optional: scroll snap for step feel */
.snap-y {
  scroll-snap-type: y mandatory;
}
.snap-start {
  scroll-snap-align: start;
}

/* Active nav link */
.nav-active {
  color: var(--text);
  font-weight: 700;
}

/* Effet scale sur les boutons/liens cliquables */
a:not(.no-hover):hover {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}
a:not(.no-hover):active {
  transform: scale(0.98);
}

/* Effet active neu-inset sur les boutons */
.neu-sm:active,
.neu-md:active,
.neu-lg:active {
  box-shadow:
    inset -8px -8px 16px var(--shadowLight),
    inset 8px 8px 16px var(--shadowDark) !important;
  transform: scale(0.98) !important;
  transition: all 0.1s ease;
}

button:active {
  transform: scale(0.98) !important;
}

/* Bouton dark mode toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.theme-toggle:hover {
  transform: scale(1.05);
}
.theme-toggle .lucide {
  width: 20px;
  height: 20px;
}

/* Curseur personnalisé - Desktop uniquement */
@media (pointer: fine) {
  * {
    cursor: none;
  }
}
.custom-cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cursor-dot);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s ease,
    height 0.3s ease,
    background 0.3s ease;
  display: none;
}
@media (pointer: fine) {
  .custom-cursor {
    display: block;
  }
}
.custom-cursor::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 1px solid var(--cursor-ring);
  border-radius: 50%;
  transition:
    width 0.3s ease,
    height 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
  animation: cursorPulse 2s ease-in-out infinite;
}
@keyframes cursorPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.7;
  }
}
.custom-cursor.hover {
  width: 16px;
  height: 16px;
  background: var(--cursor-hover);
}
.custom-cursor.active::before {
  width: 16px !important;
  height: 16px !important;
  border-color: var(--cursor-ring);
  border: 1px solid var(--cursor-ring);
}
.custom-cursor.hover::before {
  width: 28px;
  height: 28px;
  border-color: var(--cursor-hover);
  border: 2px solid var(--cursor-hover);
}

/* Tooltips neumorphiques */
.tooltip {
  position: relative;
}
.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 0.5rem;
  box-shadow:
    -5px -5px 10px var(--shadowLight),
    5px 5px 10px var(--shadowDark);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 100;
}
.tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}
/* Tooltip desktop (sidebar gauche) - à droite */
.tooltip-right::before {
  left: auto;
  right: auto;
  transform: translateX(0);
  left: calc(100% + 1rem);
  top: 50%;
  transform: translateY(-50%);
}
.tooltip-right::after {
  left: auto;
  right: auto;
  left: calc(100% + 0.5rem);
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 5px 5px 0;
  border-style: solid;
  border-color: transparent var(--surface) transparent transparent;
}
/* Tooltip mobile (bottom bar) - en haut */
.tooltip-top::before {
  bottom: calc(100% + 0.75rem);
  top: auto;
}
.tooltip-top::after {
  bottom: calc(100% + 0.25rem);
  top: auto;
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: var(--surface) transparent transparent transparent;
}
.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
}

/* Step indicator pour formulaire multi-étapes */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.3s ease;
}
.step-dot.active {
  width: 32px;
  background: var(--text);
  border-radius: 5px;
}

/* Animation pour transitions entre steps */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.slide-in-right {
  animation: slideInRight 0.4s ease-out;
}
.slide-in-left {
  animation: slideInLeft 0.4s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.show {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
  a:not(.no-hover):hover {
    transform: none;
  }
  .slide-in-right,
  .slide-in-left {
    animation: none;
  }
}
