/* ----------------------------------
 * Value selector (Single & Multiple)
 * ---------------------------------- */

/* Main dialog setup */
[role="dialog"][data-type="value-selector"] {
  background: #2d2d2d;
  overflow: hidden;
  position: absolute;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 0 7rem;
  color: #fff;
  font-family: sans-serif;
}

[role="dialog"][data-type="value-selector"] > section {
  padding: 0 1.5rem 0;
  -moz-box-sizing: padding-box;
  width: 100%;
  height: 100%;
}

[role="dialog"][data-type="value-selector"] h1 {
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 4.8rem;
  color: #fff;
  border-bottom: 0.1rem solid #616262;
  background: rgba(0 ,0, 0, .2);
  margin: 0 -1.5rem;
  padding: 0 3rem 1rem;
  height: 4.8rem;
  -moz-box-sizing: border-box;
}

/* Specific component code */
[role="dialog"][data-type="value-selector"] [role="listbox"] {
  position: relative;
  padding: 0;
  margin: 0 -1.5rem;
  max-height: calc(100% - 5rem);
  overflow: auto;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li {
  margin: 0;
  padding: 0 1.5rem;
  height: auto;
  list-style: none;
  position: relative;
  font-weight: 300;
  font-size: 2.2rem;
  line-height: 3.9rem;
  color: #fff;
  transition: background-color 0.2s ease;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li:first-child label {
  border-top-color: transparent;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li label {
  outline: none;
  display: block;
  color: #fff;
  border-top: 0.1rem solid #666;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li label span {
  display: block;
  padding: 1rem 1.5rem;
  line-height: 4rem;
  word-wrap: break-word;
}

/* Pressed status */
[role="dialog"][data-type="value-selector"] [role="listbox"] li:active {
  background-color: #00ABCC;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li:active label,
[role="dialog"][data-type="value-selector"] [role="listbox"] li:active + li label {
  border-top-color: transparent;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li:active label span {
  color: #fff !important;
  background-image: none;
}

/* Subheaders */
[role="dialog"][data-type="value-selector"] [role="listbox"] li[role="subheader"] {
  border: none;
  background-color: #242424;
  pointer-events: none;
  -moz-user-select: none;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li[role="subheader"] label {
  color: #858585;
  font-size: 1.4rem;
  font-weight: 500;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li[role="subheader"] label,
[role="dialog"][data-type="value-selector"] [role="listbox"] li[role="subheader"] + li label {
  border: none;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li[role="subheader"] label span {
  line-height: 2rem;
}

/* Checked status */
[role="dialog"][data-type="value-selector"] [role="listbox"] li[aria-selected="true"] label {
  background: transparent url(value_selector/images/icons/checked.png) right 1.2rem top 50% / 2.4rem no-repeat;
}

[role="dialog"][data-type="value-selector"] [role="listbox"] li[aria-selected="true"] span {
  padding-right: 2.6rem;
  margin-right: 1.2rem;
  color: #00abcd;
}

/* Menu & buttons setup */
.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons {
  white-space: nowrap;
  margin: 0;
  padding: 1.5rem;
  background: #4d4d4d;
  display: block;
  overflow: hidden;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button::-moz-focus-inner {
  border: none;
  outline: none;
}

.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button {
  width: calc((100% - 1rem) / 2);
  font-family: sans-serif;
  font-style: italic;
  height: 4rem;
  margin: 0 0 1rem;
  padding: 0 1.2rem;
  -moz-box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background: #d8d8d8;
  border: none;
  border-radius: 2rem;
  font-weight: normal;
  font-size: 1.6rem;
  line-height: 4rem;
  color: #333;
  text-align: center;
  text-shadow: none;
  text-decoration: none;
  outline: none;
}

/* Affirmative */
.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button.affirmative,
.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button.recommend {
  background-color: #00caf2;
  color: #fff;
}

/* Pressed */
.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button:active {
  background: #00aacc;
  color: #fff;
}

/* Disabled */
[role="dialog"][data-type="value-selector"] > menu.value-selector-buttons > button[disabled] {
  background-color: #565656;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
}

[role="dialog"][data-type="value-selector"] > menu.value-selector-buttons > button[disabled].recommend {
  background-color: #006579;
}

button[disabled]::-moz-selection {
  -moz-user-select: none;
}

.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button:last-child {
  margin-left: 1rem;
}

.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button,
.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button:first-child {
  margin: 0;
}

.value-selector > [role="dialog"][data-type="value-selector"] menu.value-selector-buttons button.full {
  width: 100%;
}

/* Right to left tweaks */
html[dir="rtl"] .value-selector li input:checked + span,
html[dir="rtl"] .value-selector li[aria-selected="true"] span {
  padding-left: 2.6rem;
  padding-right: 1.5rem;
  margin-left: 1.2rem;
  margin-right: 0;
  background-position: 0 50%;
}

html[dir="rtl"] [role="dialog"][data-type="value-selector"] [role="listbox"] li[aria-selected="true"] label {
  background-position: left 1.2rem top 50%;
}

html[dir="rtl"] [role="dialog"][data-type="value-selector"] [role="listbox"] li[aria-selected="true"] span {
  padding-left: 2.6rem;
  padding-right: 0;
}

