/* ═══════════════════════════════════════════════════════════════
   COCKPIT HOLOGRAPHIQUE - Interface Triptyque Biseautée
   Design "Command Bridge" - Vue dégagée + Tableau de bord
   ═══════════════════════════════════════════════════════════════ */

:root {
  --cockpit-cyan: #00d9ff;
  --cockpit-violet: #8b5cf6;
  --cockpit-rose: #ff6b9d;
  --cockpit-glow-cyan: rgba(0, 217, 255, 0.4);
  --cockpit-glow-violet: rgba(139, 92, 246, 0.4);
  --cockpit-glow-rose: rgba(255, 107, 157, 0.4);
  --cockpit-glass: rgba(10, 15, 25, 0.65);
  --cockpit-border: rgba(255, 255, 255, 0.08);
  --cockpit-timing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === CONTENEUR PRINCIPAL COCKPIT === */
.systems-cockpit {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  overflow: hidden;
}

/* === ZONE DÉGAGÉE (Pare-brise cockpit) === */
.cockpit-viewport {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(
    180deg,
    rgba(5, 10, 20, 0.95) 0%,
    rgba(8, 15, 30, 0.6) 40%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Effet horizon holographique */
.cockpit-viewport::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--cockpit-cyan) 20%,
    var(--cockpit-violet) 50%,
    var(--cockpit-rose) 80%,
    transparent 100%
  );
  opacity: 0.3;
  animation: horizonPulse 4s ease-in-out infinite;
}

@keyframes horizonPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.5; }
}

/* === GRILLE TRIPTYQUE === */
.cockpit-triptych {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  padding: 0 3rem 2rem;
  perspective: 1200px;
}

/* === PANNEAU BISEAUTÉ (Trapèze) === */
.cockpit-panel {
  position: relative;
  width: 280px;
  height: 200px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: all 0.5s var(--cockpit-timing);
}

/* Effet de projection vers l'utilisateur */
.cockpit-panel:nth-child(1) {
  transform: perspective(1000px) rotateY(8deg) rotateX(-3deg);
}

.cockpit-panel:nth-child(2) {
  transform: perspective(1000px) rotateX(-5deg) translateY(-20px);
  z-index: 5;
}

.cockpit-panel:nth-child(3) {
  transform: perspective(1000px) rotateY(-8deg) rotateX(-3deg);
}

/* Hover - Élévation */
.cockpit-panel:hover {
  transform: perspective(1000px) translateZ(30px) rotateX(-2deg);
  z-index: 20;
}

/* === CADRE BISEAUTÉ === */
.panel-frame {
  position: absolute;
  inset: 0;
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
  background: var(--cockpit-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--cockpit-border);
  transition: all 0.4s var(--cockpit-timing);
  overflow: hidden;
}

/* Bordures lumineuses */
.panel-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--panel-color, var(--cockpit-cyan)), transparent);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.panel-frame::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--panel-color, var(--cockpit-cyan));
  box-shadow: 0 0 20px var(--panel-glow, var(--cockpit-glow-cyan));
  opacity: 0.6;
}

.cockpit-panel:hover .panel-frame {
  border-color: var(--panel-color, var(--cockpit-cyan));
  box-shadow:
    0 0 40px var(--panel-glow, var(--cockpit-glow-cyan)),
    inset 0 0 30px rgba(0, 217, 255, 0.05);
}

.cockpit-panel:hover .panel-frame::before {
  opacity: 1;
}

/* === EFFET HOLOGRAPHIQUE INTERNE === */
.panel-holo {
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

/* Scanline holographique */
.panel-holo::before {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 217, 255, 0.03) 50%,
    transparent 100%
  );
  animation: holoScan 4s linear infinite;
}

@keyframes holoScan {
  0% { top: -100%; }
  100% { top: 200%; }
}

/* Grille de fond */
.panel-holo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 217, 255, 0.02) 2px,
      rgba(0, 217, 255, 0.02) 3px
    );
  pointer-events: none;
}

/* === CONTENU PANNEAU === */
.panel-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
}

/* Icône système */
.panel-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.panel-icon svg {
  width: 100%;
  height: 100%;
  stroke: var(--panel-color, var(--cockpit-cyan));
  stroke-width: 1.5;
  fill: none;
}

.cockpit-panel:hover .panel-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px var(--panel-glow, var(--cockpit-glow-cyan)));
}

/* Titre */
.panel-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--panel-color, var(--cockpit-cyan));
  margin-bottom: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--panel-glow, var(--cockpit-glow-cyan));
}

/* Sous-titre */
.panel-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* === INDICATEURS STATUT === */
.panel-status {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--panel-color, var(--cockpit-cyan));
  opacity: 0.4;
  animation: statusPulse 2s ease-in-out infinite;
}

.status-dot:nth-child(1) { animation-delay: 0s; }
.status-dot:nth-child(2) { animation-delay: 0.3s; }
.status-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes statusPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* === BARRE DE DONNÉES === */
.panel-databar {
  position: absolute;
  bottom: 12px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.panel-databar::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--data-level, 65%);
  background: linear-gradient(90deg, var(--panel-color, var(--cockpit-cyan)), transparent);
  border-radius: 2px;
  animation: dataFlow 3s ease-in-out infinite;
}

@keyframes dataFlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* === COULEURS PAR SYSTÈME === */
.cockpit-panel[data-system="gouvernance"] {
  --panel-color: var(--cockpit-cyan);
  --panel-glow: var(--cockpit-glow-cyan);
}

.cockpit-panel[data-system="ressources"] {
  --panel-color: var(--cockpit-violet);
  --panel-glow: var(--cockpit-glow-violet);
}

.cockpit-panel[data-system="legal"] {
  --panel-color: var(--cockpit-rose);
  --panel-glow: var(--cockpit-glow-rose);
}

/* === CONSOLE INFÉRIEURE === */
.cockpit-console {
  position: relative;
  z-index: 15;
  height: 60px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(5, 10, 20, 0.9) 30%,
    rgba(5, 10, 20, 0.98) 100%
  );
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4rem;
  border-top: 1px solid var(--cockpit-border);
}

/* Barre centrale holographique */
.cockpit-console::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--cockpit-cyan),
    var(--cockpit-violet),
    var(--cockpit-rose),
    transparent
  );
  opacity: 0.5;
}

/* Indicateurs console */
.console-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.console-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cockpit-cyan);
  box-shadow: 0 0 10px var(--cockpit-glow-cyan);
  animation: consolePulse 2s ease-in-out infinite;
}

@keyframes consolePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.console-indicator.warning::before {
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.console-indicator.active::before {
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

/* Statistiques console */
.console-stats {
  display: flex;
  gap: 2rem;
}

.console-stat {
  text-align: center;
}

.console-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cockpit-cyan);
  font-family: 'Monaco', 'Consolas', monospace;
}

.console-stat-label {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === ANIMATIONS D'ENTRÉE === */
.cockpit-panel {
  opacity: 0;
  transform: perspective(1000px) translateY(50px) rotateX(-20deg);
}

.cockpit-panel.active {
  opacity: 1;
}

.cockpit-panel.active:nth-child(1) {
  animation: panelEnter 0.8s var(--cockpit-timing) forwards;
  animation-delay: 0.1s;
}

.cockpit-panel.active:nth-child(2) {
  animation: panelEnterCenter 0.8s var(--cockpit-timing) forwards;
  animation-delay: 0.2s;
}

.cockpit-panel.active:nth-child(3) {
  animation: panelEnter 0.8s var(--cockpit-timing) forwards;
  animation-delay: 0.3s;
}

@keyframes panelEnter {
  0% {
    opacity: 0;
    transform: perspective(1000px) translateY(80px) rotateX(-25deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) rotateY(8deg) rotateX(-3deg) scale(1);
  }
}

@keyframes panelEnterCenter {
  0% {
    opacity: 0;
    transform: perspective(1000px) translateY(100px) rotateX(-30deg) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) rotateX(-5deg) translateY(-20px) scale(1);
  }
}

/* Animation panneau 3 (inversé) */
.cockpit-panel.active:nth-child(3) {
  animation-name: panelEnterRight;
}

@keyframes panelEnterRight {
  0% {
    opacity: 0;
    transform: perspective(1000px) translateY(80px) rotateX(-25deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) rotateY(-8deg) rotateX(-3deg) scale(1);
  }
}

/* Console entrée */
.cockpit-console {
  opacity: 0;
  transform: translateY(30px);
  animation: consoleEnter 0.6s var(--cockpit-timing) forwards;
  animation-delay: 0.5s;
}

@keyframes consoleEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .cockpit-triptych {
    gap: 1.5rem;
    padding: 0 2rem 1.5rem;
  }

  .cockpit-panel {
    width: 240px;
    height: 180px;
  }

  .panel-title {
    font-size: 1.1rem;
  }

  .cockpit-console {
    padding: 0 2rem;
  }
}

@media (max-width: 768px) {
  .cockpit-triptych {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
  }

  .cockpit-panel {
    width: 100%;
    max-width: 320px;
    height: 140px;
  }

  .cockpit-panel:nth-child(1),
  .cockpit-panel:nth-child(2),
  .cockpit-panel:nth-child(3) {
    transform: perspective(1000px) rotateX(-3deg);
  }

  .cockpit-panel.active:nth-child(1),
  .cockpit-panel.active:nth-child(2),
  .cockpit-panel.active:nth-child(3) {
    animation-name: panelEnterMobile;
  }

  @keyframes panelEnterMobile {
    0% {
      opacity: 0;
      transform: perspective(1000px) translateY(40px) rotateX(-15deg);
    }
    100% {
      opacity: 1;
      transform: perspective(1000px) rotateX(-3deg);
    }
  }

  .cockpit-viewport {
    height: 25%;
  }

  .cockpit-console {
    height: 50px;
    padding: 0 1rem;
  }

  .console-stats {
    gap: 1rem;
  }

  .console-stat-value {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .cockpit-panel {
    height: 120px;
  }

  .panel-icon {
    width: 36px;
    height: 36px;
  }

  .panel-title {
    font-size: 1rem;
  }

  .panel-subtitle {
    font-size: 0.7rem;
  }

  .console-indicator {
    font-size: 0.6rem;
  }

  .console-stats {
    display: none;
  }
}
