/* ==========================================================================
   DESIGN SYSTEM & STYLES PREMIUM - DASHBOARD ATELIER
   ========================================================================== */

/* Import de la police premium Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

body {
  font-family: 'Outfit', sans-serif;
  background-color: #0b0f19;
  background-image: 
    radial-gradient(at 10% 10%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(99, 102, 241, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* Optimisation des barres de défilement pour les écrans tactiles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* ==========================================================================
   EFFETS GLASSMORPHISM & TUILES TACTILES
   ========================================================================== */

.glass-panel {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.3);
}

.glass-panel-interactive {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel-interactive:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: 0 20px 40px -15px rgba(14, 165, 233, 0.2);
}

.glass-panel-interactive:active {
  transform: translateY(0) scale(0.98);
}

/* ==========================================================================
   CONFIDENTIALITÉ ET FLOUTAGE DYNAMIQUE
   ========================================================================== */

/* Transition de base pour les données sensibles */
.sensitive-data {
  transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

/* Mode flouté activé sur le parent */
.blur-sensitive .sensitive-data {
  filter: blur(7px);
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
}

/* ==========================================================================
   ANIMATIONS CSS DOUCES
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-up {
  animation: scaleUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animation de rayures pour l'espace QSE en construction */
@keyframes stripe-slide {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

.bg-stripes {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0.05) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  animation: stripe-slide 2s linear infinite;
}

/* Pulsation douce pour les indicateurs */
@keyframes softPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.95); }
}

.animate-soft-pulse {
  animation: softPulse 3s infinite ease-in-out;
}

/* ==========================================================================
   MODES D'AFFICHAGE PAR APPAREIL
   ========================================================================== */

/* ---- MODE TÉLÉVISION ---- */
body.device-tv #dashboard-grid {
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Mise à l'échelle typographique selon la config TV (appliquée dynamiquement via JS) */
body.device-tv {
  font-size: var(--tv-font-scale, 1rem);
}

/* ---- MODE ORDINATEUR ---- */
body.device-desktop #dashboard-grid {
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
}

/* ---- MODE TÉLÉPHONE ---- */
body.device-mobile {
  overflow: auto;
}

body.device-mobile #dashboard-grid {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow-y: auto;
  gap: 1rem;
  padding: 1rem;
}

/* En mode mobile, tous les widgets prennent toute la largeur */
body.device-mobile #dashboard-grid > section {
  width: 100% !important;
  min-height: 280px;
}

/* Masquage du widget Anniversaires en mode mobile */
body.device-mobile [data-widget="birthdays"] {
  display: none !important;
}

/* Réduction des en-têtes en mode mobile */
body.device-mobile header {
  height: auto;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Scrollbar custom en mode télé (plus épaisse pour écran tactile mural) */
body.device-tv ::-webkit-scrollbar {
  width: 12px;
}

body.device-tv .custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

