/* ==================================================================
 * Dashboard Cards — design system Indicadores Saúde
 * Compartilhado entre Indicadores/Categoria.vue, ESus/VisaoGeralEsf.vue
 * e futuras pages do dashboard. Aprovado em 2026-04-27.
 * ================================================================== */

/* ============== Filtros (form: ano/quad/mês/etc + botão) ============== */
.filters-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 2px;
  z-index: 20;
}
.filters-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-canvas);
  color: var(--fg-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 160px;
  outline: none;
}
.filter-select:hover,
.filter-select:focus {
  border-color: var(--color-action);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.12);
}
.filter-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: var(--color-action);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}
.filter-btn:hover {
  background: var(--color-action-hover);
  transform: scale(1.02);
}
.filter-btn:active {
  transform: scale(0.98);
}

@media (max-width: 640px) {
  .filters-form { flex-direction: column; align-items: stretch; }
  .filter-group, .filter-btn { width: 100%; }
  .filter-select { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .filter-btn:hover, .filter-btn:active { transform: none; }
}

/* ============== Vision Card (Visão Geral por equipe) ============== */
/* Cores podem ser sobrescritas por html[data-categoria-page] em colors_and_type.css */
.vision-card {
  --vision-fg: #0EA5E9;
  --vision-from: #38BDF8;
  --vision-to: #0EA5E9;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--vision-fg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
}
.vision-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.vision-card--disabled { cursor: default; opacity: 0.7; }
.vision-card--disabled:hover { transform: none; background: rgba(255, 255, 255, 0.45); box-shadow: none; }

[data-theme="dark"] .vision-card {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .vision-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.vision-card__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--vision-from), var(--vision-to));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--vision-fg) 30%, transparent);
}
.vision-card__icon-svg { width: 24px; height: 24px; color: white; stroke-width: 2.5; }
.vision-card__content { flex: 1; min-width: 0; }
.vision-card__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--vision-fg);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.vision-card__title { font-size: 16px; font-weight: 700; color: var(--fg-primary); margin-bottom: 2px; }
.vision-card__desc { font-size: 13px; color: var(--fg-muted); }
.vision-card__arrow {
  width: 20px;
  height: 20px;
  color: var(--vision-fg);
  flex-shrink: 0;
  transition: transform 0.3s;
  stroke-width: 2;
}
.vision-card:hover .vision-card__arrow { transform: translateX(4px); }
.vision-card__breve-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}

/* ============== Grid de indicadores ============== */
.indicators-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1280px) { .indicators-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1024px) { .indicators-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .indicators-grid { grid-template-columns: 1fr; } }

/* ============== Indicator Card ============== */
.indicator-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  animation: indicator-card-slideup 0.7s cubic-bezier(0.4, 0, 0.2, 1) backwards;
  animation-delay: var(--card-delay, 0.1s);
}
.indicator-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--color-action);
}

@keyframes indicator-card-slideup {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Click ripple */
.indicator-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67, 56, 202, 0.25) 0%, rgba(67, 56, 202, 0) 70%);
  transform: translate(-50%, -50%);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1), height 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.7s;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.indicator-card:active::after {
  width: 400px;
  height: 400px;
  opacity: 1;
  transition: 0s;
}

/* Particles flutuando no hover */
.indicator-card__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s;
  z-index: 0;
}
.indicator-card:hover .indicator-card__particles { opacity: 1; }
.indicator-card__particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation: indicator-card-float 5s ease-in-out infinite;
}
.indicator-card__particle:nth-child(1) { left: 15%; top: 25%; animation-delay: 0s;   width: 4px; height: 4px; }
.indicator-card__particle:nth-child(2) { left: 65%; top: 45%; animation-delay: 0.8s; width: 5px; height: 5px; }
.indicator-card__particle:nth-child(3) { left: 85%; top: 15%; animation-delay: 1.6s; width: 6px; height: 6px; }
.indicator-card__particle:nth-child(4) { left: 35%; top: 65%; animation-delay: 2.4s; width: 4px; height: 4px; }
.indicator-card__particle:nth-child(5) { left: 10%; top: 55%; animation-delay: 3.2s; width: 5px; height: 5px; }
.indicator-card__particle:nth-child(6) { left: 50%; top: 80%; animation-delay: 4.0s; width: 4px; height: 4px; }
@keyframes indicator-card-float {
  0%, 100% { transform: translateY(0)    translateX(0)   scale(1);   }
  25%      { transform: translateY(-25px) translateX(15px)  scale(1.2); }
  50%      { transform: translateY(-15px) translateX(-15px) scale(0.8); }
  75%      { transform: translateY(-35px) translateX(10px)  scale(1.1); }
}

/* Header do card */
.indicator-card__header {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}
.indicator-card__eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.indicator-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-primary);
  line-height: 1.4;
  margin: 0 0 6px;
}
.indicator-card__desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.indicator-card__period {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-action);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 8px;
}

/* Bloco numérico (alguns indicadores podem usar quando não couber gauge) */
.indicator-card__numeric {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 12px;
  min-height: 100px;
}
.indicator-card__numeric-value {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.indicator-card__numeric-unit {
  font-size: 22px;
  font-weight: 700;
  opacity: 0.5;
  margin-left: 2px;
}

/* Gauge container + glow + svg + número */
.indicator-card__gauge-container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 12px;
}
.indicator-card__gauge-wrap {
  position: relative;
  width: 160px;
  height: 100px;
}
.indicator-card__gauge-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 110%;
  height: 110%;
  transform: translate(-50%, -10%);
  border-radius: 50%;
  opacity: 0.22;
  filter: blur(24px);
  animation: indicator-card-pulse-glow 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes indicator-card-pulse-glow {
  0%, 100% { opacity: 0.12; transform: translate(-50%, -10%) scale(0.95); }
  50%      { opacity: 0.30; transform: translate(-50%, -10%) scale(1.05); }
}
.indicator-card__gauge-svg { overflow: visible; }
.indicator-card__gauge-bg {
  stroke: var(--bg-sunken);
  stroke-width: 14;
  stroke-linecap: round;
}
.indicator-card__gauge-fill {
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 2.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.indicator-card__gauge-value {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 44px;
  font-weight: 900;
  color: var(--fg-primary);
  letter-spacing: -2px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-variant-numeric: tabular-nums;
  text-align: center;
  width: 100%;
  line-height: 1;
}
.indicator-card__gauge-unit {
  font-size: 20px;
  font-weight: 700;
  opacity: 0.4;
  margin-left: 2px;
}

/* Gauge duplo (M1 — EMULTI A + B lado a lado) */
.indicator-card__gauge-container--duplo {
  gap: 12px;
  flex-wrap: wrap;
}
.indicator-card__gauge-wrap--duplo {
  width: 130px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 32px;
}
.indicator-card__gauge-wrap--duplo .indicator-card__gauge-value {
  bottom: 30px;
}
.indicator-card__gauge-equipe-label {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.indicator-card__gauge-equipe-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-secondary);
  opacity: 0.85;
}

/* Footer do card */
.indicator-card__footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
}
.indicator-card__meta {
  font-size: 13px;
  margin-bottom: 8px;
}
.indicator-card__meta-num {
  font-weight: 700;
  color: var(--fg-primary);
}
.indicator-card__meta-label {
  color: var(--fg-muted);
  margin-left: 4px;
}
.indicator-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.indicator-card__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 10px;
  color: var(--fg-muted);
}
.indicator-card__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.indicator-card__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Em breve */
.indicator-card--breve {
  cursor: not-allowed;
  opacity: 0.55;
  border-style: dashed;
  min-height: 200px;
}
.indicator-card--breve:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-default);
}
.indicator-card__breve-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  border: 1px solid var(--border-default);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
  margin-top: auto;
}

@media (prefers-reduced-motion: reduce) {
  .indicator-card,
  .indicator-card__particle,
  .indicator-card__gauge-glow,
  .indicator-card__gauge-fill {
    animation: none !important;
    transition: none !important;
  }
  .indicator-card:hover {
    transform: none;
  }
}

/* Modo quadrimestral — banner global e badge por card incompleto */
.parcial-banner {
  font-size: 13px;
  font-weight: 600;
  color: #C46500;
  background: rgba(196, 101, 0, 0.1);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(196, 101, 0, 0.25);
}
.indicator-card__incomplete {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #C46500;
}
