/* ===== ESTILOS CUSTOMIZADOS PARA DASHBOARD MALÁRIA ===== */

/* Importar fontes do Google */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===== VARIÁVEIS CSS ===== */
:root {
  --primary-color: #043241;
  --background-color: #FAFBFC;
  --surface-color: #FFFFFF;
  --text-primary: #1A202C;
  --text-secondary: #4A5568;
  --border-color: #E2E8F0;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET E BASE ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color) 100%);
  padding: 1rem 2rem;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-title {
  display: flex;
  align-items: center;
  margin: 0;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  justify-content: center;  /* Centraliza horizontalmente */
}

.header-logo {
  height: 50px;
  width: auto;
  margin-right: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: var(--transition);
  justify-content: center;  /* Centraliza horizontalmente */
}

.header-logo:hover {
  transform: scale(1.05);
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, var(--surface-color) 0%, #f8f9fa 100%);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 2.0rem 0.5rem; /* Aumentado em 10px */
  overflow-y: auto;
  z-index: 999;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.sidebar-hidden {
  transform: translateX(-100%);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ===== BOTÃO TOGGLE ===== */
.toggle-button {
  position: fixed;
  top: 20px;
  left: 15px;
  z-index: 1001;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  background-color: #c3cfe2;
}

/* Efeito hover */
.toggle-button:hover {
  transform: scale(1.1); /* aumenta suavemente */
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6); /* brilho branco leve */
  border-radius: 50%;
  border: 2px solid white;
    background-color: #c3cfe2;

}

/* Se o navegador ainda aplicar algo estranho no :active, force com !important (usar como último recurso) */
.toggle-button:active,
.toggle-button:focus,
.toggle-button:focus-visible {
  background-color: #c3cfe2 !important;
}


/* Ícone dentro do botão */
.toggle-button img {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

/* Se quiser o ícone também crescer um pouco no hover */
.toggle-button:hover img {
  transform: scale(1.05);
}


/* ===== BOTÕES DA SIDEBAR ===== */
.sidebar .btn {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}

/* Aplica margin-top apenas ao primeiro botão */
.sidebar .btn:first-child {
  margin-top: 40px;
}

/* BOTÃO SELECIONADO */
.sidebar .btn-primary {
  background: #043241;
  border-color: #043241;
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* BOTÕES NÃO SELECIONADOS */
.sidebar .btn:not(.btn-primary) {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #1a202c;
}

/* EFEITO HOVER */
.sidebar .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* BRILHO NO HOVER */
.sidebar .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.sidebar .btn:hover::before {
  left: 100%;
}


/* ===== FORMULÁRIOS ===== */
.sidebar label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.9rem;
}

.sidebar .Select-control,
.sidebar .dropdown {
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  transition: var(--transition);
  background: var(--surface-color);
  box-shadow: var(--shadow-sm);
}

.sidebar .Select-control:hover,
.sidebar .dropdown:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 95, 75, 0.1);
}

/* ===== RADIO BUTTONS ===== */
.sidebar input[type="radio"] {
  margin-right: 0.5rem;
  accent-color: var(--primary-color);
}

.sidebar .form-check-label {
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== ÁREA DE CONTEÚDO ===== */
.content-area {
  margin-left: 0;
  padding: 2rem;
  min-height: 100vh;
  background: var(--background-color);
  transition: var(--transition);
}

/* ===== CONTAINERS DE GRÁFICOS ===== */
.graph-container {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  height: 799px;
}

.graph-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-color));
  
}

.graph-container:hover {
  box-shadow: var(--shadow-lg);
}

/* ===== LOADING STATES ===== */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  flex-direction: column;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1200px) {
  .sidebar {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 280px;
  }
  
  .content-area {
    padding: 1rem;
  }
  
  .header {
    padding: 1rem;
  }
  
  .header-title {
    font-size: 1.5rem;
  }
  
  .graph-container {

    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
  }
  
  .toggle-button {
    top: 15px;
    left: 5px;
    width: 45px !important;
    height: 45px !important;
  }
}

/* ===== MELHORIAS PARA PLOTLY ===== */
.js-plotly-plot .plotly .modebar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 4px !important;
}

.js-plotly-plot .plotly .modebar-btn {
  border-radius: 6px !important;
  transition: var(--transition) !important;
}



/* ===== TOOLTIPS CUSTOMIZADOS ===== */
.custom-tooltip {
  background: rgba(0, 0, 0, 0.9) !important;
  color: white !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ===== ESTADOS DE HOVER ===== */
.hover-effect {
  transition: var(--transition);
}

.hover-effect:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* ===== BADGES E INDICADORES ===== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ===== SCROLLBAR CUSTOMIZADA ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ===== BARRA DE FILTROS (harmonizada com o design geral) ===== */
#container-barra-filtros {
  margin: 1rem 1.5rem 1.5rem 1.5rem;
}

#container-barra-filtros h6.text-muted {
  margin-bottom: 0.5rem;
  margin-left: 0.75rem;
  font-weight: 600;
  color: black;
  font-family: 'Poppins', sans-serif;
}

#barra-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  background-color: var(--surface-color);
  box-shadow: var(--shadow-sm);
  min-height: 48px;
  transition: var(--transition);
}


#choropleth-estadual-map .plot-container .choroplethlayer path:hover {
    cursor: pointer !important;
}

#choropleth-estadual-map .plotly .choroplethlayer path:hover,
#choropleth-estadual-map .plotly .geolayer path:hover,
#choropleth-estadual-map .plot-container .geo path:hover {
    cursor: pointer !important;
}

#choropleth-estadual-map .plot-container svg path:hover,
#choropleth-estadual-map .js-plotly-plot svg path:hover,
#choropleth-estadual-map svg path:hover {
    cursor: pointer !important;
}