/* ==========================================================
   LEARN TECH - MENU LATERAL (SIDEBAR)
   Usado em: dashboard, turmas, atividades e calendário.
   O comportamento (recolher / abrir no celular) está em JS_sidebar.js.
   ========================================================== */


/* ==========================================================
   MENU LATERAL (SIDEBAR) COMPARTILHADO Usado em: dashboard.html, turmas.html, atividades.html, calendario.html
   ========================================================== */

/* Ajusta o body das páginas internas para o layout sidebar + conteúdo */
body.has-sidebar {
  display: flex;
  flex-direction: row;
  overflow-x: hidden;
}

/* SIDEBAR LATERAL */
aside.sidebar {
  width: 250px;
  background-color: #3b3a4a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s ease;
  z-index: 200;
  flex-shrink: 0;
}

aside.sidebar.collapsed {
  width: 76px;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 48%;
  right: -14px;
  width: 28px;
  height: 28px;
  background-color: #ffffff;
  color: #1a1a2e;
  border-radius: 50%;
  border: 2px solid #3b3a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 201;
  font-weight: 800;
  font-size: 13px;
  user-select: none;
  transition: transform 0.2s;
}

.sidebar-toggle-btn:hover {
  transform: scale(1.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  height: 80px;
}

.sidebar-logo img {
  width: 50px;
  height: 45px;
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-logo img:hover {
  transform: scale(1.05);
}

.sidebar-logo span {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: #ffffff;
  opacity: 1;
  transition: opacity 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-logo span:hover {
  color: #2b74e2;
  transform: scale(1.05);
}

aside.sidebar.collapsed .sidebar-logo span {
  opacity: 0;
  pointer-events: none;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 14px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.menu-item:hover,
.menu-item.active {
  background-color: rgba(255, 255, 255, 0.12);
}

.menu-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-icon svg {
  width: 100%;
  height: 100%;
  stroke: #ffffff;
}

aside.sidebar.collapsed .menu-label {
  opacity: 0;
  display: none;
}

.sidebar-bottom {
  padding: 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-sair {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.btn-sair:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

aside.sidebar.collapsed .btn-sair span {
  display: none;
}

/* ÁREA DE CONTEÚDO À DIREITA DA SIDEBAR */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* Botão hambúrguer que só aparece no mobile para abrir a gaveta do menu */
.mobile-menu-trigger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 22px;
  padding: 0;
}

.mobile-menu-trigger span {
  display: block;
  width: 100%;
  height: 3.5px;
  background-color: #94a3b8;
  border-radius: 2px;
}

/* Fundo escurecido atrás da gaveta no mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 150;
}

.sidebar-backdrop.active {
  display: block;
}


/* ==========================================================
   COMPORTAMENTO EM TELAS PEQUENAS: MENU VIRA GAVETA (OFF-CANVAS)
   ========================================================== */

@media (max-width: 768px) {
  aside.sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100%;
    width: 250px !important;
  }

  aside.sidebar.mobile-open {
    left: 0;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  aside.sidebar.mobile-open .sidebar-logo span,
  aside.sidebar.mobile-open .menu-label,
  aside.sidebar.mobile-open .btn-sair span {
    opacity: 1;
    display: block;
    pointer-events: auto;
  }

  .mobile-menu-trigger {
    display: flex;
  }
}
