* {
    box-sizing: border-box;
}

body {
    font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: #eeeeee;
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    color: #2d3748;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.7;
    margin: 0;
}

#legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 15px;
    font-weight: 500;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-color.nao {
    background: #dddddd;
}

.sim { 
    background: #4c5363;
}

.nao { 
    background: #dddddd;
}

.chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.company-card {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.company-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0px;
    background: #4b31dd;
}

.company-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.company-title {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 22px;
    color: #2d3748;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.company-count {
    background: #231f20;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display:none;
}

.company-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #4a5568;
}

.footer-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-metric .value {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 2px;
    background: #231f20;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-metric .label {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

.waffle {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16px, 1fr));
    gap: 3px;
    align-content: start;
    padding: 0.5rem 0;
}

.person {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.person:hover {
    transform: scale(1.3);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.person.sim {
    background: #4c5363;
}

.person.nao {
    background: #dddddd;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    pointer-events: none;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    max-width: 280px;
    line-height: 1.4;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.stats-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    background: #231f20;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-item p {
    margin: 0;
    font-weight: 500;
    color: #4a5568;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .chart {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .waffle {
        grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
        gap: 2px;
    }
    
    .person {
        width: 14px;
        height: 14px;
    }
    
    #legend {
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* Animation for loading */
.company-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.company-card:nth-child(1) { animation-delay: 0.1s; }
.company-card:nth-child(2) { animation-delay: 0.2s; }
.company-card:nth-child(3) { animation-delay: 0.3s; }
.company-card:nth-child(4) { animation-delay: 0.4s; }
.company-card:nth-child(5) { animation-delay: 0.5s; }
.company-card:nth-child(6) { animation-delay: 0.6s; }

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

#filter-select, #export-button {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  background-color: #fff;
  cursor: pointer;
}

#export-button {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  transition: background 0.3s ease;
}

#export-button:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.bar-chart-container {
  margin-bottom: 2.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

.bar-chart-container h3 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

#bar-chart {
  width: 100%;
}

.stacked-bar-container {
  margin-bottom: 2.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

.stacked-bar-container h3 {
  margin-top: 0;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

#job-classification-bar {
  width: 100%;
}

.job-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 14px;
  justify-content: flex-start;
}

.job-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.job-legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin-top: 3rem;
  border-top: 1px solid #e2e8f0;
  font-size: 14px;
  color: #231f20;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo img {
  height: 36px;
  max-width: 100%;
}

.footer-source a {
  color: #4b31dd;
  font-weight: 500;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-logo img {
    height: 32px;
  }
}

#tooltip{
  background-color:#eeeeee;
}