:root {
  --bg: #121212;
  --bg-secondary: #1a1a1a;
  --card: #1f1f1f;
  --card-hover: #2a2a2a;
  --border: #333333;
  --text: #e8eef7; /* Alto Contraste */
  --text-muted: #9ba3bf; /* Cor clara para leitura em BG escuro */
  --accent: #00f5ff;
  --accent-secondary: #bd00ff;
  --green: #00ff88;
  --red: #ff4d6e;
  --yellow: #ffb800;
  --blue: #00a8ff;
  --purple: #a855f7;
  --orange: #ff6b35;
  
  /* Cores para Skeleton Loading */
  --skeleton-base: #1a1a1a;
  --skeleton-highlight: #2c2c2c;
}

/* ************************************************* */
/* KEYFRAMES E ANIMAÇÕES */
/* ************************************************* */

/* 1. Animação de Entrada (Fade + Slide) */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3. Animação de pulso para skeleton loading */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}


* { margin:0; padding:0; box-sizing:border-box; }

body { 
  font-family: 'Inter', sans-serif; 
  background: var(--bg);
  color: var(--text); 
  min-height: 100vh;
  position: relative;
  font-size: 1.05rem;
  line-height: 1.65;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(0, 245, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(189, 0, 255, 0.05) 0%, transparent 50%),
    repeating-linear-gradient(0deg, var(--bg-secondary) 0, var(--bg-secondary) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, var(--bg-secondary) 0, var(--bg-secondary) 1px, transparent 1px, transparent 40px);
  pointer-events: none;
  z-index: 0;
}

/* ************************************************* */
/* NAVEGAÇÃO E MICROINTERAÇÕES (Touch Target Mínimo) */
/* ************************************************* */
nav {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(13,17,23,0.95); backdrop-filter: blur(20px);
  border: 1px solid var(--accent);
  border-radius: 16px; padding: 10px 20px;
  z-index: 1000; display: flex; gap: 10px; font-weight: 600;
  box-shadow: 0 0 20px rgba(0,245,255,0.4);
}

nav button { 
  background: transparent; 
  border: none; 
  color: var(--text-muted); 
  padding: 8px 16px; 
  border-radius: 10px; 
  cursor: pointer; 
  /* Transição e Microinteração */
  transition: 0.3s ease; 
  min-height: 44px; /* Touch Target Mínimo */
  min-width: 44px; /* Touch Target Mínimo */
}

nav button:hover { 
  background: rgba(0,245,255,0.1); 
  color: var(--accent); 
}

/* Microinteração de clique */
nav button:active {
  transform: scale(0.95); 
}

nav button.active { 
  background: var(--accent); 
  color: #000; 
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0,245,255,0.5);
}

/* Aplicação da Animação de Entrada ao Hero */
.hero { 
  text-align: center; 
  padding: 160px 20px 60px; 
  animation: fadeInSlideUp 0.6s ease-out backwards;
  animation-delay: 0.1s;
}
.hero h1 { 
  font-family: 'Space Grotesk', sans-serif; 
  font-size: clamp(4rem, 12vw, 9rem); 
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary)); 
  -webkit-background-clip: text; 
  background-clip: text; 
  -webkit-text-fill-color: transparent; 
}
.subtitle { 
  font-size: 1.6rem; 
  color: var(--text-muted); 
  max-width: 900px; 
  margin: 20px auto; 
}
.by { 
  font-size: 1.2rem; 
  margin-top: 30px; 
  color: var(--text-muted); 
}
.by span { 
  color: var(--accent); 
  font-weight: 700; 
}

.container { 
  max-width: 1400px; 
  margin: 0 auto; 
  padding: 0 24px; 
  position: relative; 
  z-index: 1; 
}

/* ************************************************* */
/* BREADCRUMBS (Quick Win) */
/* ************************************************* */
.breadcrumbs {
    margin: 20px 0 30px;
    font-size: 0.95rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    text-align: left;
    animation: fadeInSlideUp 0.6s ease-out backwards;
    animation-delay: 0.2s;
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--text);
}

.breadcrumbs span {
    margin: 0 8px;
}

/* Aplicação da Animação de Entrada à About Section */
.about-section {
  background: var(--bg-secondary);
  border: 2px solid rgba(0, 245, 255, 0.2);
  border-radius: 24px;
  padding: 48px;
  margin: 50px 0;
  position: relative;
  overflow: hidden;
  animation: fadeInSlideUp 0.6s ease-out backwards;
  animation-delay: 0.3s;
}

.about-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.8rem;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  z-index: 1;
  letter-spacing: -0.05em;
}

.about-section p {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

.about-section p strong {
  color: var(--accent);
  font-weight: 700;
}

/* Aplicação da Animação de Entrada à Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin: 36px 0;
  animation: fadeInSlideUp 0.6s ease-out backwards;
  animation-delay: 0.4s;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 245, 255, 0.2);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--accent);
}

.feature-card p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); 
  gap: 30px; 
  margin-top: 50px; 
  margin-bottom: 80px; 
}

.card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  cursor: pointer;
  /* Transição mais suave e microinteração */
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  /* Aplicação da Animação de Entrada */
  animation: fadeInSlideUp 0.6s ease-out backwards;
}

/* Staggering para os cards (ajustar os delays conforme a ordem no HTML) */
.grid .card:nth-child(1) { animation-delay: 0.5s; }
.grid .card:nth-child(2) { animation-delay: 0.6s; }
.grid .card:nth-child(3) { animation-delay: 0.7s; }
.grid .card:nth-child(4) { animation-delay: 0.8s; }

/* ************************************************* */
/* FEATURED CARD STYLE (Prioridade para PIB, IPCA, Selic) */
/* ************************************************* */
.card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 50px rgba(0, 245, 255, 0.5);
  transform: scale(1.02);
  z-index: 2;
  /* Garante que o card em destaque apareça antes */
  animation-delay: 0.4s !important; 
}

.card.featured::before {
  height: 8px; /* Linha de destaque mais proeminente */
  opacity: 1;
}

.card.featured:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 20px 50px rgba(0, 245, 255, 0.4), 0 0 0 2px var(--accent) inset;
}
/* ************************************************* */
/* FIM FEATURED CARD STYLE */
/* ************************************************* */


.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  opacity: 0;
  transition: 0.5s;
}

.card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 245, 255, 0.1) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: var(--accent);
  box-shadow: 
    0 15px 40px rgba(0, 245, 255, 0.2),
    0 0 0 1px rgba(0, 245, 255, 0.1) inset;
}

.card:hover::before {
  opacity: 1;
}

.card:hover::after {
  width: 250px;
  height: 250px;
}

.card h3 { 
  font-family: 'Space Grotesk', sans-serif; 
  font-size: 1.6rem; 
  margin: 16px 0 8px 0; 
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text; 
  background-clip: text; 
  -webkit-text-fill-color: transparent; 
  position: relative;
  z-index: 1;
}

.value { 
  font-size: 3.2rem; 
  font-weight: 800; 
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, #fff, var(--text));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 16px 0;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.var { 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  padding: 8px 16px;
  border-radius: 12px; 
  font-weight: 700; 
  margin-top: 12px;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
  /* Garante o emoji não cortado e o touch target */
  min-height: 36px;
}

.up { 
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.1));
  color: var(--green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.down { 
  background: linear-gradient(135deg, rgba(255, 77, 110, 0.2), rgba(255, 77, 110, 0.1));
  color: var(--red);
  border: 1px solid rgba(255, 77, 110, 0.3);
}

.btn-back { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 14px 28px; border-radius: 14px; cursor: pointer; font-size: 1rem; margin: 40px 0; display: inline-block; transition: 0.3s; }
.btn-back:hover { background: var(--accent); color: #000; }

.explicacao { 
    background: var(--bg-secondary); 
    border: 1px solid var(--border); 
    border-radius: 20px; 
    padding: 32px; 
    margin: 30px 0; 
    line-height: 1.8; 
    font-size: 1.1rem; 
    color: var(--text-muted); 
    animation: fadeInSlideUp 0.6s ease-out backwards;
    animation-delay: 0.9s;
}

/* ************************************************* */
/* NOVO: Classe para o Container de Informações */
/* ************************************************* */
.info-container {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    width: 100%;
    max-width: 1000px;
}


/* ************************************************* */
/* TOOLTIP (Quick Win) */
/* ************************************************* */
.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    background-color: var(--skeleton-highlight);
    color: var(--text);
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 2000;
    bottom: 125%; 
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0s;
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid var(--accent);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    pointer-events: none; /* Não interfere no clique */
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ************************************************* */
/* SKELETON LOADING (Quick Win - Skeleton Screens) */
/* ************************************************* */
.loading { 
  text-align: center; 
  padding: 120px; 
  color: var(--text-muted); 
  font-size: 1.4rem; 
}

.skeleton {
  pointer-events: none;
  background-color: var(--skeleton-base);
  /* Efeito Shimmer */
  background-image: linear-gradient(90deg, var(--skeleton-base) 0px, var(--skeleton-highlight) 40px, var(--skeleton-base) 80px);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: skeleton-loading 1.5s infinite linear;
  border-radius: 8px;
  opacity: 0.8;
}

.skeleton-text {
  height: 1.2em;
  width: 100%;
  margin-bottom: 0.5em;
  border-radius: 4px;
}

.skeleton-text-short {
  width: 60%;
}

.skeleton-text-large {
  height: 2.5em;
  margin: 10px 0;
}

.skeleton-box {
  height: 150px;
  width: 100%;
  margin-bottom: 20px;
}

.skeleton-card {
  height: 250px;
  padding: 36px;
  border-radius: 24px;
  background-color: var(--card); /* Base para o skeleton card */
  border: 2px solid var(--border);
}

/* ************************************************* */
/* REGRAS PARA ALINHAMENTO DA PÁGINA CATEGORIA (AJUSTADAS) */
/* ************************************************* */

/* 1. Alinha o H1, H2 e o series-grid ao centro */
#category-content {
    display: flex;
    flex-direction: column;
    align-items: center; 
    padding-bottom: 50px; 
    animation: fadeInSlideUp 0.6s ease-out backwards;
    animation-delay: 0.2s;
}

/* 2. Garante que os títulos sejam centralizados */
#category-content > h1 {
  text-align: center;
}

/* 3. Centraliza o conteúdo dentro dos cards da série */
.series-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 4. Corrige a simetria do grid */
.series-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
  gap: 24px; 
  margin: 50px 0;
  width: 100%; 
  max-width: 1000px; 
}

/* 5. Estilização do quadro de valor principal (mais compacto e elegante) */
.main-indicator-box {
    background: var(--bg-secondary); 
    border: 2px solid var(--border); 
    border-radius: 20px; 
    padding: 25px 30px; 
    margin: 30px 0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
    max-width: 800px; 
    /* Aplicação da Animação de Entrada */
    animation: fadeInSlideUp 0.6s ease-out backwards;
    animation-delay: 0.5s;
}

.main-indicator-value-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.main-indicator-value {
    font-size: 3.8rem !important; 
    font-weight: 900; 
    font-family:'Space Grotesk'; 
    letter-spacing:-0.03em;
    margin-top: 5px; 
    line-height: 1; 
}

.main-indicator-value-label {
    font-size: 1.1rem; 
    color: var(--text-muted); 
    margin-bottom: 5px; 
    line-height: 1.2; 
}

/* NOVO: Estilização do STATUS (Status tags corrigidos para emoji não cortado) */
.main-indicator-box .status-tag {
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    border-radius: 10px; /* Borda mais suave */
    padding: 8px 14px; 
    font-weight: 700; 
    font-size: 1rem; 
    line-height: 1.2; 
    white-space: nowrap; 
    /* Garante o touch target e evita corte de conteúdo */
    min-height: 44px; 
}

.main-indicator-box .status-tag.positive {
    background: var(--green)20; 
    color: var(--green);
    border: 1px solid var(--green);
}

.main-indicator-box .status-tag.negative {
    background: var(--red)20;
    color: var(--red);
    border: 1px solid var(--red);
}

.main-indicator-box .status-tag.stable {
    background: var(--text-muted)20;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}


.hidden { display: none; }


.ia-analysis { 
    background: #000000;
    border: 2px solid #333; 
    border-radius: 16px; 
    padding: 30px; 
    margin: 30px auto; 
    line-height: 1.7; 
    font-size: 1.05rem; 
    color: var(--text); 
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.1);
    width: 100%;
    max-width: 900px; 
    /* Adiciona um efeito de data/glitch */
    position: relative;
    overflow: hidden;
    animation: fadeInSlideUp 0.6s ease-out backwards;
    animation-delay: 1.0s;
}

/* Pseudo-elemento para o efeito glitch/data */
.ia-analysis::after {
    content: '010101001001010101001001010101001001010101001001010101001001';
    position: absolute;
    top: 5px;
    right: 5px;
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
    transform: rotate(5deg);
}

.ia-analysis h3 {
    padding-bottom: 15px; 
    margin-bottom: 20px;
    border-bottom: 1px solid #333; 
    position: relative; 
    z-index: 1;
}

.ia-context-box {
    background: rgba(0, 212, 255, 0.05);
    border-left: 4px solid var(--cat-color);
    padding: 18px; 
    margin: 20px 0; 
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.6; 
    position: relative;
    z-index: 1;
}

#bigchart { 
  margin-top: 40px; 
  max-height: 400px !important; 
  height: 400px !important;
  width: 100%; 
  max-width: 1000px;
  animation: fadeInSlideUp 0.6s ease-out backwards;
  animation-delay: 1.1s;
}

/* ************************************************* */
/* NOVO: ESTILOS DO RODAPÉ */
/* ************************************************* */

.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.main-footer .ia-attribution {
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.6;
    margin-top: 5px;
}

/* ************************************************* */
/* REGRAS DE RESPONSIVIDADE (MOBILE-FIRST UX) */
/* ************************************************* */

@media (max-width: 768px) {
    /* 1. Ajuste do corpo para compensar a navegação */
    body {
        /* Adiciona padding no topo para o conteúdo não ficar escondido pela nav */
        padding-top: 80px; 
        font-size: 1rem;
    }

    /* 2. Transformar a navegação em uma barra de rolagem horizontal */
    nav {
        left: 0;
        transform: none;
        width: 100%;
        top: 0; 
        padding: 8px 10px;
        border-radius: 0;
        overflow-x: auto; 
        overflow-y: hidden;
        white-space: nowrap; 
        justify-content: flex-start; 
        border-top: none; 
        border-left: none; 
        border-right: none;
        border-bottom: 1px solid var(--accent); 
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); 
        gap: 8px;
    }
    
    /* 3. Ajuste do Hero Section */
    .hero {
        padding: 100px 20px 40px; 
    }
    .hero h1 {
        font-size: clamp(3rem, 10vw, 9rem);
    }
    .subtitle {
        font-size: 1.2rem;
    }

    /* 4. Padding geral do Container */
    .container {
        padding: 0 15px; 
    }
    
    /* 5. Ajustes na seção de conteúdo principal */
    .about-section {
        padding: 30px 20px; 
        margin: 30px 0;
    }
    
    .grid {
        grid-template-columns: 1fr; 
        gap: 20px; 
        margin-top: 30px;
    }

    /* 6. Ajuste da análise e explicações */
    .ia-analysis, .explicacao, .impacto {
        padding: 20px;
        font-size: 1rem;
    }
    
    #category-content > div:nth-child(3) {
        flex-direction: column;
        gap: 20px !important;
    }

    /* NOVO: Ajuste do container de Informações para Mobile */
    .info-container {
        flex-direction: column;
    }
    
    /* 7. Alinhamento da Categoria */
    .series-grid {
        grid-template-columns: 1fr; 
        max-width: none;
    }
    
    /* 8. Ajuste do indicador principal (main-indicator-box) */
    .main-indicator-box {
        flex-direction: column; 
        align-items: center; 
        padding: 20px;
        max-width: 100%;
    }
    
    .main-indicator-value-group {
        align-items: center; 
    }
    
    .main-indicator-value-label {
        text-align: center;
    }
    
    .main-indicator-box .status-tag {
        margin-top: 15px;
    }
    
    .main-indicator-box > div:last-child {
        text-align: center !important; 
    }
}
