/* assets/css/layout.css */

/* ============================================================
   layout.css — Navbar, Footer, Container e Grid
   ============================================================ */
/* Navbar Fixa */
.navbar {
  height: var(--navbar-h);
  padding: 0.5rem 0;
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--divider);
  box-shadow: var(--shadow-sm);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  transition: background-color 0.3s ease;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--text-color) !important;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.8;
}

.brand-logo {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 6px 18px rgba(0, 0, 0, 0.08);
  padding: 6px;
  object-fit: contain;
  vertical-align: middle;
  border: 1px solid var(--divider);
}

.brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
  line-height: 1;
  color: var(--text-color);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--muted-color);
  margin: 0;
}

/* Navbar Links */
.navbar-nav .nav-link {
  color: var(--text-color) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-nav .nav-link:hover {
  color: var(--bs-primary) !important;
}

.navbar-nav .nav-link.active {
  color: var(--bs-primary) !important;
  border-bottom: 2px solid var(--bs-primary);
}

/* Dropdown Menu */
.dropdown-menu {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-md);
}

.dropdown-item {
  color: var(--text-color);
  transition: background-color 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--bg-page);
  color: var(--bs-primary);
}

.dropdown-divider {
  border-color: var(--divider);
}

/* Footer — segue o fluxo do documento (não fixo).
   Com body.d-flex.flex-column.min-vh-100 + main.flex-grow-1,
   o footer fica colado ao rodapé quando o conteúdo é curto
   e rola com a página quando há overflow. */
.app-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-inner {
  max-width: 1400px;
  width: 100%;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.app-footer .text-muted {
  color: var(--muted-color) !important;
  font-size: 0.9rem;
}

.app-footer a.text-muted:hover {
  color: var(--bs-primary) !important;
}

.app-footer a {
  color: var(--muted-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: var(--bs-primary);
}

.app-footer i {
  vertical-align: middle;
  margin-bottom: 2px; /* Ajuste fino para alinhar com a linha de base do texto */
}

/* Main Content */
main {
  flex-grow: 1;
  padding-top: calc(var(--navbar-h) + var(--navbar-extra-gap));
  padding-bottom: 2rem;
}

.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 10px;
}

/* Breadcrumbs */
.breadcrumb {
  background: transparent;
  padding: 0;
}

.breadcrumb-item {
  color: var(--cro-green);
}

.breadcrumb-item a {
  color: var(--cro-green);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--muted-color);
}

/* Container Fluid */
.container-fluid {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Grid Responsivo */
.row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

/* Overlay de Carregamento */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.orbita-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 2rem;
}

.nucleo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: var(--cro-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 3px solid rgba(21, 154, 73, 0.3);
  border-radius: 50%;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.overlay-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.overlay-sub {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

/* Responsividade */
@media (max-width: 768px) {
  .navbar-brand {
    gap: 0.5rem;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    padding: 4px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: 0.65rem;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 0 !important;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
