/* Shared buttons and tabs of the modals and the game menu (colors, gradients and shadows from theme.css) */
/* Feature stylesheets only add their layout (width, flex, margins) on top of these classes */

/* Back (to the previous step, page or window): a chevron icon in the top left corner, the counterpart of the close
   cross on the right (it takes the look of close-button-transparent symbol-button, see new.css) */
.modal button.modal-back {
  left: 6px;
  right: auto;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal button.modal-back .material-icons {
  font-size: 18px;
}

/* Clicks on the icon land on the button itself (see Modal.__buttonClick) */
.modal button.modal-back * {
  pointer-events: none;
}

/* Nothing to go back to (e.g., the first step or the home page) */
.modal button.modal-back.hidden {
  display: none;
}

/* Native check boxes and radio buttons (e.g., the window filters, Hide Unusable and the use modes of Edit Hotkey) are
   checked in the accent color; toggle switches have their own look (settings-switch, see settings.css) */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--color-accent);
}

/* Tab bar: rounded tabs in a darker bar, the selected tab has the accent border, background and text */
.ui-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid black;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}

.ui-tab {
  margin: 0;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: bold;
  color: white;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border: 1px solid black;
  border-radius: 5px;
  background-image: var(--gradient-surface);
  box-shadow: var(--shadow-raised);
}

.ui-tab:not(.selected):hover {
  border-color: black;
  background-image: var(--gradient-surface-hover);
}

.ui-tab.selected {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-image: var(--gradient-accent);
  box-shadow: var(--shadow-accent);
}

/* Tabs with an icon before the label (e.g., the Character and Party pages of the game menu) */
.ui-tab.with-icon {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ui-tab.with-icon * {
  pointer-events: none;
}

.ui-tab.with-icon svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Page of a tab: only the page of the selected tab is shown, with the same fade as the game menu pages */
.ui-tab-page {
  display: none;
  flex-direction: column;
}

.ui-tab-page.active {
  display: flex;
  animation: game-menu-page-in 0.18s ease-out;
}

/* Buttons: the footer buttons of every modal and buttons with the ui-button class */
/* The confirm action of a footer (and the accent variant) is gold, danger actions (danger variant) are red */
.modal .modal-footer button,
.modal button.ui-button {
  margin: 2px;
  padding: 5px 14px;
  font-size: 11px;
  border: 1px solid black;
  border-radius: 5px;
  background-image: var(--gradient-surface);
  box-shadow: var(--shadow-raised);
}

.modal .modal-footer button:not(:disabled):hover,
.modal button.ui-button:not(:disabled):hover {
  border-color: var(--color-accent);
  background-image: var(--gradient-surface-light);
}

.modal .modal-footer button[action="confirm"],
.modal .modal-footer button[action="confirm-edit"],
.modal button.ui-button.accent {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background-image: var(--gradient-accent);
}

.modal .modal-footer button[action="confirm"]:not(:disabled):hover,
.modal .modal-footer button[action="confirm-edit"]:not(:disabled):hover,
.modal button.ui-button.accent:not(:disabled):hover {
  background-image: var(--gradient-accent);
  box-shadow: var(--shadow-accent);
}

.modal button.ui-button.danger {
  color: var(--color-danger);
  border-color: var(--color-danger-dark);
  background-image: var(--gradient-danger);
}

.modal button.ui-button.danger:not(:disabled):hover {
  border-color: var(--color-danger);
  background-image: var(--gradient-danger);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 6px var(--color-danger-glow);
}

/* Footers with an extra action that is neither confirm nor cancel (e.g., Reset to Defaults): it sits on the far left */
.modal .modal-footer.footer-with-extra {
  display: flex;
  align-items: center;
}

.modal .modal-footer.footer-with-extra .footer-extra {
  margin-right: auto;
}

.modal .modal-footer button:disabled,
.modal button.ui-button:disabled {
  cursor: default;
  opacity: 0.4;
  filter: grayscale(1);
  border-color: black;
  box-shadow: var(--shadow-raised);
}
