/**
 * Zone 4 : Center Panel (public/studio/zones/center-panel/center-panel.css)
 * Style Niveau 3 spécifique au panneau de contrôles contextuels.
 * Rétablit fidèlement les sélecteurs, styles cyber-studio et animations de 45de067.
 * Plafond strict < 500 lignes.
 */

/* Colonne des contrôles du panneau central */
.workspace-controls-column {
  flex: 1 1 0%;
  min-width: 320px;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: blur(16px);
}

/* Panneaux de contrôles : un seul actif à la fois */
.controls-panel {
  width: 100%;
  height: 100%;
  flex-direction: column;
  gap: 0.65rem;
}

.controls-panel:not(.active) {
  display: none !important;
}

.controls-panel.active {
  display: flex !important;
}

/* En-tête de panneau commun */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-title {
  font-family: var(--font-family-display, 'Outfit', sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.7rem;
  color: #94a3b8;
  margin: 0.1rem 0 0 0;
}

/* ============================================================
   VUE PRÉVISUALISATION : BADGES & CARTES
   ============================================================ */

/* Badge de statut du viewer avec halo néon */
.viewer-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.viewer-status-badge.status-live {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.viewer-status-badge.status-mp4 {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.viewer-status-badge.status-generating {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

/* Point pulsant animé */
.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: viewerDotPulse 1.8s infinite ease-in-out;
}

@keyframes viewerDotPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}

/* Badge de scène active */
.viewer-active-scene-badge {
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

/* Cartes contextuelles (Transport & Déclinaisons) */
.preview-variant-card,
.preview-transport-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
}

.preview-variant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.15rem;
}

.preview-variant-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #3b82f6;
}

.viewer-variant-badge {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.viewer-variant-badge.badge-mp4 {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.viewer-variant-badge.badge-direct {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.viewer-variant-select {
  width: 100%;
  background: #090d16;
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 7px;
  color: #f1f5f9;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.42rem 0.6rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.viewer-variant-select:hover,
.viewer-variant-select:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
}

.preview-timing-label {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

/* ============================================================
   VUE JSON : STATUS BADGE, OUTILS & ACTIONS
   ============================================================ */

.json-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.json-status-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.json-status-badge.status-valid {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.json-status-badge.status-valid .status-indicator {
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.json-status-badge.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  animation: statusPulseWarning 2.5s infinite;
}

.json-status-badge.status-warning .status-indicator {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
}

.json-status-badge.status-invalid {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: statusPulseError 2.5s infinite;
}

.json-status-badge.status-invalid .status-indicator {
  background: #f87171;
  box-shadow: 0 0 6px #f87171;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.json-status-search-icon {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-left: 0.15rem;
}

@keyframes statusPulseWarning {
  0%, 100% {
    box-shadow: 0 0 0 rgba(245, 158, 11, 0);
  }
  50% {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  }
}

@keyframes statusPulseError {
  0%, 100% {
    box-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  }
}

.panel-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.btn-ctrl-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 9px;
  font-family: var(--font-family-display, 'Outfit', sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  user-select: none;
}

.btn-ctrl-primary:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.btn-ctrl-primary.active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(217, 38, 248, 0.5);
  color: #c4b5fd;
}

.btn-ctrl-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font-family-display, 'Outfit', sans-serif);
  font-size: 0.76rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-ctrl-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-ctrl-action.btn-ctrl-media {
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.08);
}

.btn-ctrl-action.btn-ctrl-media:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.panel-buttons-subgroup {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  box-sizing: border-box;
}

.panel-subgroup-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.panel-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
  width: 100%;
}

.btn-ctrl-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.18s ease;
  box-sizing: border-box;
}

.btn-ctrl-tool:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
  color: #f8fafc;
  transform: translateY(-1px);
}

.btn-ctrl-tool.btn-ctrl-tool-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.char-count {
  font-family: var(--font-family-mono, 'JetBrains Mono', monospace);
  font-size: 0.68rem;
  color: #64748b;
  text-align: right;
  margin-top: 2px;
}
