/*
 * The signed-in navigation (Blueprint 2, Step 15.2). Markup from
 * scripts/page-blocks-lib.js, the menu button from js/app-nav.js.
 *
 * Shared by pages on styles.css and the Scratchpad on app.css, whose colour
 * variables differ, so the colours are written out here.
 */
.app-nav {
  position: relative;
  display: flex;
  align-items: center;
}

.app-nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.app-nav-link:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.app-nav-link[aria-current="page"] {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.app-nav-signout {
  margin-left: 8px;
  padding: 8px 14px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.app-nav-signout:hover {
  background: #334155;
}

.app-nav-toggle {
  display: none;
}

@media (max-width: 900px) {
  .app-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: none;
    cursor: pointer;
  }

  .app-nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #f8fafc;
  }

  .app-nav-toggle:hover,
  .app-nav.open .app-nav-toggle {
    background: rgba(255, 255, 255, 0.08);
  }

  .app-nav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1100;
    min-width: 200px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #0f172a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }

  .app-nav.open .app-nav-menu {
    display: flex;
  }

  .app-nav-link {
    padding: 12px 14px;
  }

  .app-nav-signout {
    margin: 6px 0 0;
    padding: 12px 14px;
    text-align: left;
  }
}
