:root {
  --navy: #0d1335;
  --hot-pink: #ff0099;
  --text: #f5f5fa;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--navy);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.logo {
  /* Source art is black-on-transparent; force it to pure white regardless of
     anti-aliasing so it reads clearly on the navy background. */
  filter: brightness(0) invert(1);
}

#landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  text-align: center;
}

#landing img {
  max-width: 320px;
  width: 100%;
  height: auto;
}

#landing.hidden {
  display: none;
}

.version-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.version-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.version-input,
.product-select {
  appearance: none;
  background: var(--navy);
  color: var(--text);
  border: 1px solid var(--hot-pink);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
}

.version-input {
  min-width: 260px;
}

.version-input:focus,
.product-select:focus {
  outline: 2px solid var(--hot-pink);
}

.version-input:disabled,
.product-select:disabled {
  opacity: 0.6;
}

.version-spinner {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  border: 2px solid rgba(245, 245, 250, 0.25);
  border-top-color: var(--hot-pink);
  border-radius: 50%;
  animation: version-spinner-spin 0.8s linear infinite;
}

.version-spinner.hidden {
  display: none;
}

@keyframes version-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.version-options {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  width: 260px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--navy);
  border: 1px solid var(--hot-pink);
  border-radius: 6px;
  z-index: 10;
}

.version-picker--dropup .version-options {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}

.version-options.open {
  display: block;
}

.version-option {
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.version-option:hover,
.version-option:focus {
  background: var(--hot-pink);
  color: var(--navy);
}

.version-option--empty {
  opacity: 0.6;
  cursor: default;
}

.version-option--empty:hover {
  background: none;
  color: var(--text);
}

.snapshot-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
}

.snapshot-toggle input {
  accent-color: var(--hot-pink);
}

#doc-frame {
  display: none;
  width: 100%;
  height: 100%;
  border: none;
  /* Javadoc (Java 9+) manages its own internal scrolling rather than sizing
     its <body> to full content height, so trying to read the embedded
     document's scrollHeight and grow the iframe to match doesn't work -- it
     just reports back whatever height the iframe already has. Instead, fill
     the space flex-grow leaves after the footer and let javadoc scroll
     itself, the way it already scrolls in a normal top-level tab. */
  flex: 1;
  background-color: var(--navy);
  transition: background-color 0.6s ease;
}

#doc-frame.visible {
  display: block;
}

/* Added once the first version's content finishes loading (see app.js) and
   never removed, so only the very first load fades navy -> white; later
   version switches stay white with no flash back to navy. */
#doc-frame.doc-loaded {
  background-color: #fff;
}

footer {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: var(--navy);
  border-top: 1px solid var(--hot-pink);
  flex: 0 0 auto;
}

footer.visible {
  display: flex;
}

footer img {
  height: 28px;
  width: auto;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

footer a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--hot-pink);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

.github-link svg {
  fill: #fff;
}

.share-button {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--hot-pink);
  font-weight: 600;
}

.share-button:hover {
  text-decoration: underline;
}

.share-button svg {
  fill: var(--hot-pink);
}
