/* Barra de Acessibilidade */
.accessibility-bar {
  width: 100%;
  background-color: #40A1E6;
  padding: 4px 0;
  margin-top: 70px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  clear: both;
  position: relative;
  z-index: 999998;
}

/* Desativar todas as transições e animações na barra */
.accessibility-bar *,
.accessibility-bar *:hover,
.accessibility-bar *:focus,
.accessibility-bar *:active {
  transition: none !important;
  animation: none !important;
}

.accessibility-bar-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  min-height: 35px;
}

/* Ajustes para navbar no mobile */
@media (max-width: 991px) {
  .navbar .container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }
  
  .navbar-brand {
    flex-shrink: 1;
    max-width: 120px;
  }
  
  .navbar-brand img {
    max-height: 35px !important;
  }
  
  .navbar-toggler {
    order: 3;
    flex-shrink: 0;
  }
  
  /* Eliminar espaço entre navbar e barra de acessibilidade */
  header nav.navbar {
    margin-bottom: 0 !important;
  }
  
  .accessibility-bar {
    margin-top: 56px;
  }
}

@media (max-width: 767px) {
  .navbar-brand {
    max-width: 100px;
  }
  
  .navbar-brand img {
    max-height: 30px !important;
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    max-width: 80px;
  }
  
  .navbar-brand img {
    max-height: 25px !important;
  }
}

/* Campo de Busca no Menu (Navbar) */
.navbar-search-form {
  display: flex;
  align-items: center;
  margin-left: 20px;
  margin-right: auto;
}

.search-form-navbar {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 3px 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.search-form-navbar:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  background-color: rgba(255, 255, 255, 1);
}

.search-input-navbar {
  border: none;
  background: transparent;
  outline: none;
  color: #333;
  font-size: 13px;
  padding: 4px 8px;
  width: 150px;
  transition: width 0.3s ease;
}

.search-input-navbar::placeholder {
  color: #888;
}

.search-input-navbar:focus {
  width: 180px;
}

.search-button-navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: #40A1E6;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  flex-shrink: 0;
}

.search-button-navbar:hover {
  background-color: #174950;
  transform: scale(1.1);
}

.search-button-navbar ion-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsivo */
@media (max-width: 991px) {
  .navbar-search-form {
    margin-left: 10px;
    margin-right: 10px;
    flex: 1;
    max-width: 100%;
  }
  
  .search-form-navbar {
    width: 100%;
  }
  
  .search-input-navbar {
    width: 100%;
    font-size: 13px;
    padding: 5px 10px;
  }
  
  .search-input-navbar:focus {
    width: 100%;
  }
  
  .search-button-navbar {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .navbar-search-form {
    margin-left: 8px;
    margin-right: 8px;
  }
  
  .search-input-navbar {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  .search-button-navbar {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
}

/* Campo de Busca (removido da barra de acessibilidade) */
.search-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 5px 10px;
  transition: none;
}

.search-form:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transition: none;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 14px;
  padding: 5px 10px;
  width: 250px;
  transition: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
  outline: none;
}

.search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 22px;
  cursor: pointer;
  transition: none;
  padding: 0;
}

.search-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transition: none;
}

.search-button ion-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Redes Sociais */
.social-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Ícones de Serviços */
.service-icons-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 0 15px;
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 35px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.9;
}

.service-icon img {
  width: auto;
  height: 100%;
  max-width: 120px;
  object-fit: contain;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
}

.service-icon:hover {
  transform: translateY(-2px) scale(1.05);
  opacity: 1;
}

/* Ajustes responsivos para ícones de serviços */
@media (max-width: 767px) {
  .service-icons-wrapper {
    gap: 6px;
    margin: 0 8px;
  }
  
  .service-icon {
    height: 25px;
  }
  
  .service-icon img {
    max-width: 80px;
  }
}

@media (max-width: 480px) {
  .service-icons-wrapper {
    gap: 5px;
    margin: 0 6px;
  }
  
  .service-icon {
    height: 23px;
  }
  
  .service-icon img {
    max-width: 70px;
  }
}

/* Continuação das Redes Sociais */
.social-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 24px;
  text-decoration: none;
  transition: none;
}

.social-icon ion-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon:hover {
  color: white;
  transition: none;
}

.social-icon.instagram:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  transition: none;
}

.social-icon.facebook:hover {
  background-color: #1877f2;
  transition: none;
}

/* Botões de Acessibilidade */
.accessibility-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Botões personalizados de acessibilidade */
.acc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: none !important;
}

.acc-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transition: none !important;
}

.acc-btn:focus {
  outline: 2px solid white;
  outline-offset: 2px;
  transition: none !important;
}

.acc-btn img {
  width: 28px;
  height: 28px;
  transition: none !important;
}

.acc-btn svg {
  width: 24px;
  height: 24px;
  transition: none !important;
}

/* Widget de Clima Compacto */
.weather-widget-compact {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0 10px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  gap: 4px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

.weather-widget-compact:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.weather-widget-compact ion-icon {
  color: white;
}

.weather-widget-compact span {
  white-space: nowrap;
}

/* Widget de Clima Customizado */
#weather-widget-custom {
  position: relative;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 15px !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  min-height: 40px !important;
  min-width: 120px !important;
  margin: 0 10px !important;
  color: white !important;
  text-decoration: none !important;
  overflow: hidden;
}

#weather-widget-custom .weather-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  transition: all 0.5s ease;
}

#weather-widget-custom .weather-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

#weather-widget-custom:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3) !important;
  color: white !important;
  text-decoration: none !important;
}

#weather-widget-custom span {
  color: white !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  white-space: nowrap;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#weather-widget-custom ion-icon {
  font-size: 24px !important;
  color: #FFC107 !important;
  flex-shrink: 0;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
}

/* Ajustes responsivos do Widget de Clima */
@media (max-width: 767px) {
  #weather-widget-custom {
    min-width: 125px !important;
    padding: 6px 16px !important;
    margin: 0 6px !important;
  }
  
  #weather-widget-custom span {
    font-size: 13px !important;
  }
  
  #weather-widget-custom ion-icon {
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  #weather-widget-custom {
    min-width: 115px !important;
    padding: 5px 14px !important;
    margin: 0 4px !important;
  }
  
  #weather-widget-custom span {
    font-size: 12px !important;
  }
  
  #weather-widget-custom ion-icon {
    font-size: 18px !important;
  }
}

/* Animação de chuva */
@keyframes rain {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 20% 100%;
  }
}

/* Animação de estrelas piscando */
@keyframes stars {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
}

/* Animação de raios */
@keyframes lightning {
  0%, 90%, 100% {
    opacity: 0;
  }
  93%, 96% {
    opacity: 0.8;
  }
}

/* Dia - Céu Limpo */
#weather-widget-custom.weather-day-clear .weather-background {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Dia - Nublado */
#weather-widget-custom.weather-day-cloudy .weather-background {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dia - Chuva */
#weather-widget-custom.weather-day-rain .weather-background {
  background: linear-gradient(135deg, #5f72bd 0%, #9b23ea 100%);
  background-size: 200% 200%;
  animation: rain 3s linear infinite;
}

#weather-widget-custom.weather-day-rain .weather-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(transparent 0%, transparent 30%, rgba(255,255,255,0.1) 30%, rgba(255,255,255,0.1) 32%, transparent 32%),
    linear-gradient(transparent 0%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 52%, transparent 52%),
    linear-gradient(transparent 0%, transparent 70%, rgba(255,255,255,0.1) 70%, rgba(255,255,255,0.1) 72%, transparent 72%);
  background-size: 15px 100%, 20px 100%, 18px 100%;
  animation: rain 0.5s linear infinite;
}

/* Noite - Céu Limpo */
#weather-widget-custom.weather-night-clear .weather-background {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
}

#weather-widget-custom.weather-night-clear .weather-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle, white 1px, transparent 1px),
    radial-gradient(circle, white 0.5px, transparent 0.5px),
    radial-gradient(circle, rgba(255,255,255,0.8) 1.5px, transparent 1.5px);
  background-size: 50px 50px, 80px 80px, 100px 100px;
  background-position: 0 0, 40px 60px, 130px 270px;
  animation: stars 3s ease-in-out infinite;
}

/* Noite - Nublado */
#weather-widget-custom.weather-night-cloudy .weather-background {
  background: linear-gradient(135deg, #232526 0%, #414345 100%);
}

/* Noite - Chuva */
#weather-widget-custom.weather-night-rain .weather-background {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  animation: rain 3s linear infinite;
}

#weather-widget-custom.weather-night-rain .weather-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(transparent 0%, transparent 30%, rgba(255,255,255,0.15) 30%, rgba(255,255,255,0.15) 32%, transparent 32%),
    linear-gradient(transparent 0%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 52%, transparent 52%),
    linear-gradient(transparent 0%, transparent 70%, rgba(255,255,255,0.15) 70%, rgba(255,255,255,0.15) 72%, transparent 72%);
  background-size: 15px 100%, 20px 100%, 18px 100%;
  animation: rain 0.5s linear infinite;
}

/* Tempestade */
#weather-widget-custom.weather-thunderstorm .weather-background {
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

#weather-widget-custom.weather-thunderstorm .weather-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  animation: lightning 4s infinite;
}

#weather-widget-custom.weather-thunderstorm .weather-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(transparent 0%, transparent 30%, rgba(255,255,255,0.2) 30%, rgba(255,255,255,0.2) 32%, transparent 32%),
    linear-gradient(transparent 0%, transparent 50%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.25) 52%, transparent 52%);
  background-size: 12px 100%, 18px 100%;
  animation: rain 0.4s linear infinite;
}

/* Responsivo */
@media (max-width: 767px) {
  .accessibility-bar {
    padding: 8px 0;
  }
  
  .accessibility-bar-content {
    gap: 10px;
    min-height: 40px;
    justify-content: center;
    padding: 0 15px;
  }
  
  /* Centralizar widget do clima no mobile */
  #weather-widget-custom {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Ocultar botões de acessibilidade no mobile */
  .accessibility-buttons {
    display: none !important;
  }
  
  .search-input {
    width: 180px;
    font-size: 13px;
  }
  
  .search-button {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  
  .social-icon {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
  
  .acc-btn {
    width: 40px;
    height: 40px;
  }
  
  .acc-btn img {
    width: 24px;
    height: 24px;
  }
  
  .acc-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .social-wrapper {
    gap: 8px;
  }
  
  .accessibility-buttons {
    gap: 8px;
  }
  
  .weather-widget-compact {
    margin: 0 5px;
  }
  
  .weather-widget-compact > div {
    font-size: 12px !important;
    height: 32px !important;
  }
}

@media (max-width: 480px) {
  .accessibility-bar {
    padding: 6px 0;
  }
  
  .accessibility-bar-content {
    min-height: 36px;
  }
  
  .search-input {
    width: 120px;
    font-size: 12px;
    padding: 4px 8px;
  }
  
  .search-button {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
  
  .social-icon {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  
  .acc-btn {
    width: 36px;
    height: 36px;
  }
  
  .acc-btn img {
    width: 20px;
    height: 20px;
  }
  
  .acc-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .social-wrapper {
    gap: 6px;
  }
  
  .accessibility-buttons {
    gap: 6px;
  }
  
  .weather-widget-compact {
    display: none;
  }

/* Alto Contraste */
body.high-contrast {
  background: #000 !important;
  color: #fff !important;
}

body.high-contrast * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

body.high-contrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

body.high-contrast .btn,
body.high-contrast button {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

body.high-contrast .navbar,
body.high-contrast .accessibility-bar,
body.high-contrast .page-footer {
  background: #000 !important;
  border-color: #fff !important;
}

body.high-contrast img:not(.acc-btn img):not(.service-icon img) {
  filter: grayscale(100%) contrast(120%) !important;
}

body.high-contrast .card,
body.high-contrast .box,
body.high-contrast .bg-light,
body.high-contrast .bg-white {
  background: #1a1a1a !important;
  border: 1px solid #fff !important;
}
