/* ============================================= */
/*            ESTILOS DO HEADER (TOP BAR)          */
/* ============================================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background-color: var(--header-bg-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 990;
  height: var(--header-height);
  transition: left 0.3s ease-in-out, width 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.top-bar.scrolled {
  box-shadow: var(--shadow);
}

.top-bar-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.top-bar-logo {
  height: 38px;
  width: auto;
}

@media (min-width: 1024px) {
  .top-bar {
    width: calc(100% - 280px);
    left: 280px;
  }
  
  .top-bar-title {
    display: none;
  }
}

/* ============================================= */
/*          ESTILOS DO MENU (SIDEBAR)            */
/* ============================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background-color: var(--sidebar-bg);
  padding: 1.5rem;
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  transition: left 0.3s ease-in-out;
  z-index: 1000;
}

.sidebar.open {
  left: 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center; /* antes estava flex-start */
  margin-bottom: 2rem;
  gap: 1rem;
}

.titulo-site {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sidebar-text-hover);
  text-decoration: none;
  border-radius: 0 !important;
  margin-top: 15px;
  text-align: center; /* centraliza o texto */
  width: 100%;        /* ocupa toda a largura disponível */
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-end;
}

.theme-switcher span {
  font-size: 1.25rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #495057;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-color);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

.sidebar-nav {
  flex-grow: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(185, 185, 185, 0.16);
  /* linha abaixo */
  font-size: 1.25rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-hover);
}

.sidebar-nav a .link-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}


/* ============================================= */
/*       BOTÃO DE MENU E FUNDO (OVERLAY)         */
/* ============================================= */
.menu-toggle {
  background-color: transparent;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
}

.menu-toggle .bar {
  width: 22px;
  height: 2px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

body.sidebar-is-open .menu-toggle .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.sidebar-is-open .menu-toggle .bar:nth-child(2) {
  opacity: 0;
}

body.sidebar-is-open .menu-toggle .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.sidebar.open+.overlay {
  display: block;
}