/* Copyright (C) 2025 QuantumNous. Licensed under AGPL-3.0-or-later. */
/* One quiet glass treatment for navigation choices; retain native semantics. */
body {
  --yz-choice-fill: rgba(255, 255, 255, 0.25);
  --yz-choice-hover: rgba(255, 255, 255, 0.15);
  --yz-choice-light: rgba(255, 255, 255, 0.42);
  --yz-choice-edge: rgba(255, 255, 255, 0.65);
  --yz-choice-outline: rgba(40, 40, 40, 0.09);
  --yz-choice-shadow: rgba(0, 0, 0, 0.035);
}
body[theme-mode='dark'] {
  --yz-choice-fill: rgba(255, 255, 255, 0.045);
  --yz-choice-hover: rgba(255, 255, 255, 0.035);
  --yz-choice-light: rgba(255, 255, 255, 0.065);
  --yz-choice-edge: rgba(255, 255, 255, 0.22);
  --yz-choice-outline: rgba(255, 255, 255, 0.075);
  --yz-choice-shadow: rgba(0, 0, 0, 0.09);
}

/* Line tabs keep their indicator. Other variants use a single glass capsule. */
.yzcm-glass-shell.yzcm-interior-route .semi-tabs-tab {
  background: transparent !important;
  box-shadow: none;
  transition: background-color 160ms, box-shadow 160ms, color 160ms;
}
.yzcm-glass-shell.yzcm-interior-route
  :is(.semi-tabs-bar-button, .semi-radioGroup-button) {
  background: var(--yz-choice-hover);
  box-shadow: inset 0 0 0 1px var(--yz-choice-outline);
  border-radius: 16px;
  padding: 4px;
}
.yzcm-glass-shell.yzcm-interior-route .semi-tabs-bar-slash {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 0;
  white-space: normal;
}
.yzcm-glass-shell.yzcm-interior-route .semi-tabs-tab-slash {
  float: none;
  margin: 0;
  padding: 8px 13px;
  line-height: 20px;
  border-radius: 999px;
  white-space: nowrap;
}
.yzcm-glass-shell.yzcm-interior-route .semi-tabs-tab-slash::after {
  display: none;
}
.yzcm-glass-shell.yzcm-interior-route
  :is(.semi-tabs-tab-button, .semi-tabs-tab-card) {
  border-color: transparent !important;
  border-radius: 12px;
}
.yzcm-glass-shell.yzcm-interior-route
  :is(.semi-tabs-tab-slash, .semi-tabs-tab-button, .semi-tabs-tab-card):not(
    .semi-tabs-tab-disabled
  ):not(.semi-tabs-tab-active):hover {
  background: var(--yz-choice-hover) !important;
}
.yzcm-glass-shell.yzcm-interior-route
  :is(.semi-tabs-tab-slash, .semi-tabs-tab-button, .semi-tabs-tab-card).semi-tabs-tab-active,
.yzcm-glass-shell.yzcm-interior-route .semi-radio-buttonRadioGroup-checked {
  background: linear-gradient(145deg, var(--yz-choice-light), transparent 70%),
    var(--yz-choice-fill) !important;
  box-shadow: inset 0 1px 0 var(--yz-choice-edge),
    inset 0 0 0 1px var(--yz-choice-outline),
    0 2px 6px var(--yz-choice-shadow);
  color: var(--semi-color-text-0);
}
.yzcm-glass-shell.yzcm-interior-route .semi-radio-buttonRadioGroup {
  background: transparent;
  border-radius: 12px;
  transition: background-color 160ms, box-shadow 160ms;
}
.yzcm-glass-shell.yzcm-interior-route
  .semi-radio-buttonRadioGroup:not(.semi-radio-disabled):not(
    .semi-radio-buttonRadioGroup-checked
  ):hover {
  background: var(--yz-choice-hover);
}
.yzcm-glass-shell.yzcm-interior-route .semi-radio-addon-buttonRadioGroup {
  background: transparent;
}
.yzcm-glass-shell.yzcm-interior-route .semi-tabs-tab:focus-visible,
.yzcm-glass-shell.yzcm-interior-route .semi-radio-buttonRadioGroup:focus-within {
  outline: 2px solid var(--semi-color-focus-border);
  outline-offset: 2px;
}

/* Popups render outside the route wrapper; theme variables live on body. */
body :is(.semi-select-option-selected, .semi-dropdown-item-selected) {
  background: var(--yz-choice-fill) !important;
  box-shadow: inset 0 1px 0 var(--yz-choice-edge);
}
body :is(.semi-select-option-focused, .semi-dropdown-item-active) {
  background: var(--yz-choice-hover) !important;
}
body .semi-select-option-selected.semi-select-option-focused {
  background: var(--yz-choice-fill) !important;
}
.yzcm-glass-shell.yzcm-interior-route .semi-page-item-active {
  background: var(--yz-choice-fill) !important;
  box-shadow: inset 0 1px 0 var(--yz-choice-edge),
    inset 0 0 0 1px var(--yz-choice-outline);
  color: var(--semi-color-text-0);
}

@media (max-width: 600px) {
  .yzcm-glass-shell.yzcm-interior-route .semi-tabs-bar-slash {
    gap: 4px;
  }
  .yzcm-glass-shell.yzcm-interior-route .semi-tabs-tab-slash {
    padding: 7px 10px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .yzcm-glass-shell.yzcm-interior-route .semi-tabs-tab,
  .yzcm-glass-shell.yzcm-interior-route .semi-radio-buttonRadioGroup {
    transition: none;
  }
}
