/*
 * MARLEY SECURITY DASHBOARD — style.css
 * Complément aux utilitaires Tailwind compilés localement.
 * Règles spécifiques : accessibilité, états, animations discrètes,
 * scrollbars et composants natifs.
 */

/* ── Reset minimal ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Sélection de texte ─────────────────────────────────────────── */
::selection {
  background: rgba(34, 211, 238, 0.18);
  color: #e2e8f0;
}

/* ── Focus visible accessible ───────────────────────────────────── */
:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Smooth scroll ──────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Body baseline ──────────────────────────────────────────────── */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Pas d’overlay décoratif : priorité à la lisibilité des données. */

/* Interaction discrète : pas de glow décoratif. */
.kpi-card:hover {
  border-color: rgba(148, 163, 184, 0.20);
}

/* Les couleurs d’état sont réservées aux états réellement observés. */

/* ── Status pill states ─────────────────────────────────────────── */
.pill-secure {
  background: rgba(34, 197, 94, 0.10);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.30);
}
.pill-secure .status-pulse   { background-color: #4ade80; }

.pill-elevated {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.35);
}
.pill-elevated .status-pulse  { background-color: #fb923c; }

.pill-alert {
  background: rgba(248, 113, 113, 0.14);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.40);
}
.pill-alert .status-pulse     { background-color: #f87171; }

/* ── Skeleton shimmer ───────────────────────────────────────────── */
@keyframes shimmer {
  to { background-position: 200% center; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(22, 29, 46, 0.80) 25%,
    rgba(40, 55, 80, 0.55) 50%,
    rgba(22, 29, 46, 0.80) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.6s linear infinite;
  border-radius: 0.5rem;
  display: block;
}

/* ── Pulse dot ──────────────────────────────────────────────────── */
@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.82); }
}
.status-pulse {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: #64748b;
  animation: status-pulse 2.4s ease-in-out infinite;
}

/* ── Bar fill animation ─────────────────────────────────────────── */
@keyframes bar-fill {
  from { width: 0 !important; }
}
.bar-fill {
  animation: bar-fill 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.14);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.28);
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Chart.js canvas ────────────────────────────────────────────── */
canvas { display: block; }

/* ── Responsive tweaks ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .kpi-card { padding: 1rem; }
}
/* ── Host resource progress ─────────────────────────────────────────
 * Native <progress> keeps the value semantic and removes inline styles.
 */
.host-progress {
  display: block;
  width: 100%;
  height: 0.375rem;
  margin-top: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 0.375rem;
  background: #151a23;
  appearance: none;
  -webkit-appearance: none;
}

.host-progress::-webkit-progress-bar {
  background: #151a23;
  border-radius: 0.375rem;
}

.host-progress::-webkit-progress-value {
  border-radius: 0.375rem;
  background: #64748b;
}

.host-progress::-moz-progress-bar {
  border-radius: 0.375rem;
  background: #64748b;
}

.host-progress-cpu::-webkit-progress-value {
  background: #7dd3fc;
}

.host-progress-cpu::-moz-progress-bar {
  background: #7dd3fc;
}

.host-progress-mem::-webkit-progress-value {
  background: #94a3b8;
}

.host-progress-mem::-moz-progress-bar {
  background: #94a3b8;
}

.host-progress-disk::-webkit-progress-value {
  background: #64748b;
}

.host-progress-disk::-moz-progress-bar {
  background: #64748b;
}
