/* exam-select2.css
 * Purpose: Select2 styling for ExamItems (baseline = Practice Setup: Subject).
 * Encoding: UTF-8 with BOM
 */

/* Select2 tuning (match Practice Setup - Subject as baseline) */
.select2-container { max-width: 100%; }

/* Default: respect element width (we set width:'style' or '100%' in JS). */
.select2-container { width: auto; }

/* Selection (the closed control) */
.select2-container--bootstrap-5 .select2-selection {
  border-radius: 14px;
  min-height: 42px;
  border-color: rgba(0,0,0,.15);
}

/* Make single-select vertically centered */
.select2-container--bootstrap-5 .select2-selection--single {
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  padding-left: 0;
  padding-right: 24px; /* leave room for arrow */
  line-height: 1.2;
}
.select2-container--bootstrap-5 .select2-selection__arrow {
  height: 42px;
  top: 0;
}

/* If Select2 auto-applies size=sm (from .form-select-sm), override to baseline size */
.select2-container--bootstrap-5.select2-container--sm .select2-selection {
  border-radius: 14px;
  min-height: 42px;
}
.select2-container--bootstrap-5.select2-container--sm .select2-selection--single {
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.select2-container--bootstrap-5.select2-container--sm .select2-selection__arrow {
  height: 42px;
  top: 0;
}

/* Dropdown */
/* Reduce seam between select and options: same border color + subtle shadow */
.select2-dropdown {
  border-radius: 14px;
  overflow: hidden;
  border-color: rgba(0,0,0,.15);
  box-shadow: 0 10px 24px rgba(17,24,39,.12);
}

/* When open: make the control visually connect to dropdown */
.select2-container--open .select2-selection {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
.select2-container--open .select2-dropdown {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  margin-top: -1px; /* overlap borders to avoid a hard seam */
}

/* Dashboard: keep small width, but make it look like PracticeSetup select */
#dashDays + .select2-container--bootstrap-5 .select2-selection,
#dashDays + .select2-container--bootstrap-5.select2-container--sm .select2-selection {
  border-radius: 14px;
  min-height: 42px;
}
#dashDays + .select2-container--bootstrap-5 .select2-selection--single,
#dashDays + .select2-container--bootstrap-5.select2-container--sm .select2-selection--single {
  padding: 0 14px;
}

/* WrongBook: keep small width on top filter, but match baseline */
#wbDays + .select2-container--bootstrap-5 .select2-selection,
#wbDays + .select2-container--bootstrap-5.select2-container--sm .select2-selection {
  border-radius: 14px;
  min-height: 42px;
}
#wbDays + .select2-container--bootstrap-5 .select2-selection--single,
#wbDays + .select2-container--bootstrap-5.select2-container--sm .select2-selection--single {
  padding: 0 14px;
}

/* WrongBook modal selects */
#wbModalStrategy + .select2-container--bootstrap-5 .select2-selection,
#wbModalTotal + .select2-container--bootstrap-5 .select2-selection,
#wbModalDifficulty + .select2-container--bootstrap-5 .select2-selection {
  border-radius: 14px;
  min-height: 42px;
}
#wbModalStrategy + .select2-container--bootstrap-5 .select2-selection--single,
#wbModalTotal + .select2-container--bootstrap-5 .select2-selection--single,
#wbModalDifficulty + .select2-container--bootstrap-5 .select2-selection--single {
  padding: 0 14px;
}

/* Report tab */
#rptWrongFilter + .select2-container--bootstrap-5 .select2-selection,
#rptWrongSubjectFilter + .select2-container--bootstrap-5 .select2-selection,
#rptPracticeSubject + .select2-container--bootstrap-5 .select2-selection,
#rptPracticeDifficulty + .select2-container--bootstrap-5 .select2-selection {
  border-radius: 14px;
  min-height: 42px;
}
#rptWrongFilter + .select2-container--bootstrap-5 .select2-selection--single,
#rptWrongSubjectFilter + .select2-container--bootstrap-5 .select2-selection--single,
#rptPracticeSubject + .select2-container--bootstrap-5 .select2-selection--single,
#rptPracticeDifficulty + .select2-container--bootstrap-5 .select2-selection--single {
  padding: 0 14px;
}

/* Prevent Select2 dropdown from causing page-level overflow/scrollbars */
html, body { overflow-x: hidden; }
.select2-container--open .select2-dropdown { max-width: calc(100vw - 24px); box-sizing: border-box; }

/* Keep dropdown above other UI */
.select2-container--open { z-index: 2001; }
