/* =========================================================
   10-predictive.css — Stile tab Overview Predittiva

   Potenzia la tab predittiva con card moderne, switch
   animato, tabelle leggibili e modal elegante.
   Usa le variabili da 00-variables.css.
   ========================================================= */


/* ===== GAUGE ROW ===== */

.tab-predictive .pred-gauge-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.tab-predictive .kpi-gauge-card {
  flex: 1;
  min-width: 0;
}

.tab-predictive .kpi-gauge-card .js-plotly-plot {
  border-radius: 8px;
}

/* ===== KPI CARDS — accento colorato + hover ===== */

.tab-predictive .kpi-row {
  gap: 16px;
}

.tab-predictive .kpi-card {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tab-predictive .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
}

/* Barra colorata a sinistra di ogni card */
.tab-predictive .kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--accent-primary);
}

/* Colore specifico per ogni card — ordine: churn, rischio, activity, basket, prossimi */






/* Valore KPI più grande e bold */
.tab-predictive .kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 6px 0;
}

/* Label KPI */
.tab-predictive .kpi-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

/* Icona info — hover glow */
.tab-predictive .kpi-card span[id^="pred-info-"] {
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
}
.tab-predictive .kpi-card:hover span[id^="pred-info-"] {
  opacity: 0.8;
}
.tab-predictive .kpi-card span[id^="pred-info-"]:hover {
  opacity: 1;
  transform: scale(1.2);
}


/* ===== SWITCH CONTAINER ===== */

.tab-predictive > .chart-card {
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  border: none;
  overflow: hidden;
}

/* Barra switch — sfondo sottile */
.tab-predictive > .chart-card > div:first-child {
  background: linear-gradient(to bottom, #FAFAFA, #FFFFFF);
}

/* Bottoni switch — transizioni fluide */
.tab-predictive button[id^="pred-switch-"] {
  transition: all 0.25s ease;
  font-family: inherit;
  letter-spacing: 0.2px;
}
.tab-predictive button[id^="pred-switch-"]:hover {
  background: var(--hover-overlay) !important;
}


/* ===== TABELLE — righe alternate + hover ===== */

/* Riga hover */
.tab-predictive .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
  transition: background-color 0.15s;
}
.tab-predictive .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:hover td {
  background-color: rgba(46, 125, 50, 0.04) !important;
}

/* Righe alternate */
.tab-predictive .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even) td {
  background-color: #FAFCFA;
}
.tab-predictive .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner tr:nth-child(even):hover td {
  background-color: rgba(46, 125, 50, 0.04) !important;
}

/* Header tabella — più moderno */
.tab-predictive .dash-table-container .dash-header {
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted) !important;
}

/* Celle filtro */
.tab-predictive .dash-table-container .dash-filter {
  border: 1px solid var(--border-default) !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  padding: 4px 8px !important;
}

/* Paginazione */
.tab-predictive .dash-table-container .previous-next-container {
  padding: 12px 8px;
}
.tab-predictive .dash-table-container .previous-next-container button {
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-predictive .dash-table-container .previous-next-container button:hover {
  background: var(--accent-bg-light);
  border-color: var(--accent-primary);
}


/* ===== BANNER FILTRI ===== */

.tab-predictive > div:nth-child(2) {
  border-radius: 10px;
  backdrop-filter: blur(4px);
}


/* ===== CONTEGGI RISULTATI ===== */

div[id^="pred-count-"] {
  font-weight: 500;
  padding-top: 4px !important;
}

/* Hint click cliente */
.tab-predictive div[style*="fontStyle: italic"] {
  transition: opacity 0.2s;
  opacity: 0.6;
}
.tab-predictive:hover div[style*="fontStyle: italic"] {
  opacity: 1;
}


/* ===== MODAL INFO KPI ===== */

#pred-info-modal-overlay {
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}

#pred-info-modal {
  animation: slideUp 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* Bottone chiudi — hover rosso */
#pred-info-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}
#pred-info-close:hover {
  background: var(--danger-bg-light);
  color: var(--danger) !important;
}

/* Contenuto modal — linee laterali colorate */
#pred-info-body > div > div[style*="borderLeft"] {
  border-radius: 0 6px 6px 0;
  background: rgba(0,0,0,0.015);
  padding-left: 16px !important;
  padding-right: 12px !important;
}


/* ===== RESPONSIVE — 5 cards su mobile ===== */

@media (max-width: 1200px) {
  .tab-predictive .kpi-row {
    flex-wrap: wrap;
  }
  .tab-predictive .kpi-card {
    min-width: calc(33% - 12px);
    flex: 1 1 calc(33% - 12px);
  }
}

@media (max-width: 768px) {
  .tab-predictive .kpi-card {
    min-width: calc(50% - 8px);
    flex: 1 1 calc(50% - 8px);
  }
  .tab-predictive .kpi-value {
    font-size: 22px;
  }
  .tab-predictive button[id^="pred-switch-"] {
    font-size: 12px !important;
    padding: 10px 8px !important;
  }
}

/* Colori barra laterale — riga 2 (3 card numeriche) */
.tab-predictive .kpi-row:not(.pred-gauge-row) .kpi-card:nth-child(1)::before { background: var(--danger); }
.tab-predictive .kpi-row:not(.pred-gauge-row) .kpi-card:nth-child(2)::before { background: var(--accent-primary); }
.tab-predictive .kpi-row:not(.pred-gauge-row) .kpi-card:nth-child(3)::before { background: #1565C0; }

/* Colori barra laterale — gauge cards */
.tab-predictive .pred-gauge-row .kpi-gauge-card:nth-child(1)::before { background: var(--danger); }
.tab-predictive .pred-gauge-row .kpi-gauge-card:nth-child(2)::before { background: var(--warning); }