/* NeuroHealth Layout Styles - Sidebar & Topbar (Electric Cyan & Midnight Blue Theme) */

:root {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --topbar-height: 70px;
}

/* Page wrapper configuration */
body.nh-layout-active {
  background: #070B14 !important;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Hide default template footer on internal layouts */
body.nh-layout-active #footer {
  display: none !important;
}

/* Main Layout Flex Container */
.nh-layout-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background: #070B14;
}

/* 1. SIDEBAR LATERAL ESQUERDA */
.nh-sidebar {
  width: var(--sidebar-width);
  background: #0B1220;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1030;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

/* Logo container inside sidebar */
.nh-sidebar-logo-box {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
}

.nh-sidebar-logo-dna {
  width: 32px;
  height: 42px;
  position: relative;
  flex: 0 0 auto;
}

.nh-sidebar-logo-dna:before,
.nh-sidebar-logo-dna:after {
  content: "";
  position: absolute;
  inset: 1px 4px;
  border: 1.5px solid var(--cyan);
  border-left: 0;
  border-right: 0;
  border-radius: 50%;
  transform: rotate(23deg);
  opacity: 0.95;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.35));
}

.nh-sidebar-logo-dna:after {
  transform: rotate(-23deg);
  opacity: 0.72;
}

.nh-sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cyan-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Sidebar Menu Items */
.nh-sidebar-menu {
  flex: 1;
  padding: 1.5rem 0.75rem;
  list-style: none;
  margin: 0;
  overflow-y: auto;
}

.nh-sidebar-section-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted-2);
  letter-spacing: 0.15em;
  padding: 0.5rem 0.75rem;
  margin-top: 1.25rem;
  white-space: nowrap;
}

.nh-sidebar-item {
  margin-bottom: 0.25rem;
}

.nh-sidebar-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--muted) !important;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  gap: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nh-sidebar-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nh-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text) !important;
  transform: translateX(2px);
}

.nh-sidebar-link.active {
  color: var(--text) !important;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--cyan);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.12);
}

/* Colapsado (Desktop Collapsed State) */
@media (min-width: 992px) {
  .nh-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
  }
  
  .nh-sidebar.collapsed .nh-sidebar-logo-text,
  .nh-sidebar.collapsed .nh-sidebar-section-title,
  .nh-sidebar.collapsed .nh-nav-text {
    opacity: 0;
    pointer-events: none;
    display: none;
  }
  
  .nh-sidebar.collapsed .nh-sidebar-logo-box {
    justify-content: center;
    padding: 0;
  }
  
  .nh-sidebar.collapsed .nh-sidebar-link {
    justify-content: center;
    padding: 10px 0;
  }

  .nh-sidebar.collapsed .nh-sidebar-menu {
    padding: 1.5rem 0.5rem;
  }
}

/* 2. AREA DE CONTEUDO À DIREITA */
.nh-content-wrapper {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Adjust margin-left when sidebar is collapsed */
@media (min-width: 992px) {
  .nh-sidebar.collapsed + .nh-content-wrapper,
  .nh-sidebar.collapsed ~ .nh-content-wrapper {
    margin-left: var(--sidebar-collapsed-width) !important;
  }
}

/* 3. TOPBAR/NAV SUPERIOR */
.nh-topbar-layout {
  height: var(--topbar-height);
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.nh-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nh-hamburger {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--cyan-soft);
  font-size: 1.25rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.nh-hamburger:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--cyan);
}

.nh-topbar-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cyan-soft);
  margin: 0;
}

.nh-topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nh-topbar-user {
  text-align: right;
  line-height: 1.3;
}

.nh-topbar-username {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  display: block;
}

.nh-topbar-role {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 4. MAIN CONTENT CONTAINER */
.nh-main-content {
  flex: 1;
  padding: 2rem;
  min-height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
}

.nh-page-container {
  flex: 1;
  width: 100%;
}

/* 5. RESPONSIVIDADE (MOBILE & TABLET DRAWER) */
@media (max-width: 991.98px) {
  .nh-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  
  .nh-sidebar.active {
    transform: translateX(0);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
  }
  
  .nh-content-wrapper {
    margin-left: 0 !important;
  }
  
  .nh-topbar-layout {
    padding: 0 1rem;
  }

  /* Overlay para fechar sidebar no mobile */
  .nh-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1025;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  
  .nh-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
}

/* 6. RESPONSIVIDADE MOBILE OTIMIZADA */
@media (max-width: 768px) {
  .nh-main-content {
    padding: 1rem 0.5rem !important;
  }

  .nh-page {
    padding: 1.25rem 0.85rem !important;
    border-radius: var(--radius-sm) !important;
    margin-top: 0.5rem !important;
  }

  .nh-topbar-title {
    font-size: 1rem !important;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .table th, .table td {
    padding: 8px 10px !important;
    font-size: 0.82rem !important;
    white-space: nowrap;
  }

  .card-body, .wp-card-body {
    padding: 1rem !important;
  }
}
