/* ===== VARIÁVEIS GLOBAIS ATUALIZADAS ===== */
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --accent-color: #20c997;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --font-size-base: 16px;
  --text-color: #212529;
  --text-color-light: #f8f9fa;
  --bg-color: #ffffff;
  --bg-dark: #121212;
  --bg-card: #ffffff;
  --bg-card-dark: #1e1e1e;
  --border-color: #dee2e6;
  --border-color-dark: #444;
  --primary-light: #e3f2fd;
  --success-light: #e8f5e9;
  --warning-light: #fff3cd;
  --accent-light: #e6fcf5;
  --danger-light: #fde8e8;
  --info-light: #e3f2fd;
  /* Novas variáveis para efeito glass */
  --glass-bg: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.dark-mode {
  --primary-color: #4dabf7;
  --secondary-color: #adb5bd;
  --success-color: #69db7c;
  --light-color: #2d2d2d;
  --dark-color: #e9ecef;
  --accent-color: #3be9b5;
  --warning-color: #ffd43b;
  --danger-color: #ff8787;
  --text-color: #e9ecef;
  --text-color-light: #e9ecef;
  --bg-color: #121212;
  --bg-dark: #0a0a0a;
  --bg-card: #1e1e1e;
  --bg-card-dark: #252525;
  --border-color: #444;
  --border-color-dark: #555;
  --primary-light: #1a365d;
  --success-light: #1a3c2e;
  --warning-light: #4d3800;
  --accent-light: #0d3c2f;
  --danger-light: #4a1c1c;
  --info-light: #1a365d;
  /* Novas variáveis para efeito glass no modo escuro */
  --glass-bg: rgba(0, 0, 0, 0.2);
  --glass-border: rgba(255, 255, 255, 0.1);
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* ===== ESTILOS BASE ===== */
body {
  font-family: "Open Sans", sans-serif;
  line-height: 1.6;
  transition: all 0.3s ease;
  font-size: var(--font-size-base);
  color: var(--text-color);
  background-color: var(--bg-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: var(--text-color);
}

p,
span,
div,
li,
a:not(.nav-link, .btn) {
  color: var(--text-color);
}

.font-small {
  font-size: 0.875rem !important;
}
.font-medium {
  font-size: 1rem !important;
}
.font-large {
  font-size: 1.125rem !important;
}
.font-xlarge {
  font-size: 1.25rem !important;
}

/* ===== HEADER E NAVEGAÇÃO ===== */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  background-color: var(--bg-color) !important;
  padding: 10px 0;
}
.dark-mode .navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}
.navbar-brand small {
  color: var(--secondary-color) !important;
  font-size: 0.85rem;
  margin-top: 3px;
}
.nav-link {
  font-weight: 500;
  transition: color 0.3s;
  color: var(--text-color) !important;
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent-color) !important;
}
.navbar-toggler {
  border-color: var(--border-color);
}
.navbar-toggler-icon {
  filter: invert(0);
}
.dark-mode .navbar-toggler-icon {
  filter: invert(1);
}

/* Logo personalizada */
.custom-logo {
  max-height: 140px !important;
  min-height: 100px;
  object-fit: contain;
  width: auto;
}
.navbar .custom-logo {
  max-height: 130px !important;
  min-height: 90px;
}
footer .custom-logo {
  max-height: 160px !important;
  min-height: 120px;
  margin-bottom: 15px !important;
}

/* ===== HERO SECTION REFINADA ===== */
.hero-section {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  color: white;
  padding: 140px 0;
  margin-top: 86px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 20s linear infinite;
}
.hero-section h1,
.hero-section p {
  color: white !important;
}
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== CARDS COM EFEITO GLASS ===== */
.glass-card {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
}
.service-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s;
  overflow: hidden;
  border-radius: 16px !important;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(5px);
  height: 100%;
}
.dark-mode .service-card {
  background-color: var(--bg-card);
  border-color: var(--border-color);
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15) !important;
}
.dark-mode .service-card:hover {
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4) !important;
}
.card-title {
  color: var(--text-color);
}
.card-text {
  color: var(--secondary-color);
}

/* Ícones com Background */
.icon-bg-primary {
  background-color: var(--primary-light) !important;
}
.icon-bg-success {
  background-color: var(--success-light) !important;
}
.icon-bg-warning {
  background-color: var(--warning-light) !important;
}
.icon-bg-accent {
  background-color: var(--accent-light) !important;
}
.icon-bg-danger {
  background-color: var(--danger-light) !important;
}
.icon-bg-info {
  background-color: var(--info-light) !important;
}

/* ===== MUNICÍPIOS ===== */
.municipio-badge {
  background-color: var(--light-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  margin: 5px;
  transition: all 0.3s;
}
.municipio-badge:hover {
  background-color: var(--accent-color);
  color: white !important;
  transform: scale(1.05);
}

/* Mapa */
#minasMap {
  height: 500px;
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  z-index: 1;
}
.custom-marker {
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.dark-mode .custom-marker {
  border-color: var(--bg-dark);
}
.map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: var(--bg-card);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

/* ===== GALERIA ===== */
.gallery-section {
  padding: 80px 0;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 20px;
  height: 250px;
  transition: transform 0.3s;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.gallery-item:hover img {
  transform: scale(1.1);
}
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s;
}
.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}
.gallery-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.gallery-modal.active {
  display: flex;
}
.gallery-modal-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}
.gallery-modal-img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}
.gallery-modal-caption {
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 1.2rem;
}
.gallery-modal-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  transition: color 0.3s;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-modal-close:hover {
  color: var(--accent-color);
}
.gallery-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}
.gallery-modal-nav:hover {
  background: var(--primary-color);
}
.gallery-modal-prev {
  left: 20px;
}
.gallery-modal-next {
  right: 20px;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 30px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--primary-color);
}
.timeline-step {
  position: relative;
  margin-bottom: 30px;
}
.timeline-icon {
  position: absolute;
  left: -40px;
  top: 0;
  width: 60px;
  height: 60px;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.timeline-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}
.timeline-content:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}
.dark-mode .timeline-content {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
@media (max-width: 768px) {
  .timeline {
    padding-left: 0;
  }
  .timeline::before {
    left: 30px;
  }
  .timeline-icon {
    position: relative;
    left: 0;
    margin-bottom: 15px;
  }
  .timeline-content {
    margin-left: 0;
  }
}

/* ===== CONTROLES DE ACESSIBILIDADE ===== */
.accessibility-controls {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 10px;
  border: 1px solid var(--glass-border);
  display: flex;
}
.accessibility-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-color);
  margin: 0 5px;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}
.accessibility-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===== BOTÃO FLUTUANTE (FAB) ===== */
.fab-container {
  position: fixed;
  bottom: 140px;
  right: 20px;
  z-index: 999;
}
.fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}
.fab:hover {
  transform: scale(1.1);
  background-color: var(--accent-color);
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(13, 110, 253, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

/* ===== NOTIFICAÇÕES ===== */
.notification-container {
  position: fixed;
  bottom: 210px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
  width: 100%;
}
.notification-toast {
  background-color: var(--bg-card);
  color: var(--text-color);
  border-left: 5px solid var(--primary-color);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  animation: slideIn 0.3s ease forwards;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}
.notification-toast.hide {
  animation: slideOut 0.3s ease forwards;
}
.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.notification-content {
  flex: 1;
}
.notification-title {
  font-weight: 600;
  margin-bottom: 3px;
}
.notification-text {
  font-size: 0.9rem;
  opacity: 0.9;
}
.notification-close {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
}
.notification-close:hover {
  opacity: 1;
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ===== FOTOS E BORDAS ===== */
.manager-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 5px solid var(--primary-color);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.dark-mode .manager-photo {
  border-color: var(--primary-color-dark);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.custom-marker-map {
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border: 3px solid white;
}
.dark-mode .custom-marker-map {
  border: 3px solid #2c3034;
}
.custom-div-icon {
  background: transparent;
  border: none;
}

/* ===== TEXTOS UTILITÁRIOS ===== */
.text-muted {
  color: var(--secondary-color) !important;
}
.text-primary {
  color: var(--primary-color) !important;
}
.text-success {
  color: var(--success-color) !important;
}
.text-warning {
  color: var(--warning-color) !important;
}
.text-danger {
  color: var(--danger-color) !important;
}
.text-accent {
  color: var(--accent-color) !important;
}
.text-info {
  color: var(--primary-color) !important;
}

/* ===== BACKGROUNDS ===== */
.bg-light {
  background-color: var(--light-color) !important;
}
.bg-white {
  background-color: var(--bg-card) !important;
}
.bg-primary {
  background-color: var(--primary-color) !important;
}
.bg-success {
  background-color: var(--success-color) !important;
}
.bg-accent {
  background-color: var(--accent-color) !important;
}

/* ===== BOTÕES ===== */
.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
}
.btn-outline-light {
  color: var(--text-color-light);
  border-color: var(--text-color-light);
}
.btn-outline-light:hover {
  background-color: var(--text-color-light);
  color: var(--bg-color);
}
.btn-light {
  background-color: var(--light-color);
  color: var(--text-color);
  border-color: var(--border-color);
}
.btn-light:hover {
  background-color: var(--border-color);
  color: var(--text-color);
}
.btn-outline-secondary {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}
.btn-outline-secondary:hover {
  background-color: var(--secondary-color);
  color: white;
}

/* ===== FOOTER ===== */
footer {
  background-color: #121212 !important;
  color: #f8f9fa !important;
  margin-top: 80px;
  padding: 50px 0 30px;
}
footer * {
  color: #f8f9fa !important;
}
footer h1,
footer h2,
footer h3,
footer h4,
footer h5,
footer h6,
footer p,
footer span,
footer div,
footer li,
footer a,
footer .text-light,
footer .text-muted,
footer .text-secondary {
  color: #f8f9fa !important;
}
footer a:hover {
  color: #20c997 !important;
}
footer .btn-outline-light {
  color: #f8f9fa !important;
  border-color: #f8f9fa !important;
}
footer .btn-outline-light:hover {
  background-color: #f8f9fa !important;
  color: #121212 !important;
}
footer hr {
  border-color: rgba(255, 255, 255, 0.1) !important;
}
footer .list-unstyled li,
footer .list-unstyled li i {
  color: #f8f9fa !important;
}

/* ===== LISTAS ===== */
.list-group-item {
  background-color: transparent;
  color: var(--text-color);
  border-color: var(--border-color);
}

/* ===== FORMULÁRIOS ===== */
.form-control,
.form-select {
  background-color: var(--bg-card);
  color: var(--text-color);
  border-color: var(--border-color);
}
.form-control:focus,
.form-select:focus {
  background-color: var(--bg-card);
  color: var(--text-color);
  border-color: var(--primary-color);
}
.form-label {
  color: var(--text-color);
}

/* ===== BADGES ===== */
.badge {
  color: white;
}
.bg-primary {
  background-color: var(--primary-color) !important;
}
.bg-success {
  background-color: var(--success-color) !important;
}
.bg-accent {
  background-color: var(--accent-color) !important;
}

/* ===== SEÇÕES ===== */
.section-title {
  color: var(--text-color);
}
#contact {
  padding-top: 80px;
  padding-bottom: 80px;
}
.contact-info-box {
  margin-top: 40px;
  padding: 30px 0;
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

/* ===== NOTÍCIAS ===== */
.news-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  overflow: hidden;
  height: 100%;
}
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}
.dark-mode .news-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}
.news-image-wrapper {
  position: relative;
  height: 180px;
  overflow: hidden;
}
.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.news-card:hover .news-image {
  transform: scale(1.05);
}
.news-source-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.news-title {
  font-size: 1.1rem;
  line-height: 1.4;
  min-height: 60px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 60px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.news-item {
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(var(--item-index, 0) * 0.1s);
  opacity: 0;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .hero-section {
    padding: 80px 0;
    text-align: center;
    margin-top: 76px;
  }
  .navbar .custom-logo {
    max-height: 50px !important;
    min-height: 40px;
  }
  footer .custom-logo {
    max-height: 60px !important;
    min-height: 50px;
  }
  .navbar-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .navbar-brand small {
    font-size: 0.75rem;
    margin-top: 0;
  }
  .accessibility-controls {
    bottom: 70px;
    right: 10px;
    padding: 5px;
  }
  .accessibility-btn {
    width: 35px;
    height: 35px;
    margin: 0 2px;
  }
  #contact {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .contact-info-box {
    margin-top: 30px;
    padding: 20px 0;
  }
  #minasMap {
    height: 400px;
  }
  .gallery-modal-close {
    top: -50px;
    right: 10px;
    font-size: 2rem;
  }
  .gallery-modal-nav {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  .gallery-modal-prev {
    left: 10px;
  }
  .gallery-modal-next {
    right: 10px;
  }
  .gallery-modal-caption {
    font-size: 1rem;
    padding: 10px;
  }
  .fab-container {
    bottom: 120px;
    right: 10px;
  }
  .notification-container {
    bottom: 190px;
    right: 10px;
    max-width: 300px;
  }
}

@media (max-width: 576px) {
  .navbar .custom-logo {
    max-height: 45px !important;
  }
  footer .custom-logo {
    max-height: 55px !important;
  }
  .gallery-modal-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .fab {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

/* ===== BOTÕES DE ÁUDIO ===== */
.speech-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.8rem;
  margin-left: 5px;
  cursor: pointer;
  transition: color 0.3s;
}
.speech-btn:hover {
  color: var(--accent-color);
}
