:root {
  --bg-color: rgb(240, 240, 240);
  --text-color: rgb(69, 69, 69);
  --search-bar-bg-color: rgb(69, 69, 69);
  --search-bar-color: rgb(240, 240, 240);
}

.dark-mode {
  --bg-color: rgb(69, 69, 69);
  --text-color: rgb(240, 240, 240);
  --search-bar-bg-color: rgb(240, 240, 240);
  --search-bar-color: rgb(69, 69, 69);
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.5s;
  font-family:  'Roboto', Arial, sans-serif;
  margin: 0px;
  padding: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin-right: 20px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgb(69, 69, 69);
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: rgb(124, 124, 124);
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Cabeçalho */
header{
  display: flex;
  justify-content: space-between;
  background-color: rgb(226, 226, 226);
  padding: 10px 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

/* ícone */
.icon {
display: flex;
align-items: center;
margin-right: 10px;
}

/* DEBASEMENT.ORG */
.logo {
color: rgb(44, 44, 44);
font-size: 20px;
font-weight: bold;
}
@media screen and (max-width: 768px){
  .logo {
    color: rgb(44, 44, 44);
    font-size: 12px;
    font-weight: bold;
}
}
/* Ícone do menu no mobile */
.menu-icon {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: rgb(45, 45, 45);
}

/*  menu */
.menu {
  list-style: none;
  display: flex;
  gap: 20px;
}

.menu li a {
  text-decoration: none;
  font-weight: bold;
  color: rgb(44, 44, 44);
}

/* menu dropdown no mobile */
@media (max-width: 600px) {
  .menu {
      display: none;
      flex-direction: column;
      position: absolute;
      top: 60px;
      right: 20px;
      background-color: rgb(215, 215, 215);
      width: 100px;
      padding: 20px;
      box-shadow: 0 10px 10px rgba(0, 0, 0, 0.5);
  }

  .menu.show {
      display: flex;
  }

  .menu li {
      margin: 20px;
  }

  .menu-icon {
      display: block;
      margin-left: 50px;
  }
}

/* Barra de pesquisa */
.search-section {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 20px;
}

#search-bar, #dropdown, #search-button {
  background-color: var(--search-bar-bg-color);
  transition: all 0.5s;
  color: var(--search-bar-color);
  margin: 10px;
  padding: 10px;
  font-size: 1em;
  width: 100%; 
  max-width: 300px; 
}

/* Seção do gráfico */
#chart-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0px;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 800px;
}

@media screen and (max-width: 768px) {
  #chart-section {
    height: 400px;
    padding: 0px;
}
}

#loading-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.5em;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

@keyframes dots {
  0% { content: " "; }
  25% { content: ":"; }
  50% { content: ":-"; }
  75% { content: ":-)"; }
  100% { content: ":-)"; }
}

#loading-text::after {
  content: "...";
  animation: dots 1s steps(1, end) infinite;
}

/* Pop-ups */
.popup {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 500px;
  background-color: #333;
  color: white;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  padding: 20px;
}

.popup-content {
  text-align: left;
  max-height: 80vh;
  overflow-y: auto;
}

.close-popup {
  margin-top: 20px;
  padding: 10px 20px;
  background-color: #ff5555;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.close-popup:hover {
  background-color: #ff0000;
}

/* Introdução */
.intro-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 60vh;
  text-align: center;
  font-size: 18px;
  color: var(--text-color);
  transition: all 0.5s;
  padding: 20px;
  background-color: transparent;
}

#intro-text.hidden {
  display: none; 
}


#yahoo-finance-credit {
  text-align: center;
  font-size: 12px;
  color: rgb(124, 124, 124);
  margin-top: 20px;
}

/* Estilos para mensagem de dados ausentes */
.no-data-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  text-align: center;
}

.dark-mode .no-data-message {
  background-color: rgba(69, 69, 69, 0.95);
  color: rgb(240, 240, 240);
}

.no-data-message h3 {
  margin: 0 0 10px 0;
  color: #666;
  font-size: 18px;
}

.dark-mode .no-data-message h3 {
  color: #ccc;
}

.no-data-message p {
  margin: 0;
  color: #888;
  font-size: 14px;
  line-height: 1.4;
}

.dark-mode .no-data-message p {
  color: #aaa;
}

/* Estilos para avisos da API */
.api-warning {
  animation: fadeIn 0.5s ease-in;
}

.dark-mode .api-warning div {
  background-color: #2d3748 !important;
  border-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
