/**
 * Zone 1 : Left Sidebar (public/studio/zones/left-sidebar/left-sidebar.css)
 * Style Niveau 3 spécifique à la colonne de gauche (Capture 3 fidèle).
 * Largeur 250px figée, 0 débordement horizontal (< 500 lignes).
 */

.app-sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  height: 100vh;
  background: rgba(9, 13, 22, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

/* --- 1. Logo iViDEOA & Marque --- */
.sidebar-brand-block {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0 0.5rem 0;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease;
}

.sidebar-brand-link:hover {
  transform: translateY(-1px);
}

.sidebar-logo-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(217, 38, 248, 0.38)) drop-shadow(0 0 6px rgba(59, 130, 246, 0.28));
  display: block;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.5rem 0;
  width: 100%;
  flex-shrink: 0;
}

/* --- 2. Contrôle du Projet Actif --- */
.sidebar-nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

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

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.08em;
  padding-left: 0.15rem;
}

.btn-rename-active-project {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.btn-rename-active-project:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #e0f2fe;
}

.project-dropdown-wrapper {
  position: relative;
  width: 100%;
}

.btn-project-badge {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.45rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #f8fafc;
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.btn-project-badge:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}

.project-badge-left {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.project-badge-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
}

.project-badge-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e0e7ff;
  letter-spacing: 0.01em;
}

.project-badge-chevron {
  flex-shrink: 0;
  color: #94a3b8;
}

.project-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 230px;
  box-sizing: border-box;
  background: #0d121f;
  border: 1px solid rgba(217, 38, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 20px rgba(99, 102, 241, 0.2);
  z-index: 1000;
  padding: 0.5rem;
  overflow: hidden;
  backdrop-filter: blur(16px);
  max-height: 280px;
  overflow-y: auto;
}

.project-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem 0.45rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.35rem;
}

.btn-dropdown-create-new {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-dropdown-create-new:hover {
  text-decoration: underline;
  background: rgba(56, 189, 248, 0.1);
}

.project-dropdown-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.project-dropdown-empty {
  color: #64748b;
  font-size: 0.72rem;
  padding: 0.6rem;
  text-align: center;
}

.project-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.project-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.project-dropdown-item.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
}

.project-item-content {
  flex: 1;
  min-width: 0;
}

.project-item-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-item-meta {
  font-family: var(--font-family-mono);
  font-size: 0.64rem;
  color: #94a3b8;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-item-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.btn-project-item-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.68rem;
  cursor: pointer;
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.btn-project-item-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.btn-project-item-action.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Bouton Nouveau Projet */
.btn-sidebar-new-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.85rem;
  border-radius: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(217, 38, 248, 0.4);
  background: linear-gradient(135deg, #3b82f6 0%, #d926f8 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(217, 38, 248, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.btn-sidebar-new-project:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #e879f9 100%);
  box-shadow: 0 0 16px rgba(217, 38, 248, 0.6);
  transform: translateY(-1px);
}

/* Bouton Time-Machine */
.btn-sidebar-tool {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.btn-sidebar-tool-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-sidebar-tool:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(217, 38, 248, 0.6);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.time-machine-badge {
  background: rgba(217, 38, 248, 0.25);
  color: #f5d0fe;
  border: 1px solid rgba(217, 38, 248, 0.4);
  border-radius: 12px;
  padding: 0.05rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-family-mono);
}

/* Statut Auto-Save : pur indicateur textuel discret (zéro bouton, zéro encadrement) */
.sidebar-autosave-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.15rem 0;
}

.autosave-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 0.73rem;
  font-weight: 600;
  color: #94a3b8;
  transition: color 0.25s ease;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
  pointer-events: none;
}

.autosave-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 6px #3b82f6;
  flex-shrink: 0;
}

.autosave-status-pill.saving {
  color: #fbbf24 !important;
  background: transparent !important;
  border: none !important;
}

.autosave-status-pill.saving .autosave-pulse-dot {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation: pulse-dot 0.8s infinite alternate;
}

.autosave-status-pill.error {
  color: #f87171 !important;
  background: transparent !important;
  border: none !important;
}

.autosave-status-pill.error .autosave-pulse-dot {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* --- 3. Bas de Colonne : Solde, Déclinaisons & Téléchargement MP4 --- */
.sidebar-bottom-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
  width: 100%;
}

.sidebar-user-pill {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main, #f1f5f9);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-user-pill:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.sidebar-user-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
}

.sidebar-user-badge--guest {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.sidebar-user-badge--pro {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.sidebar-wallet-pill {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-wallet-pill:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
  transform: translateY(-1px);
}

.export-variant-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.export-variant-header {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #3b82f6;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sidebar-export-select {
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.sidebar-export-select:hover,
.sidebar-export-select:focus {
  border-color: #38bdf8;
}

.sidebar-download-button-wrapper {
  width: 100%;
  box-sizing: border-box;
}