:root {
  --primary-color: #055a71;
  --secondary-color: #24cec5;
  --accent-color: #178f96;
  --light-color: #1da0a5;
  --extra-light: #23adac;
  --text-color: #333;
  --light-text: #777;
  --bg-color: #f9f9f9;
  --card-bg: #fff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.header {
  display: flex;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.logo {
  height: 60px;
}

.header h1 {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.8rem;
}

.content {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

h2, h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.2rem;
}

.input-section {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary-color);
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group input:focus {
  border-color: var(--secondary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 206, 197, 0.2);
}

.exam-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 15px;
  margin: 20px 0;
}

.exam-table th {
  text-align: left;
  padding: 0 15px 10px 0;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 1rem;
}

.exam-table td {
  padding: 0 15px 0 0;
}

.exam-table input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: all 0.3s;
}

.exam-table input:focus {
  border-color: var(--secondary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 206, 197, 0.2);
}

.custom-years {
  margin: 30px 0;
}

.custom-years label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--primary-color);
  font-size: 1rem;
}

.custom-years input {
  width: 100%;
  max-width: 250px;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 150px;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: #e0e0e0;
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: #d0d0d0;
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.results-section {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  display: none;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.result-card {
  background-color: var(--extra-light);
  padding: 20px;
  border-radius: 8px;
  color: white;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.result-card h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 500;
}

.result-value {
  font-size: 1.4rem;
  font-weight: 600;
}

.charts-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.chart-wrapper {
  background-color: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  height: 400px;
  width: 100%;
  position: relative;
}

.chart-wrapper h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.2rem;
  text-align: center;
}

.report-actions {
  text-align: center;
  margin-top: 30px;
}

.footer {
  text-align: center;
  padding: 30px 0;
  margin-top: 50px;
  color: white;
  font-size: 0.9rem;
  background-color: var(--primary-color);
  width: 100%;
}

.footer p:first-child {
  margin-bottom: 10px;
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 992px) {
  .container {
    padding: 15px;
  }
  
  .input-section, .results-section {
    padding: 25px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
  
  .logo {
    margin: 0 auto;
  }
  
  .exam-table {
    display: block;
  }
  
  .exam-table thead {
    display: none;
  }
  
  .exam-table tbody, .exam-table tr, .exam-table td {
    display: block;
    width: 100%;
  }
  
  .exam-table tr {
    margin-bottom: 20px;
  }
  
  .exam-table td {
    padding: 5px 0;
  }
  
  .exam-table td:before {
    content: attr(data-label);
    display: inline-block;
    width: 120px;
    font-weight: 500;
    color: var(--primary-color);
  }
  
  .results-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .chart-wrapper {
    height: auto;
    min-height: 350px;
    padding: 20px 15px;
  }
  
  .btn {
    min-width: 100%;
  }

  /* Ajustes específicos para os gráficos em mobile */
  #distributionChart, #growthChart {
    max-width: 100% !important;
    height: auto !important;
  }

  .chartjs-legend {
    position: relative !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin-top: 20px !important;
  }

  .chartjs-legend ul {
    padding-left: 0 !important;
    text-align: center !important;
  }

  .chartjs-legend li {
    display: inline-block !important;
    margin: 5px 10px !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
  
  .input-section, .results-section {
    padding: 20px;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-wrapper {
    height: auto;
    min-height: 300px;
    padding: 15px;
  }
  
  .form-actions {
    flex-direction: column;
  }

  /* Ajustes adicionais para gráficos em telas muito pequenas */
  .chartjs-legend li {
    margin: 3px 5px !important;
  }

  .chart-wrapper h3 {
    font-size: 1.1rem;
  }
}