/* ======= VARIÁVEIS GLOBAIS ======= */
:root {
  --primary-color: #3fa9f5;
  --accent-color: #ffb300;
  --bg-dark: rgba(0, 0, 40, 0.6);
  --card-bg: rgba(0, 30, 70, 0.7);
  --highlight-color: #ffb300;
  --fade-speed: 0.8s;
}

/* ======= IMPORT FONTS ======= */
@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600&display=swap");

/* ======= GLOBAL ======= */
body {
  font-family: "Rajdhani", sans-serif;
  color: #fff;
  margin: 0;
  padding: 0;
  background-color: #000;
  background-image: url("https://images.unsplash.com/photo-1462331940025-496dfbfc7564?auto=format&fit=crop&q=80");
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity var(--fade-speed) ease;
  overflow-x: hidden;
}

body.fade-in {
  opacity: 1;
}
body.fade-out {
  opacity: 0;
}

.stats,
.card,
.chart,
.planet-card,
.upload-box {
  transition: transform 0.5s ease, opacity 0.5s ease;
}
body.fade-out .stats,
body.fade-out .card,
body.fade-out .chart,
body.fade-out .planet-card,
body.fade-out .upload-box {
  opacity: 0;
  transform: translateY(20px);
}

/* ======= HEADER ======= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 20, 0.8);
  backdrop-filter: blur(6px);
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  box-sizing: border-box;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo h1 {
  font-size: 1.6rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.logo span {
  color: var(--accent-color);
}

.planet-icon {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-color), #994500);
  box-shadow: 0 0 8px var(--accent-color) aa;
}

/* ======= NAVIGATION MENU ======= */
.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #2a3a70, #3fa9f5);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.nav-menu a:hover {
  background: linear-gradient(145deg, #3fa9f5, #5ac1ff);
  transform: scale(1.05);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.6);
}

/* ======= DASHBOARD ======= */
.container {
  display: flex;
  flex-direction: column;
  align-items: center; /* centraliza horizontalmente */
  justify-content: flex-start; /* ou center, se quiser centralizar vertical */
  padding: 2rem; /* espaço para header fixo */
  width: 100%;
  min-height: 100vh; /* garante altura mínima para centralização vertical */
  box-sizing: border-box;
}

/* ======= CONTAINER PRINCIPAL ======= */
.dashboard-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  width: 100%;
  max-width: 700px;
  padding: 2rem;
  box-sizing: border-box;
  background: rgba(0, 0, 20, 0.3);
  border-radius: 15px;
  margin: 0 auto;
}

/* Cada bloco de gráfico + cards */
.graph-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* espaço entre título, gráfico e cards */
  width: 100%;
  max-width: 650px;
}

.graph-block .chart {
  margin-bottom: 2rem; /* ajuste conforme necessário */
}

.graph-block .cards-block {
  margin-top: 1rem; /* mantém os cards logo abaixo do gráfico sem sobrepor */
  width: 100%;
}

/* Espaçamento extra apenas para o último card do segundo gráfico */
.graph-block .cards-block .card:last-child {
  margin-bottom: 2rem; /* ajuste conforme necessário */
}

/* Bloco de cards */
.cards-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
}

/* Remove espaçamento extra se necessário */
.cards-block.no-gap {
  gap: 0;
}

/* Cada card */
.card {
  background: var(--card-bg);
  padding: 0.8rem;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card.text-card {
  padding: 1rem;
  font-size: 1.1rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
}

.link-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}
.link-card a:hover {
  color: #1c7bd9;
}

.highlight {
  color: var(--highlight-color);
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}
.card:hover .highlight {
  color: #fff;
}

/* ======= CHARTS ======= */
.chart {
  width: 90%;
  max-width: 600px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  margin-bottom: 1rem;
}
.chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.note {
  margin-top: -3rem; /* distância acima do texto */
  margin-bottom: 1rem; /* distância abaixo do texto */
  color: #fff;
  text-align: center;
}

/* ======= BUTTON ======= */
.download-btn {
  background: var(--primary-color);
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  margin-top: -2rem; /* ajusta a posição do botão */
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.download-btn:hover {
  background: #1c7bd9;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* ======= PLANET PAGE ======= */
.planet-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 2rem 4rem;
  min-height: 90vh;
  flex-wrap: wrap;
  gap: 2rem;
}

.planet-card {
  background: linear-gradient(145deg, rgba(0, 0, 50, 0.7), rgba(0, 0, 70, 0.8));
  border-radius: 25px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), 0 0 20px;
  backdrop-filter: blur(8px);
  max-width: 800px;
  width: 90%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.planet-info {
  text-align: center;
  flex: 1;
}

.planet-img {
  width: 140px;
  border-radius: 50%;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(63, 169, 245, 0.6), 0 0 10px rgba(42, 58, 112, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.planet-img:hover {
  transform: rotate(10deg) scale(1.1);
  box-shadow: 0 0 30px rgba(63, 169, 245, 0.8), 0 0 15px rgba(42, 58, 112, 0.5);
}

.arrow {
  background: linear-gradient(145deg, #2a3a70, #3fa9f5);
  border-radius: 50%;
  color: #fff;
  border: none;
  font-size: 2rem;
  width: 3.5rem; /* largura fixa */
  height: 3.5rem; /* altura igual à largura */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 8px rgba(63, 169, 245, 0.6);
  transition: all 0.3s ease;
}

.arrow:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(63, 169, 245, 0.8);
  background: linear-gradient(145deg, #3fa9f5, #5ac1ff);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background: rgba(0, 0, 40, 0.7);
  border-radius: 15px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.95rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  text-align: center;
  font-weight: 500;
  color: #e0e0e0;
}

#flash {
  width: 100%;
  text-align: center;
  color: var(--accent-color);
  font-weight: 700;
  margin-top: 1rem;
  animation: flash 1s infinite alternate;
}

@keyframes flash {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

/* ===== CONTAINER DE UPLOAD ===== */
.upload-container {
  width: 90%;
  max-width: 600px;
  margin: 5rem auto 3rem;
  background: linear-gradient(
    145deg,
    rgba(0, 0, 60, 0.85),
    rgba(0, 0, 80, 0.75)
  );
  border-radius: 18px;
  padding: 2.5rem;
  color: #fff;
  text-align: center;
  font-family: "Rajdhani", sans-serif;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 25px rgba(63, 169, 245, 0.25);
  animation: zoomFadeIn 0.8s ease forwards;
}

/* ===== TÍTULO ===== */
.upload-container h2 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
  font-weight: 700;
  color: #ffb300;
  text-shadow: 0 0 10px rgba(255, 179, 0, 0.4);
}

/* ===== TEXTO ===== */
.upload-container p {
  font-size: 1rem;
  color: #f5f5f5;
  margin: 1rem 0 2rem;
  line-height: 1.5;
}
.upload-container p a {
  color: #3fa9f5;
  text-decoration: none;
  font-weight: 700;
}
.upload-container p a:hover {
  text-decoration: underline;
}

/* ===== BOTÕES ===== */
.upload-btn,
.save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(63, 169, 245, 0.4);
  font-size: 1.1rem;
}

.upload-btn {
  background: linear-gradient(145deg, #2a3a70, #3fa9f5);
  color: #fff;
}
.upload-btn:hover {
  background: linear-gradient(145deg, #3fa9f5, #5ac1ff);
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(63, 169, 245, 0.6);
}

.save-btn {
  background: linear-gradient(145deg, #3fa9f5, #5ac1ff);
  color: #fff;
  margin-top: 1.5rem;
}
.save-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(63, 169, 245, 0.6);
  background: linear-gradient(145deg, #5ac1ff, #7fd2ff);
}

/* ===== ÍCONES ===== */
.icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.file-name {
  margin-top: 1rem;
  font-size: 1rem;
  color: #ccc;
  font-style: italic;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* ===== ANIMAÇÃO DE ENTRADA ===== */
@keyframes zoomFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== FADE ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-out {
  animation: fadeOut 0.6s ease forwards;
}

/* ======= RESPONSIVE ======= */
@media (max-width: 600px) {
  /* ===== HEADER ===== */
  .header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
    padding: 1rem;
  }

  .logo {
    justify-content: center;
  }

  .nav-menu {
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
  }

  .nav-menu a {
    display: block;
    width: 80%;
    text-align: center;
  }

  /* ===== DASHBOARD ===== */
  .container {
    padding-top: 1rem;
  }

  .graph-block {
    gap: 2rem; /* aumentamos o espaçamento entre elementos do gráfico */
    margin-bottom: -1rem; /* mais respiro entre cada gráfico e seus cards */
  }

  .dashboard-container {
    width: 90%;
    padding: 1rem;
    margin: 2rem auto;
  }

  .stats {
    width: 90%;
  }

  .card,
  .chart {
    width: 90%;
    max-width: 400px;
  }

  /* ===== PLANET CARD ===== */
  .planet-card {
    flex-direction: column;
    padding: 1.2rem; /* diminuiu o padding interno */
    gap: 0.8rem;
    width: 95%;
  }

  .planet-info {
    width: 100%;
    text-align: center;
  }

  .planet-img {
    width: 120px;
    margin-bottom: 0.8rem; /* menor espaço abaixo da imagem */
  }

  .arrow {
    font-size: 1.8rem;
    padding: 0.5rem 0.8rem;
    margin: 0.2rem 0; /* diminuiu o espaçamento entre elementos */
  }

  .data-table {
    font-size: 0.85rem;
    margin-top: 0.8rem; /* diminuiu espaço acima da tabela */
  }

  .data-table th,
  .data-table td {
    padding: 0.4rem 0.6rem;
  }

  .upload-container {
    width: 90%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 1.5rem;
    text-align: center;
    border-radius: 15px;
    background: rgba(0, 0, 40, 0.8);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  }

  .upload-container h2 {
    font-size: 1.4rem;
  }

  .upload-container p {
    font-size: 0.95rem;
    line-height: 1.4;
  }
}
