* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scroll-behavior: smooth; /* Adiciona rolagem suave em toda a página */
}

/* Variáveis de cores */
:root[data-theme="light"] {
  --bg-color: #f5f9ff;
  --text-color: #001f3f;
  --sidebar-bg: #001f3f;
  --sidebar-text: white;
  --card-bg: white;
  --card-shadow: rgba(0, 31, 63, 0.08);
  --hover-shadow: rgba(0, 31, 63, 0.12);
  --accent-color: #3a6ea5;
  --border-color: #87cefa;
}

:root[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --sidebar-bg: #2d2d2d;
  --sidebar-text: #e0e0e0;
  --card-bg: #2d2d2d;
  --card-shadow: rgba(0, 0, 0, 0.2);
  --hover-shadow: rgba(0, 0, 0, 0.3);
  --accent-color: #5a9ec7;
  --border-color: #5a9ec7;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.logo {
  margin-bottom: 2rem;
  text-align: center;
}

.logo img {
  max-width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
}

.content {
  flex: 1;
  padding: 2rem;
}

h1 {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  font-size: 2.2rem;
}

h2 {
  color: var(--text-color);
  margin: 2rem 0 1rem;
  font-size: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  scroll-margin-top: 20px; /* Adiciona margem para rolagem suave aos anchors */
}

.category-section {
  margin-bottom: 3rem;
  scroll-margin-top: 20px; /* Adiciona margem para rolagem suave aos anchors */
}

.apps-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.app-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  scroll-margin-top: 20px; /* Adiciona margem para rolagem suave aos anchors */
}

.app-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px var(--hover-shadow);
}

.app-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
}

.app-icon {
  width: 48px;
  height: 48px;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-color);
  border-radius: 10px;
  color: var(--text-color);
  font-weight: bold;
  font-size: 1.5rem;
}

.app-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.sidebar-menu {
  list-style-type: none;
}

.sidebar-menu .category-title {
  font-weight: bold;
  margin: 1.5rem 0 0.5rem;
  color: var(--accent-color);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.sidebar-menu li {
  margin-bottom: 0.5rem;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--sidebar-text);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s, transform 0.2s;
}

.sidebar-menu a:hover {
  background-color: rgba(90, 158, 199, 0.2);
  transform: translateX(
    5px
  ); /* Pequeno efeito de movimento ao passar o mouse */
}

.sidebar-menu .icon {
  margin-right: 0.75rem;
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

/* Indicador de link ativo */
.sidebar-menu a.active {
  background-color: rgba(90, 158, 199, 0.3);
  border-left: 3px solid var(--accent-color);
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 1rem;
    height: auto;
    position: relative;
  }

  .content {
    padding: 1rem;
  }
}

/* Animação sutil para transições */
.category-section {
  transition: opacity 0.3s ease;
}

/* Botão para voltar ao topo */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(10px);
  box-shadow: 0 2px 10px rgba(0, 31, 63, 0.2);
  font-size: 20px;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--accent-color);
  color: var(--text-color);
}

/* Header container */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-container h1 {
  margin-bottom: 0;
}

/* Botão de alternância de tema */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--text-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.3s ease;
  color: var(--text-color);
}

.theme-toggle:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.theme-toggle-icon {
  width: 20px;
  height: 20px;
}

/* Controle de visibilidade dos ícones baseado no tema */
.theme-toggle-icon.sun {
  display: none;
}

.theme-toggle-icon.moon {
  display: block;
}

[data-theme="dark"] .theme-toggle-icon.sun {
  display: block;
}

[data-theme="dark"] .theme-toggle-icon.moon {
  display: none;
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
}


/* ===== MENU MOBILE ===== */

.menu-toggle {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 900;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

@media (max-width: 768px) {

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    height: 100%;
    transition: 0.3s ease;
    z-index: 1000;
  }

  .sidebar.active {
    left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .header-container {
    align-items: center;
    gap: 1rem;
  }

}


/* ===== ÍCONE DE INFORMAÇÃO ===== */

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--text-color);
  font-weight: bold;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}

.info-icon:hover {
  transform: scale(1.1);
}

/* Tooltip */
.tooltip {
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10;
}

.info-icon:hover .tooltip {
  opacity: 1;
}


/* ===================== */
/* SUBMENU SIDEBAR */
/* ===================== */

.has-submenu {
  position: relative;
}

.submenu-toggle {
  justify-content: space-between;
}

.arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.submenu {
  list-style: none;
  padding-left: 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.submenu li {
  margin: 5px 0;
}

.submenu a {
  font-size: 0.9rem;
  padding: 0.4rem 0;
  display: block;
  color: var(--sidebar-text);
  text-decoration: none;
  opacity: 0.8;
}

.submenu a:hover {
  opacity: 1;
}

/* Submenu aberto */
.has-submenu.active .submenu {
  max-height: 200px;
}

.has-submenu.active .arrow {
  transform: rotate(180deg);
}


/* Cor Icones (Windows e Android) */
.os-icon {
  margin-left: 8px;
  font-size: 18px;
}

.windows {
  color: #0078d4;
}

.android {
  color: #3ddc84;
}

.os-icon {
  margin-left: 10px;
  font-size: 26px;
  vertical-align: middle;
}


/* ======================================= */
/* MODAL POPUP ACESSO REMOTO */
/* ======================================= */

.remote-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
  z-index: 2000;
}

.remote-modal.active {
  opacity: 1;
  pointer-events: all;
}

.remote-modal-content {
  background: var(--card-bg);
  width: 90%;
  max-width: 500px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transform: translateY(30px);
  transition: 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.remote-modal.active .remote-modal-content {
  transform: translateY(0);
}

/* HEADER */
.remote-modal-header {
  background: linear-gradient(135deg, var(--sidebar-bg), var(--accent-color));
  padding: 2rem;
  text-align: center;
}

.remote-modal-icon {
  font-size: 50px;
}

/* BODY */
.remote-modal-body {
  padding: 2rem;
  text-align: center;
}

.remote-modal-body h2 {
  margin-bottom: 1rem;
}

.remote-modal-body p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.remote-modal-body ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.remote-modal-body li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* BOTÃO */
.remote-modal-btn {
  background: var(--accent-color);
  color: var(--text-color);
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}

.remote-modal-btn:hover {
  transform: scale(1.05);
}

/* FECHAR */
.remote-close {
  position: absolute;
  top: 12px;
  right: 15px;
  cursor: pointer;
  font-size: 18px;
}

/* RESPONSIVO */
@media (max-width: 480px) {
  .remote-modal-body {
    padding: 1.5rem;
  }

  .remote-modal-icon {
    font-size: 40px;
  }
}