/**
 * JTrucks Monitor — Base
 * Reset léger, typographie, utilitaires, animations
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

p { margin: 0; }

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover { color: var(--primary-dark); }

button { font-family: inherit; }

img, svg { display: block; max-width: 100%; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* ——— Typo helpers ——— */
.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* ——— Animations ——— */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-dot {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0);
    opacity: 0.85;
  }
}

@keyframes pulse-live {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.4s var(--ease) both;
}

.fade-in {
  animation: fadeIn 0.3s var(--ease) both;
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.08s; }
.stagger > *:nth-child(4) { animation-delay: 0.11s; }
.stagger > *:nth-child(5) { animation-delay: 0.14s; }
.stagger > *:nth-child(6) { animation-delay: 0.17s; }
.stagger > *:nth-child(7) { animation-delay: 0.2s; }
.stagger > *:nth-child(8) { animation-delay: 0.23s; }

/* ——— Scrollbar discrète ——— */
.custom-scroll::-webkit-scrollbar,
.data-table-wrap--scroll::-webkit-scrollbar,
.alert-list::-webkit-scrollbar,
.timeline::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scroll::-webkit-scrollbar-thumb,
.data-table-wrap--scroll::-webkit-scrollbar-thumb,
.alert-list::-webkit-scrollbar-thumb,
.timeline::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-pill);
}

.custom-scroll::-webkit-scrollbar-track,
.data-table-wrap--scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* ——— Empty state ——— */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state i {
  font-size: 28px;
  opacity: 0.55;
}

.empty-state p {
  font-size: 13px;
  max-width: 280px;
}

/* ——— Override Bootstrap soft ——— */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.18);
  border-color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline-secondary {
  border-color: var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.btn-outline-secondary:hover {
  background: var(--background-alt);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom-color: var(--border);
  padding: 1.1rem 1.35rem;
}

.modal-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-footer {
  border-top-color: var(--border);
}
