/* Settings dropdown menu */
/* ====================== */
.settings-menu-container {
  margin-left: 0.5rem;
}

/* Gear button: tint the generic icon-toggle highlight with the navbar text
   colour. All behaviour comes from .pg-dropdown-toggle--icon in dropdown.css. */
.settings-menu-button {
  --pg-dd-icon-accent: var(--pg-navbar-color);
}

.settings-menu {
  min-width: 14rem;
  max-width: 16rem;
  width: max-content;

  padding: 0;

  font-size: 0.9rem;

  @media (width <=576px) {
    min-width: min(14rem, calc(100vw - 2rem));
    max-width: calc(100vw - 1rem);
  }
}

.settings-menu-item {
  padding: 0.7rem 0.6rem;

  border-bottom: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);

  &:last-child {
    border-bottom: none;
  }

  & div {
    display: flex;
    align-items: center;

    column-gap: 0.6rem;
  }
}

/* Group wrapping the view + admin switch cards under a heading,
   mirroring the Theme/Style picker groups. */
.pg-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;

  /* Stretch each switch card (and any controller wrapper around it) full width */
  & > div {
    align-self: stretch;
  }

  & .pg-switch {
    flex: 1 1 auto;
  }
}

/* Switch rows use the reusable `.pg-switch` component (see switch.css). */

/* Theme picker */
/* ============ */
.pg-theme-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pg-theme-picker-heading {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color);
}

.pg-theme-picker-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pg-theme-picker-mode-label {
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
}

.pg-theme-picker-row {
  display: flex;
  gap: 0.4rem;
}

.pg-theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;

  padding: 0.25rem;
  border: 2px solid var(--bs-border-color);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
  flex: 1;

  &:hover {
    border-color: var(--bs-secondary-color);
  }

  &.pg-theme-btn--active {
    border-color: var(--bs-primary);
    outline: none;
  }

  &:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 1px;
  }
}

.pg-theme-swatch {
  display: block;
  width: 2.4rem;
  height: 1.4rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Swatch split: top = navbar colour, bottom = body colour */
.pg-theme-swatch--light-amber {
  background: linear-gradient(to bottom, #f5a623 50%, #ffffff 50%);
}

.pg-theme-swatch--light-slate {
  background: linear-gradient(to bottom, #2c4a6e 50%, #f7f9fb 50%);
}

.pg-theme-swatch--light-sage {
  background: linear-gradient(to bottom, #3d7055 50%, #f5faf6 50%);
}

.pg-theme-swatch--light-rose {
  background: linear-gradient(to bottom, #9e3050 50%, #fdf7f8 50%);
}

.pg-theme-swatch--light-indigo {
  background: linear-gradient(to bottom, #3d35b0 50%, #f8f7ff 50%);
}

.pg-theme-swatch--light-teal {
  background: linear-gradient(to bottom, #0d7377 50%, #f4fbfb 50%);
}

.pg-theme-swatch--dark-charcoal {
  background: linear-gradient(to bottom, #262626 50%, #212529 50%);
}

.pg-theme-swatch--dark-midnight {
  background: linear-gradient(to bottom, #1b2c4a 50%, #0d1925 50%);
}

.pg-theme-swatch--dark-ember {
  background: linear-gradient(to bottom, #2a160a 50%, #1a0e06 50%);
}

.pg-theme-swatch--dark-forest {
  background: linear-gradient(to bottom, #132212 50%, #0a150a 50%);
}

.pg-theme-swatch--dark-violet {
  background: linear-gradient(to bottom, #1c1040 50%, #100a28 50%);
}

.pg-theme-swatch--dark-ocean {
  background: linear-gradient(to bottom, #07232f 50%, #041520 50%);
}

.pg-theme-label {
  font-size: 0.65rem;
  line-height: 1;
  color: var(--bs-body-color);
  white-space: nowrap;
}

/* Style variant swatches */
/* ====================== */
.pg-style-swatch {
  display: block;
  width: 2.4rem;
  height: 1.4rem;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
}

/* Classic: medium-radius card mockup, flat */
.pg-style-swatch--classic {
  background: var(--bs-secondary-bg, #f0f0f0);
}

.pg-style-swatch--classic::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 3px;
  border: 1px solid var(--bs-border-color, #ccc);
  background: var(--bs-body-bg, #fff);
}

/* Outlined: 2px border card with left accent stripe */
.pg-style-swatch--outlined {
  background: var(--bs-secondary-bg, #f0f0f0);
}

.pg-style-swatch--outlined::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 1px;
  border: 2px solid var(--bs-border-color, #999);
  border-left: 4px solid var(--pg-accent, #f5a623);
  background: var(--bs-body-bg, #fff);
}

/* Compact: sharp square card, dense */
.pg-style-swatch--compact {
  background: var(--bs-secondary-bg, #f0f0f0);
  display: grid;
  grid-template-rows: 5px 1fr;
}

.pg-style-swatch--compact::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 0;
  border: 1px solid var(--bs-border-color, #aaa);
  background: var(--bs-body-bg, #fff);
}

.pg-style-swatch--compact::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  height: 4px;
  background: var(--bs-border-color, #aaa);
}