/* ==========================================================================
   Dashboard "El Costo Oculto del Oro Verde"
   Estilos para tablero de página única sin scroll
   ========================================================================== */

/* ---------- Reset de scroll ---------- */
html, body {
  overflow: hidden !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------- Tipografía ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
  background: #0f1419 !important;
  color: #e8eaed !important;
}

/* ---------- Layout del Dashboard ---------- */
.dashboard-content {
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
}

/* Quarto dashboard overrides */
.quarto-dashboard .dashboard-content {
  padding: 0 !important;
}

.quarto-dashboard .dashboard-row {
  margin: 0 !important;
  padding: 0 !important;
}

/* ---------- Fila 1: Encabezado / Fuentes (10%) ---------- */
.dashboard-row.fila-fuentes {
  flex: 0 0 10vh !important;
  max-height: 10vh !important;
  min-height: 10vh !important;
}

/* ---------- Fila 2: Pregunta Central (15%) ---------- */
.dashboard-row.fila-pregunta {
  flex: 0 0 15vh !important;
  max-height: 15vh !important;
  min-height: 15vh !important;
}

/* ---------- Fila 3: Gráficas (75%) ---------- */
.dashboard-row.fila-graficas {
  flex: 1 1 75vh !important;
  max-height: 75vh !important;
  min-height: 75vh !important;
}

/* ---------- Tarjetas (Value Boxes y Cards) ---------- */
.card {
  background: rgba(30, 37, 46, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3) !important;
  overflow: hidden !important;
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 0.5rem 1rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #9aa0a6 !important;
}

.card-body {
  padding: 0.75rem !important;
  overflow: hidden !important;
}

/* ---------- Título del dashboard ---------- */
.navbar {
  background: linear-gradient(135deg, #1a2332 0%, #0f1419 100%) !important;
  border-bottom: 2px solid rgba(76, 175, 80, 0.3) !important;
  padding: 0.4rem 1.5rem !important;
  min-height: 0 !important;
}

.navbar-title {
  font-weight: 800 !important;
  font-size: 1.1rem !important;
  background: linear-gradient(135deg, #66bb6a, #43a047) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

.navbar .navbar-brand-container .navbar-brand .navbar-title::after {
  content: '' !important;
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem;
  height: 100%;
  align-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 0.4rem;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #66bb6a;
  line-height: 1.2;
}

.stat-value.stat-red { color: #ef5350; }
.stat-value.stat-amber { color: #ffa726; }

.stat-label {
  font-size: 0.6rem;
  color: #9aa0a6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

/* ---------- Pregunta ODS 15 ---------- */
.pregunta-ods {
  text-align: center !important;
  padding: 0.4rem 2rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100% !important;
}

.pregunta-ods .ods-badge {
  display: inline-block;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.pregunta-ods .pregunta-texto {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.55;
  color: #c8ccd0;
  max-width: 900px;
  font-style: italic;
}

.pregunta-ods .pregunta-texto em {
  color: #81c784;
  font-weight: 600;
  font-style: normal;
}

/* ---------- Gráficas Plotly ---------- */

/* Show only the first cell-output-display per card to avoid Plotly duplication */
.card-body .cell-output-display ~ .cell-output-display {
  display: none !important;
}

/* Also handle cell-output wrapper */
.card-body .cell-output ~ .cell-output {
  display: none !important;
}

.plotly .plot-container {
  height: 100% !important;
}

.cell-output-display {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.cell-output-display > div,
.cell-output-display > figure {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Footer / Fuentes ---------- */
.fuentes-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.72rem;
  color: #9aa0a6;
  letter-spacing: 0.02em;
}

.fuentes-bar .fuente-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.fuentes-bar .fuente-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
}

.fuentes-bar .separator {
  color: rgba(255, 255, 255, 0.15);
  font-weight: 300;
}

/* ---------- Scrollbar oculta ---------- */
::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

* {
  scrollbar-width: none !important;
}

/* ---------- Responsive: pantallas pequeñas ---------- */
@media (max-height: 700px) {
  .card-header {
    padding: 0.3rem 0.75rem !important;
    font-size: 0.7rem !important;
  }
  .card-body {
    padding: 0.4rem !important;
  }
  .pregunta-ods .pregunta-texto {
    font-size: 0.9rem;
  }
  .value-box .value-box-value {
    font-size: 1rem !important;
  }
}
