.question-count-shell {
    position: relative;
    width: 100%;
    margin-top: 6px;
    min-height: 62px;
    z-index: auto;
}

.question-count-shell.is-open {
    z-index: 70000;
}

.question-count-select {
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.04));
    position: relative;
    z-index: auto;
}

.question-count-shell .qc-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 10px 24px rgba(128, 36, 51, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: rotate(0deg);
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.question-count-shell .qc-arrow--open {
    transform: rotate(180deg);
    box-shadow: 0 12px 26px rgba(128, 36, 51, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.question-count-shell .quiz-select__option {
    font-size: 0.98rem;
}

.question-count-shell .quiz-select__control {
    font-weight: 600;
    position: relative;
    z-index: 0;
}

.question-count-fallback {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #ffffff, #f6f7fb);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-color, #232529);
}

.question-count-shell.is-open .quiz-select__control {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.question-count-shell .quiz-select__menu {
  margin-top: 0;
  border-radius: 0 0 16px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-top: none;
  box-shadow: 0 18px 42px rgba(0,0,0,0.16), 0 4px 10px rgba(0,0,0,0.06);
  overflow: hidden;
  position: absolute;
  z-index: 60000;
}

.question-count-shell .quiz-select__menu-list {
  padding-top: 6px;
  padding-bottom: 6px;
}

.question-count-native-wrapper {
  position: relative;
  width: 100%;
}

.question-count-native {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #ffffff, #f6f7fb);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  font-weight: 600;
  color: var(--text-color, #232529);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3crect x='2' y='2' width='16' height='16' rx='6' ry='6' fill='url(%23grad)'/%3e%3cdefs%3e%3clinearGradient id='grad' x1='2' y1='2' x2='18' y2='18' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='%23a8324a'/%3e%3cstop offset='1' stop-color='%23802433'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 40px 40px;
}

.question-count-native:focus {
  outline: none;
  border-color: var(--primary-color, #802433);
  box-shadow: 0 0 0 3px rgba(80, 140, 255, 0.35), 0 14px 38px rgba(0, 0, 0, 0.12);
}

#question-count-select-root {
  transition: opacity .18s ease, filter .18s ease, transform .18s ease;
}

/* Nascondi il selettore quando il glossario è in primo piano */
body.glossary-panel-open #question-count-select-root,
body.glossary-modal-open #question-count-select-root {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(6px);
  pointer-events: none;
}

/* Dark mode overrides */
body.dark-mode .question-count-shell .quiz-select__control {
  background: linear-gradient(135deg, #1a0d14, #2a1220) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  color: #f7e9ed;
}

body.dark-mode .question-count-shell.is-open .quiz-select__control {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .question-count-shell .quiz-select__single-value {
  color: #f7e9ed !important;
  text-shadow: none;
}

body.dark-mode .question-count-shell .quiz-select__placeholder {
  color: rgba(247, 233, 237, 0.7) !important;
}

body.dark-mode .question-count-shell .quiz-select__indicator,
body.dark-mode .question-count-shell .quiz-select__indicator-separator {
  color: #f7e9ed !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

body.dark-mode .question-count-shell .quiz-select__menu {
  background: linear-gradient(145deg, #140a10, #1f0e18) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55) !important;
}

body.dark-mode .question-count-shell .quiz-select__option {
  color: #f7e9ed !important;
  font-weight: 700;
  background: transparent !important;
}

body.dark-mode .question-count-shell .quiz-select__option--is-focused {
  background: rgba(247, 233, 237, 0.08) !important;
}

body.dark-mode .question-count-shell .quiz-select__option--is-selected {
  background: linear-gradient(145deg, rgba(128, 36, 51, 0.26), rgba(128, 36, 51, 0.32)) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
}
