/* ============================================================
   NOVIABOT — Page analytics Viewers (settings-viewers.html)
   Thème aligné sur Paramètres : fond #23134d, cyan / violet.
============================================================ */

.viewers-page.viewers-wrapper,
body.viewers-page {
  background: #23134d;
  color: #e8eaff;
}

.viewers-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

/* ----- En-tête ----- */
.vt-header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.vt-title-big {
  font-size: clamp(1.45rem, 3.5vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #18e7ff, #b978f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.vt-subtitle {
  font-size: 0.95rem;
  color: #cfd4ff;
  opacity: 0.92;
  max-width: 52rem;
  margin: 0 auto;
  line-height: 1.55;
}

/* ----- Bandeau KPI ----- */
.vt-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.vt-kpi-card {
  background: linear-gradient(145deg, rgba(24, 231, 255, 0.06), rgba(185, 120, 247, 0.08));
  border: 1px solid rgba(24, 231, 255, 0.2);
  border-radius: 16px;
  padding: 1.1rem 1.15rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.vt-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(24, 231, 255, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.vt-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #18e7ff, #b978f7);
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.kpi-icon {
  font-size: 1.25rem;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b978f7;
}

.vt-kpi-card .kpi-value {
  font-size: 1.55rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.2rem;
}

.vt-kpi-card .kpi-trend {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.vt-kpi-card .kpi-trend.up { color: #5ef5b8; }
.vt-kpi-card .kpi-trend.neutral { color: #cfd4ff; }

.kpi-mini {
  font-size: 0.72rem;
  color: #cfd4ff;
  opacity: 0.9;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kpi-spark {
  position: absolute;
  right: 0.5rem;
  bottom: 0.45rem;
  width: 48px;
  height: 22px;
  opacity: 0.35;
  background: linear-gradient(90deg, transparent, rgba(24, 231, 255, 0.5));
  border-radius: 4px;
  pointer-events: none;
}

/* ----- Grille graphiques ----- */
.viewers-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

.vg-card {
  grid-column: 1 / -1;
  background: linear-gradient(160deg, rgba(27, 13, 68, 0.92), rgba(45, 25, 95, 0.88));
  border: 1px solid rgba(185, 120, 247, 0.28);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

@media (min-width: 960px) {
  .vg-main-chart { grid-column: 1 / -1; }
  .vg-revenue { grid-column: 1 / 7; }
  .vg-heatmap { grid-column: 7 / -1; }
  .vg-ai { grid-column: 1 / -1; }
  .vg-games { grid-column: 1 / -1; }
  .vg-sources { grid-column: 1 / -1; }
  .vg-timeline { grid-column: 1 / -1; }
}

.vg-header {
  padding: 1.25rem 1.35rem 0.75rem;
  border-bottom: 1px solid rgba(24, 231, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.vg-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
}

.vg-sub {
  font-size: 0.82rem;
  color: #cfd4ff;
  opacity: 0.9;
  max-width: 42rem;
  line-height: 1.45;
}

.vg-legend-mini {
  font-size: 0.78rem;
  color: #cfd4ff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.25rem;
}

.ld-viewers { background: #18e7ff; }
.ld-messages { background: #b978f7; }

.vg-body {
  position: relative;
  min-height: 240px;
  padding: 0.75rem 1rem 1rem;
}

.vg-body canvas {
  display: block;
  width: 100% !important;
  height: 240px !important;
  max-height: 45vh;
}

.vg-sources-chart canvas {
  height: 220px !important;
}

.vg-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  padding: 0.85rem 1.25rem 1.1rem;
  background: rgba(0, 0, 0, 0.22);
  border-top: 1px solid rgba(185, 120, 247, 0.15);
}

.vg-footer-item {
  text-align: center;
}

.vg-footer-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b978f7;
  font-weight: 700;
}

.vg-footer-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

/* Heatmap */
.heatmap-body {
  min-height: 200px;
}

.hm-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  grid-auto-rows: minmax(28px, auto);
  gap: 4px;
  align-items: stretch;
  padding: 0.5rem 0;
}

.hm-corner {
  grid-column: 1;
  grid-row: 1;
}

.hm-day {
  font-size: 0.65rem;
  font-weight: 700;
  color: #b978f7;
  text-align: center;
  padding: 0.25rem 0;
}

.hm-hour {
  font-size: 0.65rem;
  color: #cfd4ff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.35rem;
}

.hm-cell {
  border-radius: 6px;
  background: rgba(24, 231, 255, calc(0.12 + var(--intensity, 0.3) * 0.55));
  border: 1px solid rgba(24, 231, 255, 0.15);
  min-height: 26px;
}

/* IA */
.ai-body { padding: 0.5rem 0; }

.ai-list {
  list-style: none;
  padding: 0 1.25rem 1.25rem;
}

.ai-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(185, 120, 247, 0.12);
}

.ai-label { color: #cfd4ff; font-size: 0.88rem; }
.ai-value { color: #18e7ff; font-weight: 700; font-size: 0.88rem; text-align: right; max-width: 100%; }

/* Table */
.vg-table-inner {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.vg-table-inner th,
.vg-table-inner td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(185, 120, 247, 0.12);
}

.vg-table-inner th {
  color: #b978f7;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.vg-table-inner td { color: #e8eaff; }

.t-up { color: #5ef5b8; font-weight: 700; }
.t-down { color: #ff7a9a; font-weight: 700; }

/* Sources */
.vg-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  padding: 0.5rem 1rem 1.25rem;
}

.vg-sources-chart {
  flex: 1 1 220px;
  min-width: 200px;
}

.vg-sources-list {
  list-style: none;
  flex: 1 1 200px;
  padding: 0;
}

.vg-sources-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(185, 120, 247, 0.1);
  font-size: 0.86rem;
}

.vg-sources-list span:last-child {
  font-weight: 800;
  color: #18e7ff;
}

/* Timeline */
.timeline-body { padding: 0.5rem 1rem 1.25rem; }

.timeline-list {
  list-style: none;
  padding: 0;
}

.timeline-list li {
  padding: 0.75rem 0;
  border-left: 3px solid rgba(24, 231, 255, 0.45);
  padding-left: 1rem;
  margin-left: 0.35rem;
}

.tl-time {
  font-size: 0.75rem;
  font-weight: 800;
  color: #b978f7;
  display: block;
  margin-bottom: 0.2rem;
}

.tl-main { color: #fff; font-weight: 700; display: block; }
.tl-meta { color: #cfd4ff; font-size: 0.8rem; margin-top: 0.2rem; display: block; }

@media (max-width: 640px) {
  .viewers-wrapper { padding: 1rem 0.75rem 2rem; }
  .vg-body canvas { height: 200px !important; }
}
