/* =========================================================
   CONFIGURAÇÕES GERAIS DA PÁGINA
   ========================================================= */

/* Suaviza a rolagem ao navegar por âncoras */
html {
  scroll-behavior: smooth;
}

/* Remove margens padrão e define fundo/texto base da página */
html,
body {
  margin: 0;
  padding: 0;
  background: #f5f7fb;
  color: #1e293b;
}

/* Define a fonte principal do projeto */
body {
  font-family: Arial, Helvetica, sans-serif;
}


/* =========================================================
   NAVBAR FIXA SUPERIOR
   ========================================================= */

/* Barra fixa no topo com leve transparência e blur */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

/* Garante altura confortável para a barra */
.top-navbar .container {
  min-height: 64px;
}

/* Texto da marca na navbar */
.top-navbar-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  letter-spacing: 0.02em;
}

/* Botão do menu lateral */
.menu-trigger {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}


/* =========================================================
   TOPO / MARCA PRINCIPAL
   ========================================================= */

/* Faixa principal onde fica a logo */
.hero-brand {
  background: #f5f7fb;
  padding-top: 0.6rem;   /* espaço entre navbar e logo */
  padding-bottom: 0;
  border-bottom: 1px solid #eef2f7;
}

.hero-brand .container {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Container flexível para centralizar a identidade visual */
.brand-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  line-height: 1;
}

/* Logo principal */
.brand-logo {
  display: block;
  height: auto;
}

/* Versão destacada da logo no topo */
.brand-logo-destaque {
  width: min(280px, 65vw);
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Subtítulo abaixo da logo */
.brand-subtitle {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: -0.2rem;
  margin-bottom: 0.6rem;
  line-height: 1;
  letter-spacing: 0.03em;
  opacity: 0.85;
}


/* =========================================================
   MENU LATERAL (OFFCANVAS)
   ========================================================= */

/* Borda lateral do painel */
.offcanvas {
  border-left: 1px solid #e5e7eb;
}

/* Linha separando cabeçalho do conteúdo */
.offcanvas-header {
  border-bottom: 1px solid #eef2f7;
}

/* Títulos das seções internas do menu lateral */
.menu-section h6 {
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: #0f172a;
}

/* Texto descritivo do menu lateral */
.menu-section p {
  margin-bottom: 0;
  line-height: 1.6;
  color: #475569;
}


/* =========================================================
   ÁREA PRINCIPAL DA SIMULAÇÃO
   ========================================================= */

/* Barra de controles acima da cena */
.scene-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e6edf5;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(6px);
}

/* Largura do select de preset */
.toolbar-select {
  width: 160px;
}

/* Mantém o botão iniciar com largura fixa para não "pular" */
#start {
  width: 220px;
  text-align: center;
  font-weight: 600;
}


/* =========================================================
   CENA / CANVAS
   ========================================================= */

/* Container da cena, usado como referência para overlays */
.scene-wrapper {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Área visual da cena */
.scene,
#scene {
  width: 100%;
  height: clamp(500px, 70vh, 880px);
  min-height: 500px;
  background: linear-gradient(180deg, #f8fafc, #eef4fb);
  border: 1px solid #dbe3ea;
  border-radius: 22px;
  box-shadow:
    0 16px 36px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Canvas do Three.js ocupa toda a área da cena */
#scene canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  border-radius: 12px;
}

/* Destaque sutil ao passar o mouse sobre a cena */
#scene:hover {
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}


/* =========================================================
   OVERLAY DE TEMPO
   ========================================================= */

/* Caixa flutuante do tempo no canto superior direito */
.scene-time-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}


/* =========================================================
   OVERLAY DE VELOCIDADE
   ========================================================= */

/* Caixa flutuante da velocidade no canto inferior direito */
.scene-speed-overlay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.82);
  color: #ffffff;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Ícone/texto do controle de velocidade */
.speed-overlay-label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}

/* Largura mínima do select de velocidade */
.scene-speed-overlay .form-select {
  min-width: 90px;
  border-radius: 8px;
}


/* =========================================================
   PAINEL LATERAL DE PARÂMETROS
   ========================================================= */

/* Bloco principal do painel */
.panel-configuracao {
  padding: 1rem;
  border: 1px solid #e8edf3;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(8px);
}

/* Cabeçalho do painel */
.panel-header {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  box-shadow: none;
}

/* Área interna que empilha os cards */
.panel-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Em telas grandes, deixa o painel fixo ao rolar */
@media (min-width: 992px) {
  .panel-configuracao {
    position: sticky;
    top: 1.5rem;
  }
}

/* =========================================================
   CARDS DOS CORPOS
   ========================================================= */

/* Estrutura externa de cada card */
.card {
  overflow: hidden;
  border: 1px solid #e7edf3;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

/* Cabeçalho do card */
.card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #dbe3ea;
}

/* Botão que abre/fecha cada card */
.card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border: none;
  background: transparent;
  color: #1e293b;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Efeito ao passar o mouse */
.card-toggle:hover {
  background: rgba(13, 110, 253, 0.06);
}

/* Remove contorno padrão do foco */
.card-toggle:focus {
  outline: none;
  box-shadow: none;
}

/* Ícone da seta */
.toggle-icon {
  font-size: 1rem;
  transition: transform 0.25s ease;
}

/* Rotaciona a seta quando o card está aberto */
.card-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}


/* =========================================================
   INPUTS DO FORMULÁRIO
   ========================================================= */

/* Rótulos laterais dos grupos de input */
.input-group-text {
  min-width: 72px;
  justify-content: center;
  font-weight: 600;
  border-color: #dbe3ea;
}

/* Bordas padrão dos campos */
.form-control {
  border-color: #dbe3ea;
}

/* Destaque no foco dos campos */
.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}


/* =========================================================
   RODAPÉ
   ========================================================= */

/* Área inferior do site */
.footer-academico {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.04);
  color: #334155;
}

/* Espaçamento entre linhas do rodapé */
.footer-academico p {
  margin-bottom: 0.25rem;
}

/* Link do rodapé */
.footer-link {
  color: #0d6efd;
  font-weight: 600;
  text-decoration: none;
}

/* Efeito hover do link */
.footer-link:hover {
  text-decoration: underline;
}

.footer-link {
  color: #0d6efd;
  font-weight: 600;
  text-decoration: none;
}


/* =========================================================
   AJUSTES PARA TELAS MUITO GRANDES
   ========================================================= */

/* Aumenta um pouco a largura máxima do container em telas amplas */
@media (min-width: 1400px) {
  .container {
    max-width: 1440px;
  }
}

.container.py-5 {
  margin-top: 0.5rem;
}

/* ================= MENU LATERAL ================= */

.menu-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  color: #0f172a;
}

/* Container dos links */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Link estilo moderno */
.menu-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Hover elegante */
.menu-link:hover {
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
  transform: translateX(3px);
}

/* Ícones mais suaves */
.menu-link span {
  font-size: 0.95rem;
}


.menu-link {
  border: 1px solid transparent;
}

.menu-link:hover {
  border-color: rgba(13, 110, 253, 0.15);
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-bottom: 1rem;
}

.offcanvas-moderno {
  z-index: 1400;
  width: min(360px, 90vw);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-left: 1px solid #e5e7eb;
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.12);
}

.offcanvas-backdrop.show {
  opacity: 0.28;
}

.offcanvas-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid #eef2f7;
}

.menu-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #0f172a;
}

.offcanvas-body {
  padding: 1rem 1rem 1.25rem;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.menu-link:hover {
  background: rgba(13, 110, 253, 0.08);
  border-color: rgba(13, 110, 253, 0.14);
  color: #0d6efd;
  transform: translateX(4px);
}

.menu-icon {
  width: 1.4rem;
  text-align: center;
  font-size: 1rem;
}