/*
  Temp Side Menu Integrated CSS

  Collision-avoidance rules:
  - Every component class uses the unique glfm- prefix.
  - Menu selectors are scoped under .glfm-shell.
  - Flyout panels are positioned by temp_side_menu_integrated.js as fixed overlays
    so they are not clipped by a long/scrolling left rail.
*/

.glfm-shell {
  --glfm-rail-bg: #111827;
  --glfm-rail-border: rgba(255, 255, 255, 0.12);
  --glfm-rail-text: #e5e7eb;
  --glfm-rail-muted: #9ca3af;
  --glfm-rail-hover: rgba(255, 255, 255, 0.11);
  --glfm-panel-bg: #ffffff;
  --glfm-panel-border: #d1d5db;
  --glfm-panel-shadow: 0 22px 48px rgba(15, 23, 42, 0.24);
  --glfm-panel-text: #111827;
  --glfm-panel-muted: #6b7280;
  --glfm-panel-hover: #f3f4f6;
  --glfm-accent: #2563eb;
  --glfm-accent-dark: #1d4ed8;
  --glfm-rail-width: 284px;
  --glfm-panel-width: 320px;
  --glfm-panel-gap: 10px;
  --glfm-radius-lg: 22px;
  --glfm-radius-md: 14px;
  --glfm-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  position: fixed;
  z-index: 1000;
  left: 20px;
  top: 20px;
  bottom: 20px;
  width: var(--glfm-rail-width);
  font-family: var(--glfm-font);
  color: var(--glfm-rail-text);
}

.glfm-shell,
.glfm-shell *,
.glfm-shell *::before,
.glfm-shell *::after {
  box-sizing: border-box;
}

.glfm-shell .glfm-rail {
  width: var(--glfm-rail-width);
  max-height: 100%;
  padding: 12px;
  border: 1px solid var(--glfm-rail-border);
  border-radius: var(--glfm-radius-lg);
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.38);
  overflow-y: auto;
  overflow-x: visible;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: rgb(148, 163, 184) rgba(15, 23, 42, 0.86);
}

.glfm-shell .glfm-rail::-webkit-scrollbar {
  width: 14px;
}

.glfm-shell .glfm-rail::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.86);
  border-radius: 999px;
}

.glfm-shell .glfm-rail::-webkit-scrollbar-thumb {
  border: 3px solid rgba(15, 23, 42, 0.86);
  border-radius: 999px;
  background: rgb(148, 163, 184);
}

.glfm-shell .glfm-rail::-webkit-scrollbar-thumb:hover {
  background: rgb(203, 213, 225);
}

.glfm-shell .glfm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glfm-shell .glfm-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  color: #ffffff;
  background: var(--glfm-accent);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.glfm-shell .glfm-brand-text {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.glfm-shell .glfm-rail-list,
.glfm-shell .glfm-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.glfm-shell .glfm-rail-item,
.glfm-shell .glfm-panel-item {
  position: relative;
}

.glfm-shell .glfm-rail-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: var(--glfm-radius-md);
  color: var(--glfm-rail-text);
  text-decoration: none;
  outline: none;
}

.glfm-shell .glfm-rail-link:hover,
.glfm-shell .glfm-rail-link:focus-visible,
.glfm-shell .glfm-rail-item:hover > .glfm-rail-link,
.glfm-shell .glfm-rail-item:focus-within > .glfm-rail-link {
  color: #ffffff;
  background: var(--glfm-rail-hover);
}

.glfm-shell .glfm-rail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.35rem;
  font-weight: bold;
}

.glfm-shell .glfm-rail-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.5rem;
  font-weight: 650;
}

.glfm-shell .glfm-rail-chevron,
.glfm-shell .glfm-panel-chevron {
  color: var(--glfm-rail-muted);
  font-size: 1.15rem;
  line-height: 1;
}

.glfm-shell .glfm-panel {
  --glfm-panel-left: calc(20px + var(--glfm-rail-width) + var(--glfm-panel-gap));
  --glfm-panel-top: 24px;

  position: fixed;
  z-index: 1001;
  top: var(--glfm-panel-top);
  left: var(--glfm-panel-left);
  width: var(--glfm-panel-width);
  min-height: 236px;
  max-height: calc(100vh - 48px);
  padding: 14px;
  border: 1px solid var(--glfm-panel-border);
  border-radius: var(--glfm-radius-lg);
  color: var(--glfm-panel-text);
  background: var(--glfm-panel-bg);
  box-shadow: var(--glfm-panel-shadow);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: none;
  transition: opacity 140ms ease, visibility 140ms ease;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: rgb(148, 163, 184) rgb(241, 245, 249);
}

.glfm-shell .glfm-panel::-webkit-scrollbar {
  width: 14px;
}

.glfm-shell .glfm-panel::-webkit-scrollbar-track {
  background: rgb(241, 245, 249);
  border-radius: 999px;
}

.glfm-shell .glfm-panel::-webkit-scrollbar-thumb {
  border: 3px solid rgb(241, 245, 249);
  border-radius: 999px;
  background: rgb(148, 163, 184);
}

.glfm-shell .glfm-panel::-webkit-scrollbar-thumb:hover {
  background: rgb(100, 116, 139);
}

.glfm-shell .glfm-rail-item:hover > .glfm-panel,
.glfm-shell .glfm-rail-item:focus-within > .glfm-panel,
.glfm-shell .glfm-panel-item:hover > .glfm-panel,
.glfm-shell .glfm-panel-item:focus-within > .glfm-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.glfm-shell .glfm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.glfm-shell .glfm-eyebrow {
  margin: 0 0 2px;
  color: var(--glfm-accent-dark);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glfm-shell .glfm-panel-title {
  margin: 0;
  color: var(--glfm-panel-text);
  font-size: 1.5rem;
  line-height: 1.2;
}

.glfm-shell .glfm-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--glfm-accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.glfm-shell .glfm-panel-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--glfm-radius-md);
  color: var(--glfm-panel-text);
  background: transparent;
  text-decoration: none;
  outline: none;
}

.glfm-shell .glfm-panel-link:hover,
.glfm-shell .glfm-panel-link:focus-visible,
.glfm-shell .glfm-panel-item:hover > .glfm-panel-link,
.glfm-shell .glfm-panel-item:focus-within > .glfm-panel-link {
  background: var(--glfm-panel-hover);
}

.glfm-shell .glfm-panel-link small {
  display: block;
  margin-top: 3px;
  color: var(--glfm-panel-muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.glfm-shell .glfm-panel-link > span:first-child {
  min-width: 0;
}

.glfm-shell .glfm-panel-separator {
  height: 1px;
  margin: 6px 12px;
  background: #e5e7eb;
}

.glfm-demo-content {
  min-height: 100vh;
  padding: 56px 56px 56px 248px;
  color: #111827;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32rem),
    linear-gradient(135deg, #f8fafc, #eef2ff);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.glfm-demo-content h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.15;
}

.glfm-demo-content p {
  max-width: 760px;
  color: #4b5563;
  line-height: 1.65;
}

.glfm-demo-content code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.08);
}

@media (max-width: 960px) {
  .glfm-shell {
    --glfm-rail-width: 164px;
    --glfm-panel-width: 270px;
    left: 12px;
  }

  .glfm-demo-content {
    padding-left: 204px;
  }
}
