/* Critical banner styles loaded before version-switcher JS runs. */
:root {
  --ghidra-banner-height: 44px;
  --ghidra-banner-font-family: "Helvetica Neue", Arial, sans-serif;
}

.ghidra-banner {
  background: rgba(17, 24, 39, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ghidra-banner-height, 44px);
  color: #fff;
  z-index: 2147483647;
  font-family: var(--ghidra-banner-font-family, "Helvetica Neue", Arial, sans-serif);
  box-shadow: 0 0.25rem 0.75rem rgba(15, 23, 42, 0.2);
  box-sizing: border-box;
  overflow: visible;
}

.ghidra-banner__container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: inherit;
  box-sizing: border-box;
}

.ghidra-banner__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: inherit;
}

.ghidra-banner__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: inherit;
  flex-shrink: 0;
}

.ghidra-banner__logo-link {
  display: inline-flex;
  align-items: center;
}

.ghidra-banner__logo {
  height: 26px;
  width: auto;
  display: block;
}

.ghidra-banner__title {
  letter-spacing: 0.01em;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 400;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

a.ghidra-banner__title:hover {
  color: rgba(255, 255, 255, 0.7);
}

a.ghidra-banner__title {
  color: #fff !important;
}

.ghidra-banner__title-short {
  display: none;
}

@media (max-width: 600px) {
  .ghidra-banner__title-full {
    display: none;
  }
  .ghidra-banner__title-short {
    display: inline;
  }
}

.ghidra-banner__select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  min-width: 6rem;
}

.ghidra-banner__select:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

.ghidra-banner__select:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.ghidra-banner__select:focus:not(:focus-visible) {
  outline: none;
}

.ghidra-banner__select option {
  background: #1f2937;
  color: #fff;
}

.ghidra-banner__select--doctype {
  min-width: 7rem;
  max-width: 12rem;
}

.ghidra-banner__select--version {
  min-width: 6rem;
}

.ghidra-banner__button-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ghidra-banner__home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.ghidra-banner__home:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ghidra-banner__home-icon {
  height: 18px;
  width: 18px;
  display: block;
}

.ghidra-banner__history {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
  color: #fff;
}

.ghidra-banner__history:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ghidra-banner__history--active {
  background: rgba(255, 255, 255, 0.15);
}

.ghidra-banner__history-icon {
  height: 18px;
  width: 18px;
  display: block;
}

.ghidra-banner__flash--animate {
  animation: ghidra-banner-flash 1.5s ease-in-out 1;
  animation-fill-mode: both;
}

.ghidra-banner__flash {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2147483646;
  transform: translate(-50%, -50%);
  max-width: min(90vw, 640px);
  padding: 0.35rem 0.9rem;
  background: #b91c1c;
  color: #fff;
  font-family: var(--ghidra-banner-font-family, "Helvetica Neue", Arial, sans-serif);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.25;
  border-radius: 999px;
  box-shadow: 0 0.4rem 0.9rem rgba(127, 29, 29, 0.35);
  box-sizing: border-box;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
}

@keyframes ghidra-banner-flash {
  0% {
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Fix bottom cutoff on new-format Javadoc (10.2+) flex-box layout */
div.flex-box {
  height: calc(100% - var(--ghidra-banner-height, 44px));
}

/* Changelog Sidebar */
.ghidra-changelog-overlay {
  position: fixed;
  top: var(--ghidra-banner-height, 44px);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2147483640;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ghidra-changelog-overlay--visible {
  opacity: 1;
}

.ghidra-changelog-sidebar {
  position: fixed;
  top: var(--ghidra-banner-height, 44px);
  right: 0;
  bottom: 0;
  width: clamp(480px, 42vw, 720px);
  max-width: 90vw;
  background: #fff;
  z-index: 2147483645;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.15s ease;
  display: flex;
  flex-direction: column;
}

.ghidra-changelog-sidebar--visible {
  transform: translateX(0);
}

.ghidra-changelog-sidebar__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 1;
}

.ghidra-changelog-sidebar__close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

.ghidra-changelog-sidebar__content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Sidebar-specific overrides for changelog content (base styles come from changelog.css) */
.ghidra-changelog-sidebar__content .changelog {
  padding: 0;
  margin: 0;
  max-width: none;
}

.ghidra-changelog-sidebar__content .changelog h1 {
  font-size: 1.4em;
  margin-top: -6px;
  padding-right: 40px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ghidra-changelog-sidebar__content .changelog h1::-webkit-scrollbar {
  display: none;
}

.ghidra-changelog-sidebar__content .changelog h2 {
  margin-top: 15px;
  margin-bottom: 8px;
  padding: 6px 10px;
  font-size: 1em;
}

.ghidra-changelog-sidebar__content .changelog .meta {
  font-size: 0.85em;
  margin-bottom: 10px;
}

.ghidra-changelog-sidebar__content .changelog .change {
  border-radius: 6px;
  padding: 8px 10px;
  margin: 4px 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.ghidra-changelog-sidebar__content .changelog .signature {
  font-size: 0.8em;
  padding: 4px 8px;
  margin: 4px 0;
}

.ghidra-changelog-sidebar__content .changelog .version-section {
  margin-bottom: 15px;
}

/* Index page overrides for sidebar */
.ghidra-changelog-sidebar__content .changelog .stats {
  padding: 12px;
  gap: 15px;
  margin: 10px 0;
}

.ghidra-changelog-sidebar__content .changelog .stat-value {
  font-size: 1.5em;
}

.ghidra-changelog-sidebar__content .changelog .type-item {
  padding: 4px 8px;
  margin: 1px 0;
}

.ghidra-changelog-sidebar__content .changelog .type-item a {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ghidra-changelog-sidebar__content .changelog .type-item a::-webkit-scrollbar {
  display: none;
}

.ghidra-changelog-sidebar__content .changelog .change-summary {
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: 8px;
}

.ghidra-changelog-loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.ghidra-changelog-error {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.ghidra-changelog-error a {
  color: #0066cc;
}

/* =============================================================================
   DIFF TOGGLE BUTTON
   ============================================================================= */

.ghidra-banner__diff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
  color: #fff;
}

.ghidra-banner__diff:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ghidra-banner__diff--active {
  background: rgba(255, 255, 255, 0.15);
}

.ghidra-banner__diff-icon {
  height: 18px;
  width: 18px;
  display: block;
}

/* =============================================================================
   THEME TOGGLE BUTTON
   ============================================================================= */

.ghidra-banner__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.ghidra-banner__theme:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ghidra-banner__theme-icon {
  height: 18px;
  width: 18px;
  display: block;
}

/* Icon visibility based on current theme */
.ghidra-banner__theme-icon--sun {
  display: block;
}

.ghidra-banner__theme-icon--moon {
  display: none;
}

html.dark-mode .ghidra-banner__theme-icon--sun {
  display: none;
}

html.dark-mode .ghidra-banner__theme-icon--moon {
  display: block;
}

/* Help menu arrow glyph (help/shared/arrow.gif) needs dark-mode inversion */
html.dark-mode img[src*="shared/arrow.gif" i] {
  filter: brightness(0) invert(1) !important;
}

/* =============================================================================
   DARK MODE - Changelog Sidebar
   ============================================================================= */

html.dark-mode .ghidra-changelog-sidebar {
  background: #1a1f26;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

html.dark-mode .ghidra-changelog-sidebar__close {
  background: rgba(255, 255, 255, 0.08);
  color: #bdc4cc;
}

html.dark-mode .ghidra-changelog-sidebar__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #e7e9ea;
}

html.dark-mode .ghidra-changelog-loading,
html.dark-mode .ghidra-changelog-error {
  color: #bdc4cc;
}

html.dark-mode .ghidra-changelog-error a {
  color: #58a6ff;
}

/* Sidebar-specific dark overrides */
html.dark-mode .ghidra-changelog-sidebar__content .changelog .change {
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
