/* ================================================================
 * ProVsup Design System — pv-drawer.css
 * Panneau latéral glissant (drawer) réutilisable.
 *
 * Classes :
 *   .pv-drawer               — panneau (toujours dans le DOM)
 *   .pv-drawer--open         — état ouvert (ajouté via ng-class)
 *   .pv-drawer-overlay       — fond semi-transparent cliquable
 *   .pv-drawer-overlay--visible — overlay visible
 *   .pv-drawer-header        — en-tête avec titre + fermer
 *   .pv-drawer-title         — texte du titre
 *   .pv-drawer-close         — bouton fermer
 *   .pv-drawer-body          — zone de contenu scrollable
 *
 * Usage :
 *   <div class="pv-drawer-overlay"
 *        ng-class="{'pv-drawer-overlay--visible': open}"
 *        ng-click="open = false"></div>
 *   <div class="pv-drawer" ng-class="{'pv-drawer--open': open}">
 *     <div class="pv-drawer-header">…</div>
 *     <div class="pv-drawer-body">…</div>
 *   </div>
 * ================================================================ */


/* ── Overlay ────────────────────────────────────────────────────── */

.pv-theme .pv-drawer-overlay {
  position: fixed;
  top: var(--cmdbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: oklch(0 0 0 / 0.40);
  z-index: 1019;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
  cursor: pointer;
}

.pv-theme .pv-drawer-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}


/* ── Panneau ────────────────────────────────────────────────────── */

.pv-theme .pv-drawer {
  position: fixed;
  top: var(--cmdbar-h);
  right: 0;
  bottom: 0;
  width: 360px;
  z-index: 1020;
  background: var(--cmd-bg);
  border-left: 1px solid oklch(1 0 0 / 0.08);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.26s ease;
}

.pv-theme .pv-drawer--open {
  transform: translateX(0);
  box-shadow: -6px 0 32px oklch(0 0 0 / 0.35);
}


/* ── En-tête ────────────────────────────────────────────────────── */

.pv-theme .pv-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 50px;
  flex: none;
  border-bottom: 1px solid oklch(1 0 0 / 0.08);
}

.pv-theme .pv-drawer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--cmd-fg);
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.pv-theme .pv-drawer-title i {
  opacity: 0.55;
  font-size: 14px;
}

.pv-theme .pv-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  color: oklch(1 0 0 / 0.40);
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
  font-size: 13px;
  padding: 0;
  line-height: 1;
}

.pv-theme .pv-drawer-close:hover {
  background: oklch(1 0 0 / 0.08);
  color: var(--cmd-fg);
}


/* ── Corps scrollable ───────────────────────────────────────────── */

.pv-theme .pv-drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: oklch(1 0 0 / 0.15) transparent;
}

.pv-theme .pv-drawer-body::-webkit-scrollbar {
  width: 4px;
}

.pv-theme .pv-drawer-body::-webkit-scrollbar-thumb {
  background: oklch(1 0 0 / 0.15);
  border-radius: 2px;
}


/* ── Changelog — styles spécifiques dans le drawer ─────────────── */

.pv-theme .pv-changelog .list-group {
  margin: 0;
  border-radius: 0;
}

.pv-theme .pv-changelog .list-group-item {
  background: transparent !important;
  border-left: none !important;
  border-right: none !important;
  border-color: oklch(1 0 0 / 0.07) !important;
  color: oklch(1 0 0 / 0.65) !important;
  padding: 14px 16px;
}

.pv-theme .pv-changelog .list-group-item-heading {
  color: oklch(1 0 0 / 0.90) !important;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pv-theme .pv-changelog .list-group-item-text {
  font-size: 12px;
  font-family: var(--font-ui);
}

.pv-theme .pv-changelog .list-group-item-text .hbox {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 3px 0;
}

.pv-theme .pv-changelog .list-group-item-text .thumb-xs {
  width: 18px;
  text-align: center;
  flex: none;
}

.pv-theme .pv-changelog .list-group-item-text .col {
  min-width: 0;
  line-height: 1.4;
}

.pv-theme .pv-changelog .badge {
  margin-left: auto;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--r-pill);
}

.pv-theme .pv-changelog .alert {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
}


/* ── Variante étroite ───────────────────────────────────────────── */

.pv-theme .pv-drawer--sm {
  width: 280px;
}


/* ── Panneau Options (settings) ─────────────────────────────────── */

.pv-theme .pv-settings-body {
  padding: 0;
}

.pv-theme .pv-settings-section {
  padding: 16px 16px 12px;
  border-bottom: 1px solid oklch(1 0 0 / 0.07);
}

.pv-theme .pv-settings-section:last-child {
  border-bottom: none;
}

.pv-theme .pv-settings-section > .pv-section-label {
  margin-bottom: 10px;
}

.pv-theme .pv-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 2px 0;
}

.pv-theme .pv-settings-row-label {
  font-size: 13px;
  color: var(--cmd-fg);
  font-family: var(--font-ui);
}


/* ── Grille de couleurs d'accent ────────────────────────────────── */

.pv-theme .pv-accent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pv-theme .pv-accent-swatch {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 1px 6px oklch(0 0 0 / 0.35);
}

.pv-theme .pv-accent-swatch:hover {
  transform: scale(1.10);
  box-shadow: 0 2px 10px oklch(0 0 0 / 0.45);
}

.pv-theme .pv-accent-swatch--active {
  box-shadow: 0 0 0 2.5px oklch(1 0 0 / 0.90),
              0 0 0 5px var(--accent),
              0 2px 10px oklch(0 0 0 / 0.40);
  transform: scale(1.05);
}

.pv-theme .pv-accent-swatch > .fa-check {
  color: #ffffff;
  font-size: 14px;
  text-shadow: 0 1px 3px oklch(0 0 0 / 0.45);
}


/* ── Icône du site ──────────────────────────────────────────────── */

.pv-theme .pv-icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.pv-theme .pv-icon-opt {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: none;
  background: oklch(1 0 0 / 0.07);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: oklch(1 0 0 / 0.55);
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
  padding: 0;
}

.pv-theme .pv-icon-opt:hover {
  background: oklch(1 0 0 / 0.12);
  color: oklch(1 0 0 / 0.90);
}

.pv-theme .pv-icon-opt--active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.pv-theme .pv-settings-reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: none;
  color: oklch(1 0 0 / 0.30);
  font-size: 11px;
  font-family: var(--font-ui);
  cursor: pointer;
  padding: 6px 0 0;
  transition: color 0.12s;
  line-height: 1;
}

.pv-theme .pv-settings-reset:hover {
  color: oklch(0.68 0.17 15);
}
