/* =========================================================
   STYLE.CSS - LABORATOIRE DU FREE-SURF
   Theme preserved, visuals refined (motion + depth)
   ========================================================= */

:root {
  --neon: #39ff14;
  --dark: #05080a;
  --vip: #ffd700;
  --admin: #ff0044;
  --revendeur: #00f2ff;
  --transition-fast: 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  background: var(--dark);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

.orbitron { font-family: "Orbitron", sans-serif; }
.neon-text { color: var(--neon); text-shadow: 0 0 15px var(--neon); }

.title-fx {
  animation: titleGlowPulse 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  transform-origin: left center;
}

.subtitle-fx {
  animation: subtitleBreath 2.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  transform-origin: left center;
}

@keyframes titleGlowPulse {
  0%,
  100% {
    transform: translateY(0);
    text-shadow: 0 0 0 rgba(57, 255, 20, 0);
  }

  50% {
    transform: translateY(-2px);
    text-shadow: 0 0 18px rgba(57, 255, 20, 0.3);
  }
}

@keyframes subtitleBreath {
  0%,
  100% {
    opacity: 0.84;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Letter-by-letter wave animation (opt-in via .letters-wave) */
.letters-wave .char-wave {
  display: inline-block;
  animation: letterWave 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
  animation-delay: var(--char-delay, 0ms);
  will-change: transform, text-shadow, opacity;
  backface-visibility: hidden;
}

@keyframes letterWave {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }

  25% {
    transform: translateY(-3px) rotate(-0.6deg);
    opacity: 0.98;
  }

  50% {
    transform: translateY(-5px) rotate(0.6deg);
    opacity: 1;
    text-shadow: 0 0 14px currentColor;
  }

  75% {
    transform: translateY(-2px) rotate(-0.3deg);
    opacity: 0.97;
  }
}

/* ===== BACKGROUND CYBER GRID ===== */
.cyber-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    linear-gradient(transparent 0%, rgba(57, 255, 20, 0.05) 2%, transparent 3%),
    linear-gradient(90deg, transparent 0%, rgba(57, 255, 20, 0.05) 2%, transparent 3%);
  background-size: 50px 50px;
  z-index: -2;
  transform: perspective(500px) rotateX(20deg) scale(1.5);
  animation: gridMove 10s linear infinite;
  pointer-events: none;
  will-change: background-position;
}
@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 50px; }
}

/* ===== SCANLINES ===== */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.2)
  );
  background-size: 100% 4px;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.3;
}

/* ===== BOOT OVERLAY ===== */
.boot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.boot-panel {
  width: min(820px, calc(100vw - 2rem));
  border: 2px solid rgba(57, 255, 20, 0.75);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.35), inset 0 0 18px rgba(57, 255, 20, 0.15);
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.9), rgba(0, 0, 0, 0.95));
}

.boot-title {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--neon);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.boot-log {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  height: 190px;
  overflow-y: auto;
  padding: 0.8rem;
  border: 1px solid rgba(57, 255, 20, 0.25);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.7);
}

.boot-log .ok { color: var(--neon); font-weight: bold; }
.boot-log .warn { color: #ffcc00; text-shadow: 0 0 10px rgba(255, 204, 0, 0.35); }

.boot-bar-wrap {
  margin-top: 1rem;
  border: 1px solid rgba(57, 255, 20, 0.35);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  height: 12px;
}

.boot-bar {
  height: 100%;
  width: 0%;
  background: var(--neon);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.75);
  transition: width 0.35s ease;
}

.boot-footer {
  color: rgba(57, 255, 20, 0.8);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* ===== LAB FRAME ===== */
.labo-frame {
  position: relative;
  overflow: hidden;
  padding: 2.6rem 3.4rem 1.6rem;
  border: 2px solid rgba(57, 255, 20, 0.8);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.9), rgba(0, 0, 0, 0.95));
  box-shadow: 0 0 40px rgba(57, 255, 20, 0.4), inset 0 0 25px rgba(57, 255, 20, 0.2);
  text-align: center;
  width: min(980px, calc(100vw - 2rem));
}

.labo-frame::before,
.labo-frame::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid var(--neon);
  pointer-events: none;
}
.labo-frame::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}
.labo-frame::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

.scan-line {
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--neon);
  box-shadow: 0 0 20px var(--neon);
  opacity: 0.25;
  animation: scan 4.5s linear infinite;
  pointer-events: none;
  z-index: 1;
  will-change: top;
}
@keyframes scan {
  0% { top: 100%; }
  100% { top: -4px; }
}

.labo-header {
  position: relative;
  z-index: 3;
  margin-bottom: 1.1rem;
  padding: 0.65rem 1.6rem;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid var(--neon);
  border-radius: 12px;
  font-family: "Orbitron", sans-serif;
  color: var(--neon);
  text-transform: uppercase;
  box-shadow: 0 0 25px rgba(57, 255, 20, 0.6);
}

.labo-header::after {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;
  background: radial-gradient(circle, rgba(57, 255, 20, 0.3) 0%, transparent 70%);
  filter: blur(15px);
  animation: haloPulse 4s ease-in-out infinite;
}

@keyframes haloPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.philippo-container {
  width: 165px;
  height: 165px;
  border: 4px solid var(--neon);
  box-shadow: 0 0 35px var(--neon);
  border-radius: 50%;
  overflow: hidden;
  background: #111;
  margin: 0 auto;
}

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

.typing {
  --typing-color: var(--neon);
  color: var(--typing-color);
  text-shadow: 0 0 15px var(--typing-color);
  border-right: 3px solid var(--typing-color);
  animation: blink 0.7s infinite;
}
@keyframes blink {
  50% { border-color: transparent; }
}

.glitch {
  position: relative;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark);
  opacity: 0.8;
  will-change: clip-path;
}
.glitch::before {
  left: 2px;
  text-shadow: -2px 0 #ff00c1;
  clip-path: inset(44% 0 61% 0);
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}
.glitch::after {
  left: -2px;
  text-shadow: -2px 0 #00fff9;
  clip-path: inset(50% 0 30% 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}
@keyframes glitch-anim-1 {
  0% { clip-path: inset(20% 0 80% 0); }
  100% { clip-path: inset(30% 0 20% 0); }
}
@keyframes glitch-anim-2 {
  0% { clip-path: inset(10% 0 60% 0); }
  100% { clip-path: inset(5% 0 80% 0); }
}

.labo-btn {
  margin-top: 1rem;
  padding: 1.1rem 3.6rem;
  border: 2px solid var(--neon);
  color: var(--neon);
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.labo-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--neon);
  z-index: -1;
  transition: left 0.3s ease;
}
.labo-btn:hover {
  color: #000;
  box-shadow: 0 0 40px var(--neon);
}
.labo-btn:hover::before { left: 0; }
.labo-btn:active { transform: scale(0.96); }

/* =========================================================
   DASHBOARD HUD + PANELS
   ========================================================= */

.dash-frame {
  position: relative;
  border: 2px solid rgba(57, 255, 20, 0.8);
  border-radius: 18px;
  background: rgba(10, 12, 14, 0.95);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  isolation: isolate;
}

.dash-frame::before,
.dash-frame::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
}

.dash-frame::before {
  background:
    radial-gradient(circle at 18% 20%, rgba(57, 255, 20, 0.16), transparent 45%),
    radial-gradient(circle at 78% 28%, rgba(0, 242, 255, 0.14), transparent 48%);
  animation: dashAuraFloat 12s ease-in-out infinite alternate;
}

.dash-frame::after {
  background: radial-gradient(circle at 50% 100%, rgba(57, 255, 20, 0.12), transparent 60%);
  animation: dashAuraPulse 3.8s ease-in-out infinite;
}

@keyframes dashAuraFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(1.2%, -1.4%, 0) scale(1.04); }
}

@keyframes dashAuraPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 30%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  animation: gridShift 18s linear infinite;
}

@keyframes gridShift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 42px 0, 0 42px; }
}

.dash-content {
  position: relative;
  z-index: 1;
}

.hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  border: 1px solid rgba(57, 255, 20, 0.34);
  border-radius: 999px;
  padding: 0.45rem 0.72rem;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(57, 255, 20, 0.9);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.18);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.85);
  animation: onlineBlink 1.8s ease-in-out infinite;
}

@keyframes onlineBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.panel-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(12, 12, 12, 0.96), rgba(22, 22, 22, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
  cursor: pointer;
}

.panel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 56%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}

.panel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.08), transparent 42%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.panel-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(57, 255, 20, 0.68);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38), 0 0 22px rgba(57, 255, 20, 0.2);
  filter: brightness(1.04);
}
.panel-card:hover::before { left: 155%; }
.panel-card:hover::after { opacity: 1; }

.panel-card:focus-visible {
  outline: none;
  border-color: rgba(57, 255, 20, 0.75);
  box-shadow: 0 0 0 2px rgba(57, 255, 20, 0.3), 0 0 24px rgba(57, 255, 20, 0.24);
}

.panel-card h3 {
  animation: titleGlowPulse 3.4s ease-in-out infinite;
}

.panel-card p {
  animation: subtitleBreath 5.2s ease-in-out infinite;
}

.enhanced-panel {
  position: relative;
  background: linear-gradient(145deg, #0d1117, #161b22);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  opacity: 0;
  animation: panel-appear 0.6s ease-out forwards;
}

@keyframes panel-appear {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.enhanced-panel:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}
.enhanced-panel:active { transform: scale(0.98); }

.panel-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.05);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.enhanced-panel:hover .panel-icon {
  transform: translateY(-3px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
}

.panel-badge {
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  display: inline-block;
}

.panel-green { --p-color: #39ff14; border-color: rgba(57, 255, 20, 0.3); }
.panel-gold { --p-color: #ffd700; border-color: rgba(255, 215, 0, 0.3); }
.panel-cyan { --p-color: #00f2ff; border-color: rgba(0, 242, 255, 0.3); }
.panel-red { --p-color: #ff0044; border-color: rgba(255, 0, 68, 0.3); }
.panel-magenta { --p-color: #ff00ff; border-color: rgba(255, 0, 255, 0.3); }

.motion-stagger .panel-card {
  opacity: 0;
  transform: translateY(12px);
  animation: panel-appear 0.55s ease-out forwards;
}
.motion-stagger .panel-card:nth-child(1) { animation-delay: 40ms; }
.motion-stagger .panel-card:nth-child(2) { animation-delay: 80ms; }
.motion-stagger .panel-card:nth-child(3) { animation-delay: 120ms; }
.motion-stagger .panel-card:nth-child(4) { animation-delay: 160ms; }
.motion-stagger .panel-card:nth-child(5) { animation-delay: 200ms; }
.motion-stagger .panel-card:nth-child(6) { animation-delay: 240ms; }
.motion-stagger .panel-card:nth-child(7) { animation-delay: 280ms; }
.motion-stagger .panel-card:nth-child(8) { animation-delay: 320ms; }
.motion-stagger .panel-card:nth-child(9) { animation-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
  .panel-card,
  .panel-card::before,
  .panel-card::after,
  .online-dot,
  .grid-bg,
  .dash-frame::before,
  .dash-frame::after,
  .title-fx,
  .subtitle-fx,
  .letters-wave .char-wave,
  .panel-card h3,
  .panel-card p,
  .motion-stagger .panel-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

@media (max-width: 900px) {
  .labo-frame {
    width: min(980px, calc(100vw - 1rem));
    padding: 1.4rem 1rem 1.1rem;
    border-radius: 14px;
  }

  .labo-header {
    padding: 0.55rem 0.8rem;
  }

  .labo-btn {
    width: 100%;
    max-width: 100%;
    padding: 0.85rem 1rem;
    letter-spacing: 0.16em;
  }

  .hud-badge {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 9px;
  }
}
