/* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES.
 * All rights reserved.
 * SPDX-License-Identifier: Apache-2.0 */

/* Selector CSS for NVIDIA-themed API docs.
 * Keep this limited to the post-processing elements injected by customize_doc.py.
 */

:root {
  --nvidia-selector-green: #76b900;
  --nvidia-selector-text: #1a1a1a;
  --nvidia-selector-surface: #f7f7f7;
  --nvidia-selector-underline: #d9d9d9;
  --nvidia-selector-shadow: rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] {
  --nvidia-selector-text: #eee;
  --nvidia-selector-surface: #1a1a1a;
  --nvidia-selector-underline: #444;
  --nvidia-selector-shadow: rgba(0, 0, 0, 0.45);
}

.rapids-home-container__home-btn {
  position: relative;
  display: block;
  padding: 0.5em 0;
}

.rapids-home-container__home-btn::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.25em;
  vertical-align: -0.125em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2 1.5 6.4l.9 1.1L3.5 6.6v6.9h3.4V9.8h2.2v3.7h3.4V6.6l1.1.9.9-1.1L8 1.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2 1.5 6.4l.9 1.1L3.5 6.6v6.9h3.4V9.8h2.2v3.7h3.4V6.6l1.1.9.9-1.1L8 1.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.rapids-selector__container,
.rapids-home-container {
  text-align: left;
}

.rapids-selector__container {
  position: relative;
}

.rapids-selector__container * {
  box-sizing: border-box;
}

.rapids-home-container__home-btn,
.rapids-home-container__home-btn:visited,
.rapids-home-container__home-btn:hover,
.rapids-selector__selected {
  color: var(--nvidia-selector-green);
  font-weight: 700;
  text-decoration: none;
  background-image: linear-gradient(
    var(--nvidia-selector-underline) 0%,
    var(--nvidia-selector-underline) 100%
  );
  background-repeat: repeat-x;
  background-position: 0 100%;
  background-size: 1px 1px;
}

.rapids-selector__selected:hover,
.rapids-home-container__home-btn:hover {
  background-image: linear-gradient(
    rgba(118, 185, 0, 0.45) 0%,
    rgba(118, 185, 0, 0.45) 100%
  );
  background-size: 1px 1px;
}

.rapids-selector__selected {
  cursor: pointer;
  padding: 0.5em 2em 0.5em 0;
}

.rapids-selector__selected::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transition: transform 250ms ease-in-out;
  transform: rotate(225deg);
  transform-origin: 65% 65%;
}

.rapids-selector--hidden .rapids-selector__selected::after {
  transform: rotate(45deg);
}

#rapids-pydata-container .rapids-selector__selected::after {
  position: absolute;
  top: 0.85em;
  right: 0.75em;
}

.rapids-selector__menu {
  position: absolute;
  z-index: 10000;
  background-color: var(--nvidia-selector-surface);
  min-width: 100%;
  left: 0;
  box-shadow: 0 5px 5px -3px var(--nvidia-selector-shadow),
    0 8px 10px 1px var(--nvidia-selector-shadow),
    0 3px 14px 2px var(--nvidia-selector-shadow);
  overflow: hidden;
  transition: all 250ms ease-in-out;
}

.rapids-selector--hidden .rapids-selector__menu {
  height: 0 !important;
  visibility: hidden;
}

.rapids-selector__menu-item {
  display: block;
  padding: 0.5em;
  white-space: nowrap;
}

a.rapids-selector__menu-item,
a.rapids-selector__menu-item:visited {
  color: var(--nvidia-selector-text);
}

a.rapids-selector__menu-item:hover,
a.rapids-selector__menu-item--selected,
a.rapids-selector__menu-item--selected:visited {
  text-decoration: none;
  background-color: var(--nvidia-selector-green);
  color: #000;
}

a.rapids-selector__menu-item--selected {
  cursor: default;
}

.label-title {
  margin: 0;
  font-size: inherit !important;
  vertical-align: inherit !important;
  font-weight: bold;
}

/* Account for the post-processed selector block above the PyData sidebar links. */
@media (min-width: 720px) {
  @supports (position: -webkit-sticky) or (position: sticky) {
    .bd-links {
      max-height: calc(100vh - 18rem);
    }
  }
}
