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

/* Main dialog setup */
[role="dialog"][data-type="value-selector"] {
  background: url(value_selector/images/ui/pattern.png) repeat left top, url(value_selector/images/ui/gradient.png) no-repeat left top / 100% 100%;
  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;
}

/* 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.1rem 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 */
[role="dialog"][data-type="value-selector"] menu {
  white-space: nowrap;
  margin: 0;
  padding: 1.5rem;
  background: #2d2d2d url(value_selector/images/ui/pattern.png) repeat left top;
  display: block;
  overflow: hidden;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

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

[role="dialog"][data-type="value-selector"] menu 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 */
[role="dialog"][data-type="value-selector"] menu button.affirmative,
[role="dialog"][data-type="value-selector"] menu button.recommend {
  background-color: #00caf2;
  color: #fff;
}

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

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

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

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

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

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

[role="dialog"][data-type="value-selector"] menu 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;
}

