/* ============================================================
   ProfZen UI — couche d'amélioration visuelle partagée
   Chargée APRÈS les styles inline de chaque page.
   Purement additive : aucune règle ne modifie la logique JS
   ni la structure des pages (pas de display, pas de position
   sur les éléments pilotés par le code).
   Palette du thème : navy #070d18 · teal #32b8c6 · violet #8b5cf6
   Assets générés avec Canva : assets/canva/spark.png, favicon.png
   ============================================================ */

/* ---------- Animations de base ---------- */
@keyframes pzPageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pzHeaderIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pzPop {
  from { opacity: 0; transform: translateY(14px) scale(0.965); }
  to   { opacity: 1; transform: none; }
}
@keyframes pzFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pzCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pzFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@keyframes pzSheen {
  from { transform: translateX(-120%) skewX(-18deg); }
  to   { transform: translateX(220%)  skewX(-18deg); }
}

/* ---------- Entrée de page ---------- */
main,
.container,
.main-container {
  animation: pzPageIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
header,
.header,
.topbar {
  animation: pzHeaderIn 0.45s ease both;
}

/* Liseré dégradé sous les en-têtes collants */
header::after,
.header::after,
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(139, 92, 246, 0.55) 25%,
    rgba(50, 184, 198, 0.55) 75%,
    transparent 100%);
  pointer-events: none;
}

/* ---------- Logo ---------- */
.logo-small,
.topbar-logo {
  transition: transform 0.3s ease, filter 0.3s ease;
}
.logo-small:hover,
.topbar-logo:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 0 16px rgba(50, 184, 198, 0.5));
}

/* ---------- Titres de page ---------- */
.page-title {
  position: relative;
  text-shadow: 0 0 32px rgba(139, 92, 246, 0.25);
}
.page-title::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  margin: 9px 0 2px;
  background: linear-gradient(90deg, #8b5cf6, #32b8c6);
  box-shadow: 0 0 12px rgba(50, 184, 198, 0.45);
}

/* Étincelle Canva devant les "eyebrows" de section */
.page-eyebrow::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  vertical-align: -1px;
  background: url('canva/spark.png') center / contain no-repeat;
}

/* ---------- Puces personnalisées (listes de contenu sans classe) ---------- */
ul:not([class]) {
  list-style: none;
  padding-left: 6px;
}
ul:not([class]) > li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 4px;
}
ul:not([class]) > li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.3em;
  width: 14px;
  height: 14px;
  background: url('canva/spark.png') center / contain no-repeat;
}

/* ---------- Cartes ---------- */
.card,
.catalogue-card {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover,
.catalogue-card:hover {
  border-color: rgba(139, 92, 246, 0.28);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.08);
}

/* Cartes cliquables : lévitation + halo */
.class-card,
.eval-card {
  animation: pzCardIn 0.4s ease both;
  transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1),
              border-color 0.22s ease, box-shadow 0.25s ease,
              background 0.22s ease;
}
.class-card:hover,
.eval-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(139, 92, 246, 0.18);
}
.class-card:active,
.eval-card:active {
  transform: translateY(-1px) scale(0.99);
}

/* Entrée en cascade discrète */
.class-card:nth-child(2), .eval-card:nth-child(2) { animation-delay: 0.05s; }
.class-card:nth-child(3), .eval-card:nth-child(3) { animation-delay: 0.10s; }
.class-card:nth-child(4), .eval-card:nth-child(4) { animation-delay: 0.15s; }
.class-card:nth-child(5), .eval-card:nth-child(5) { animation-delay: 0.20s; }
.class-card:nth-child(6), .eval-card:nth-child(6) { animation-delay: 0.25s; }

/* Lignes d'éléments */
.item-row {
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.item-row:hover {
  background: rgba(139, 92, 246, 0.05);
  transform: translateX(3px);
}

/* ---------- Boutons ---------- */
.btn-primary,
.btn.btn-primary,
.onboarding-close-btn {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.16s ease, box-shadow 0.22s ease, opacity 0.2s ease;
}
.btn-primary::before,
.btn.btn-primary::before,
.onboarding-close-btn::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}
.btn-primary:hover,
.btn.btn-primary:hover,
.onboarding-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.38), 0 0 18px rgba(50, 184, 198, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover::before,
.btn.btn-primary:hover::before,
.onboarding-close-btn:hover::before {
  animation: pzSheen 0.7s ease;
}
.btn-primary:active,
.btn.btn-primary:active,
.onboarding-close-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.btn-secondary,
.btn.btn-secondary,
.btn-back,
.btn-logout,
.btn-ghost {
  transition: transform 0.16s ease, border-color 0.2s ease,
              color 0.2s ease, background 0.2s ease, box-shadow 0.22s ease;
}
.btn-secondary:hover,
.btn.btn-secondary:hover,
.btn-back:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.btn-secondary:active,
.btn.btn-secondary:active,
.btn-back:active,
.btn-logout:active,
.btn-ghost:active {
  transform: translateY(1px);
}

/* ---------- Onglets ---------- */
.tab-btn {
  position: relative;
}
.tab-btn::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #8b5cf6, #32b8c6);
  box-shadow: 0 0 10px rgba(50, 184, 198, 0.5);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.tab-btn.active { border-bottom-color: transparent !important; }
.tab-btn.active::after { transform: scaleX(1); }

/* ---------- Modales ---------- */
.modal-overlay.active,
.modal.active,
.modal[style*="flex"],
.modal[style*="block"] {
  animation: pzFade 0.22s ease;
}
.modal-box,
.modal-content {
  animation: pzPop 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ---------- Champs de formulaire ---------- */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(50, 184, 198, 0.14), 0 0 18px rgba(139, 92, 246, 0.1);
}

/* Accessibilité clavier */
a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(50, 184, 198, 0.65);
  outline-offset: 2px;
}

/* ---------- États vides ---------- */
.empty-state {
  transition: border-color 0.25s ease;
}
.empty-state:hover { border-color: rgba(139, 92, 246, 0.3); }
.empty-state-icon {
  display: inline-block;
  animation: pzFloat 3.5s ease-in-out infinite;
}

/* ---------- Tableaux ---------- */
tbody tr { transition: background 0.15s ease; }

/* ---------- Barre de défilement thématisée ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.35) rgba(255, 255, 255, 0.04);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.4), rgba(50, 184, 198, 0.4));
  border-radius: 8px;
  border: 2px solid rgba(7, 13, 24, 0.8);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.6), rgba(50, 184, 198, 0.6));
}

/* ---------- Sélection de texte ---------- */
::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  main, .container, .main-container,
  header, .header, .topbar,
  .class-card, .eval-card,
  .modal-box, .modal-content,
  .empty-state-icon {
    animation: none !important;
  }
  .btn-primary::before,
  .btn.btn-primary::before,
  .onboarding-close-btn::before {
    display: none;
  }
  * { transition-duration: 0.01ms !important; }
}
