/* ----------------------------------
* Buttons
* ---------------------------------- */

.button::-moz-focus-inner,
a[role="button"]::-moz-focus-inner,
button::-moz-focus-inner {
  border: none;
  outline: none;
}

button,
a[role="button"],
.button {
  width: 90%;
  height: 1.8rem;
  margin: 0 0 1rem;
  padding: 0 1.5rem;
  -moz-box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background: #fafafa url(../images/ui/default.png) repeat-x left bottom / auto 100%;
  border: 0.1rem solid #a6a6a6;
  border-radius: 0.2rem;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.8rem;
  color: #333;
  text-align: center;
  text-shadow: 0.1rem 0.1rem 0 rgba(255,255,255,0.3);
  text-decoration: none;
  outline: none;
}

/* Press (default & recommend) */
button:active,
a[role="button"]:active,
button.recommend:active,
a.recommend[role="button"]:active {
  border-color: #008aaa;
  background: #008aaa;
  background-size: auto 100%;
  color: #333;
}

/* Recommend */
button.recommend,
a[role="button"].recommend {
  background-image: url(images/ui/recommend.png);
  background-color: #00caf2;
  border-color: #008eab;
}

/* Danger */
button.danger,
a.danger[role="button"],
span.danger[role="button"] {
  background-image: url(images/ui/danger.png);
  background-color: #b70404;
  color: #fff;
  text-shadow: none;
  border-color: #820000;
}

/* Danger Press */
button.danger:active,
a[role="button"].danger:active,
.button.danger:active {
  background-image: url(images/ui/danger-press.png);
  background-color: #890707;
}

/* Disabled (default & recommend) */
button[disabled],
a[role="button"][aria-disabled="true"],
.button[aria-disabled="true"],
button[disabled].recommend,
a[role="button"][aria-disabled="true"].recommend,
.button[aria-disabled="true"].recommend {
  background: #e7e7e7;
  border-color: #c7c7c7;
  color: #c7c7c7;
  text-shadow: none;
  pointer-events: none;
}

/* Danger disabled */
button[disabled].danger,
.button[aria-disabled="true"].danger,
a[role="button"][aria-disabled="true"].danger {
  background: #c68484;
  border-color: #a56464;
  color: #a56464;
  text-shadow: none;
  pointer-events: none;
}

/* Disabled with dark background */
.dark button[disabled],
.dark .button[aria-disabled="true"],
.dark a[role="button"][aria-disabled="true"] {
  background: #5f5f5f;
  color: #4d4d4d;
  border-color: #4d4d4d;
  text-shadow: none;
  pointer-events: none;
}


/* ----------------------------------
* Buttons inside lists
* ---------------------------------- */

li button,
li a[role="button"],
li .button {
  position: relative;
  background: #e7e7e7;
  text-align: left;
  /* For hacking box-shadows we need overflow:visible; so we lose text-overflows...*/
  white-space: normal;
  overflow: visible;
}

/* Hacking box-shadow */
li button:after,
li a[role="button"]:after,
li .button:after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.2rem;
  background: url(images/ui/shadow.png) repeat-x left bottom / auto 100%;
}

/* Press */
li a[role="button"]:active:after,
li .button:active:after,
li button:active:after {
  opacity: 0;
}

/* Disabled */
li button[disabled]:after,
li a[role="button"][aria-disabled="true"]:after,
li .button[aria-disabled="true"]:after {
  background: none;
}

/* Icons */
li button.icon,
li a[role="button"].icon,
li .button.icon {
  padding-right: 3rem;
}

li button.icon:before,
li a[role="button"].icon:before,
li .button.icon:before {
  content: "";
  width: 3rem;
  height: 3rem;
  position: absolute;
  top: 50%;
  right: 0;
  margin-top: -1.5rem;
  background: transparent no-repeat center center / 100% auto;
  pointer-events: none;
}

li button.icon-view:before,
li a[role="button"].icon-view:before {
  background: url(images/icons/view.png) no-repeat 1.6rem 0 / 1rem 9rem;
}

li button.icon-view:active:before,
li a[role="button"].icon-view:active:before {
  background-position: 1.6rem -3rem;
}

li button.icon-view:disabled:before,
li a[role="button"][aria-disabled="true"].icon-view:before {
  background-position: 1.6rem -6rem;
}

li button.icon-dialog,
li a[role="button"].icon-dialog,
li .button.icon-dialog {
  font-size: 1rem;
}

li button.icon-dialog:before,
li a[role="button"].icon-dialog:before,
li .button.icon-dialog:before {
  background: url(images/icons/dialog.png) no-repeat 1.6rem 0 / 1rem 9rem;
  top: 100%;
  margin-top: -2.4rem;
}

li button.icon-dialog:active:before,
li a[role="button"].icon-dialog:active:before,
li .button.icon-dialog:active:before {
  background-position: 1.6rem -3rem;
}

li button.icon-dialog:disabled:before,
li a[role="button"][aria-disabled="true"].icon-dialog:before,
li .button[aria-disabled="true"].icon-dialog:before {
  background-position: 1.6rem -6rem;
}


/* ----------------------------------
* Buttons inside lists, compact mode
* ---------------------------------- */

ul.compact,
ol.compact {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

ul.compact li,
ol.compact li {
  padding: 1.5rem 0 0.5rem 0;
  border-bottom: solid #bdbdbd 0.1rem;
  display: block;
  overflow: hidden;
}

ul.compact li label,
ol.compact li label {
  padding: 0 1.5rem 1rem 1.5rem;
  color: #333;
  font-weight: normal;
  font-size: 1rem;
  line-height: 1.8rem;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Inputs inside of .button */
.button input,
body[role="application"] .button input {
  border: 0;
  background: none;
}

/* Hides dropdown arrow until bug #649849 is fixed */
.button.icon select {
   width: 130%;
}