/* App Layout
   - Grid/flex containers, shell sizing, scroll containers
   - No component-specific styling here
*/

.app-root {
  display: flex;
  flex: 1;
  min-height: 100vh;
  width: 100%;
}

.side-nav {
  width: 230px;
  background: radial-gradient(circle at top left, #151729 0, #060711 60%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 18px;
  position: relative;
}

.app-main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(20, 22, 36, 0.96), rgba(5, 5, 9, 0.98));
  min-height: 100vh;
  height: 100vh;
}

header.app-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: radial-gradient(circle at top left, rgba(127, 90, 240, 0.12), transparent 60%);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-main {
  display: block;
  padding: 16px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* Scrollbars (match chat look) */
.app-main {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.app-main::-webkit-scrollbar { width: 6px; }
.app-main::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; }

@media (max-width: 720px) {
  .side-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  }

  .side-nav::-webkit-scrollbar { width: 6px; }
  .side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; }
}

/* When chat is open, remove outer padding so chat hugs the edges */
.chat-open .app-main {
  padding: 0;
}

.section-header {
}

/* Mobile: keep footer (version + links) visible at bottom of side menu */
@media (max-width: 720px) {
  .side-nav {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(120px + env(safe-area-inset-bottom)); /* space for elevated sticky footer */
  }
  .nav-footer {
    margin-top: auto;
    padding-top: 8px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(10,10,20,0.2), rgba(10,10,20,0.35));
    position: sticky;
    bottom: 80px; /* elevate footer to avoid cutoff */
    z-index: 2;
  }
}
