/* ========================================
   SISTEMA DE CORES POR TIER - PREMIUM
   ======================================== */

:root {
  /* Classe S - Vermelho Elite (Gradiente escuro → vibrante) */
  --tier-s-primary: #dc2626;
  --tier-s-secondary: #991b1b;
  --tier-s-gradient: linear-gradient(135deg, #7f1d1d 0%, #dc2626 50%, #ef4444 100%);
  --tier-s-glow: rgba(220, 38, 38, 0.4);
  --tier-s-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);

  /* Classe A - Azul Intenso */
  --tier-a-primary: #2563eb;
  --tier-a-secondary: #1e40af;
  --tier-a-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  --tier-a-glow: rgba(37, 99, 235, 0.4);
  --tier-a-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);

  /* Classe B - Dourado/Amarelo */
  --tier-b-primary: #f59e0b;
  --tier-b-secondary: #d97706;
  --tier-b-gradient: linear-gradient(135deg, #92400e 0%, #f59e0b 50%, #fbbf24 100%);
  --tier-b-glow: rgba(245, 158, 11, 0.4);
  --tier-b-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);

  /* Classe C - Verde */
  --tier-c-primary: #10b981;
  --tier-c-secondary: #059669;
  --tier-c-gradient: linear-gradient(135deg, #065f46 0%, #10b981 50%, #34d399 100%);
  --tier-c-glow: rgba(16, 185, 129, 0.4);
  --tier-c-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

/* ========================================
   ANIMAÇÕES PREMIUM - GRÁFICOS
   ======================================== */

/* Fade In + Slide Up (Entrada de Gráficos) */
@keyframes chart-fade-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-chart-fade-in {
  animation: chart-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ========================================
   GRÁFICO DE COLUNAS - ANIMAÇÕES
   ======================================== */

/* Crescimento Progressivo das Barras */
@keyframes bar-grow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

.animate-bar-grow {
  animation: bar-grow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: bottom;
}

/* Hover nas Colunas */
.chart-bar-hover {
  transition: transform 0.22s ease-out, filter 0.22s ease-out, opacity 0.18s ease-out;
  cursor: pointer;
}

.chart-bar-hover:hover {
  opacity: 1 !important;
  filter: brightness(1.12) drop-shadow(0 0 6px currentColor);
  transform: scaleY(1.02) !important;
}

/* ========================================
   GRÁFICO DE BARRAS HORIZONTAIS
   ======================================== */

/* Crescimento Horizontal */
@keyframes horizontal-bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.animate-horizontal-bar-grow {
  animation: horizontal-bar-grow 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: left;
}

/* Hover nas Barras */
.progress-bar-hover {
  transition: transform 0.22s ease-out, filter 0.22s ease-out, opacity 0.18s ease-out;
  cursor: pointer;
}

.progress-bar-hover:hover {
  opacity: 1 !important;
  filter: brightness(1.15) drop-shadow(0 0 6px currentColor);
  transform: scaleX(1.02) scaleY(1.1) !important;
}

/* ========================================
   GRÁFICO DE PIZZA - ANIMAÇÕES
   ======================================== */

/* Animação Radial (Desenho do Círculo) */
@keyframes pie-slice {
  from {
    stroke-dashoffset: 290; /* Circumferência aproximada */
  }
  to {
    stroke-dashoffset: var(--final-offset, 0);
  }
}

.animate-pie-slice {
  animation: pie-slice 1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Hover nos Setores da Pizza */
.chart-slice-hover {
  transition: transform 0.22s ease-out, filter 0.22s ease-out, opacity 0.18s ease-out;
  cursor: pointer;
}

.chart-slice-hover:hover {
  filter: brightness(1.18) drop-shadow(0 0 10px currentColor);
  stroke-width: 21 !important;
}

/* ========================================
   GRÁFICO RADAR - ANIMAÇÕES
   ======================================== */

/* Desenho da Linha (Path Drawing) */
@keyframes line-draw {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.animate-line-draw {
  animation: line-draw 1.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Preenchimento da Área */
@keyframes area-fill {
  from {
    transform: scale(0.7);
  }
  to {
    opacity: 0.18;
    transform: scale(1);
  }
}

.animate-area-fill {
  animation: area-fill 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
  opacity: 0.18;
  transform-origin: center;
}

/* ========================================
   TABELAS - MELHORIAS
   ======================================== */

/* Animação de Entrada das Linhas */
@keyframes table-row-fade-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-table-row {
  animation: table-row-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* Alinhamento vertical correto para células */
.table-row-hover td {
  vertical-align: middle;
}

/* Hover Premium nas Linhas */
.table-row-hover {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.table-row-hover:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: inset 3px 0 0 var(--row-accent-color, #10b981);
}

.table-row-hover:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--row-accent-color, #10b981);
  box-shadow: 0 0 12px var(--row-accent-color, #10b981);
}

/* ========================================
   TIPOGRAFIA - LEGIBILIDADE
   ======================================== */

/* Números Grandes (Estatísticas) */
.stat-number {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Títulos de Gráficos */
.chart-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* Labels de Gráficos */
.chart-label {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  vertical-align: middle;
}

/* Valores nos Gráficos */
.chart-value {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

/* ========================================
   TOOLTIP - HOVER INFORMATIVO
   ======================================== */

@keyframes tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chart-tooltip {
  animation: tooltip-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

/* ========================================
   ESPAÇAMENTO E RESPIRAÇÃO
   ======================================== */

.chart-container {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

/* Margem adequada entre elementos */
.chart-spacing {
  margin-bottom: 1.5rem;
}

/* ========================================
   CORES ESPECÍFICAS POR TIER (CLASSES UTILITÁRIAS)
   ======================================== */

.tier-s-color { color: var(--tier-s-primary); }
.tier-a-color { color: var(--tier-a-primary); }
.tier-b-color { color: var(--tier-b-primary); }
.tier-c-color { color: var(--tier-c-primary); }

.tier-s-bg { background: var(--tier-s-gradient); }
.tier-a-bg { background: var(--tier-a-gradient); }
.tier-b-bg { background: var(--tier-b-gradient); }
.tier-c-bg { background: var(--tier-c-gradient); }

.tier-s-border { border-color: var(--tier-s-primary); }
.tier-a-border { border-color: var(--tier-a-primary); }
.tier-b-border { border-color: var(--tier-b-primary); }
.tier-c-border { border-color: var(--tier-c-primary); }

.tier-s-shadow { box-shadow: var(--tier-s-shadow); }
.tier-a-shadow { box-shadow: var(--tier-a-shadow); }
.tier-b-shadow { box-shadow: var(--tier-b-shadow); }
.tier-c-shadow { box-shadow: var(--tier-c-shadow); }

/* ========================================
   EFEITO GLASS MORPHISM (MODERN)
   ======================================== */

.glass-panel {
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ========================================
   MELHORIAS DE ALINHAMENTO
   ======================================== */

/* Garantir alinhamento vertical consistente */
table th,
table td {
  vertical-align: middle !important;
}

/* Textos pequenos com alinhamento correto */
[class*="text-[10px]"],
[class*="text-[11px]"],
.text-xs {
  vertical-align: middle;
  line-height: 1.5;
}

/* Flex items sempre centralizados */
.flex.items-center {
  align-items: center !important;
}

/* Inline flex com alinhamento correto */
.inline-flex.items-center {
  display: inline-flex !important;
  align-items: center !important;
}

/* ========================================
   MELHORIAS VISUAIS - CARDS E CONTAINERS
   ======================================== */

/* Cards com hover elegante */
.rounded-2xl,
.rounded-xl {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rounded-2xl:hover,
.rounded-xl:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Botões com efeito ripple */
button,
.upload-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover,
.upload-button:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

button:active,
.upload-button:active {
  transform: scale(0.98);
}

/* Inputs com foco aprimorado */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  transform: scale(1.01);
  transition: all 0.2s;
}

/* Scroll suave */
html {
  scroll-behavior: smooth;
}

/* Seleção de texto estilizada */
::selection {
  background: rgba(16, 185, 129, 0.3);
  color: white;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 768px) {
  .chart-title {
    font-size: 0.875rem;
    letter-spacing: 0.03em;
  }

  .chart-label {
    font-size: 0.75rem;
  }

  .chart-value {
    font-size: 0.875rem;
  }
}
