/* ----------------------------------
 * Action menu
 * ---------------------------------- */

/* Main dialog setup */
[role="dialog"][data-type="action"] {
  background: #2d2d2d;
  overflow: hidden;
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 0 7rem;
  /**
   * Using "font-size: 0" to avoid the unwanted visual space (about 3px) created
   * by white spaces and line breaks in the code between inline-block elements.
   */
  font-size: 0;
  color: #fff;
}

[role="dialog"][data-type="action"]:before {
  content: '';
  display: inline-block;
  vertical-align: top;
  width: 0.1rem;
  height: 100%;
  margin-left: -0.1rem;
}

[role="dialog"][data-type="action"] > header {
  -moz-box-sizing: border-box;
  font-size: 1.6rem;
  background: url(action_menu/images/ui/alpha.png) repeat 0 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 5rem;
  line-height: 4.9rem;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
  overflow: hidden;
  font-weight: normal;
  padding: 0 3rem;
  border-bottom: 0.1rem solid #616262;
}

[role="dialog"][data-type="action"] > header h1 {
  font-size: 1.6rem;
  line-height: 4.9rem;
  text-align: left;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
  overflow: hidden;
  margin: 0;
  height: 100%;
  font-weight: normal;
}

/* Generic set of actions in toolbar */
[role="dialog"][data-type="action"] > header menu[type="toolbar"] {
  height: 100%;
  float: right;
  margin: 0 -3rem 0 1rem;
  padding: 0;
}

[role="dialog"][data-type="action"] > header menu[type="toolbar"] a,
[role="dialog"][data-type="action"] > header menu[type="toolbar"] button {
  -moz-box-sizing: border-box;
  position: relative;
  float: left;
  width: auto;
  min-width: 5rem;
  height: 4.9rem;
  margin-bottom: 0;
  padding: 0 1rem;
  border-radius: 0;
  line-height: 4.9rem;
  background: none;
  text-align: center;
  text-shadow: none;
  z-index: 5;
}

[role="dialog"][data-type="action"] > header a,
[role="dialog"][data-type="action"] > header button {
  border: none;
  padding: 0;
  overflow: hidden;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1em;
  color: #fff;
  border-radius: 0;
  text-decoration: none;
}

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

/* Pressed state */
[role="dialog"][data-type="action"] > header a:active .icon:after,
[role="dialog"][data-type="action"] > header button:active .icon:after,
[role="dialog"][data-type="action"] > header menu[type="toolbar"] a:active,
[role="dialog"][data-type="action"] > header menu[type="toolbar"] button:active  {
  background: #008aaa !important;
}

/* Disabled state */
[role="dialog"][data-type="action"] > header menu[type="toolbar"] a[aria-disabled="true"],
[role="dialog"][data-type="action"] > header menu[type="toolbar"] button[disabled]  {
  opacity: 0.5;
  pointer-events: none;
}

/* Icon definitions */
[role="dialog"][data-type="action"] > header .icon {
  position: relative;
  float: none;
  display: inline-block;
  vertical-align: top;
  width: 4rem;
  height: 4.9rem;
  margin: 0 -1rem;
  background: transparent no-repeat center center / 3rem auto;
  font-size: 0;
  overflow: hidden;
}

[role="dialog"][data-type="action"] > header .icon.icon-close {
  background-image: url(action_menu/images/icons/close.png);
}

[role="dialog"][data-type="action"] > header .icon.icon-back {
  background-image: url(action_menu/images/icons/back.png);
}

/* Navigation links (back, cancel, etc) */
[role="dialog"][data-type="action"] > header > button,
[role="dialog"][data-type="action"] > header > a {
  float: left;
  width: 5rem;
  height: 4.9rem;
  background: none;
  overflow: visible;
  margin: 0 -1rem 0 -3rem;
  position: relative;
}

[role="dialog"][data-type="action"] > header > button:after,
[role="dialog"][data-type="action"] > header > a:after {
  content: "";
  position: absolute;
  left: 0;
  top:0;
  width: 3.2rem;
  height: 4.9rem;
  background: url(action_menu/images/ui/separator.png) no-repeat 3rem top / 0.1rem 4.8rem;
}

[role="dialog"][data-type="action"] > header > button::-moz-focus-inner {
  border: 0;
  padding: 0;
}

[role="dialog"][data-type="action"] > header > button .icon,
[role="dialog"][data-type="action"] > header > a .icon {
  position: static;
  display: block;
  width: 3rem;
  height: 4.9rem;
  margin: 0;
  overflow: visible;
  font-size: 0;
}

[role="dialog"][data-type="action"] > header > button .icon:after,
[role="dialog"][data-type="action"] > header > a .icon:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  width: 3rem;
  height: 4.9rem;
}

/* Content */
[role="dialog"][data-type="action"] > section {
  color: #fff;
  position: absolute;
  top: 7rem;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 2rem;
  font-size: 1.6rem;
  overflow: scroll;
}

/* Specific component code */
[role="dialog"][data-type="action"] > menu {
  margin: 0;
  padding: 0;
  max-height: calc(100% - 13.5rem); /*header(5rem) + footer(7rem) + padding(1.5rem)*/
  height: auto;
  padding-top: 1.5rem;
  overflow: auto;
  width: auto;
  border: none;
  background: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7rem;
}

[role="dialog"][data-type="action"] > menu > button {
  width: calc(100% - 3rem);
  height: 4rem;
  -moz-box-sizing: border-box;
  vertical-align: middle;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  font-weight: normal;
  line-height: 4rem;
  outline: none;
  font-size: 1.6rem;
  text-shadow: none;
  text-align: left;
  padding: 0 1.2rem;
  margin: 0 1.5rem 1rem 1.5rem;
  background: rgba(87, 87, 87, 0.8);
  border: none;
  border-radius: 0;
  position: relative;
  color: #fff;
  font-family: sans-serif;
  font-style: italic;
}

[role="dialog"][data-type="action"] > menu > button:last-child {
  position: fixed;
  bottom: 0;
  left: 0;
  color: #333;
  background: #d8d8d8;
  text-align: center;
  border: none;
  margin-bottom: 1.5rem;
  border-radius: 2rem;
}

[role="dialog"][data-type="action"] > menu > button:last-child:before {
  content: '';
  position: fixed;
  width: 100%;
  background: #2D2D2D;
  height: 7rem;
  left: 0;
  bottom: 0;
  z-index: -1;
}

[role="dialog"][data-type="action"] > menu > button:nth-last-child(2) {
  margin-bottom: 1.5rem;
}

/* Press state */
[role="dialog"][data-type="action"] > menu > button:active {
  background: #00aacc;
  color: #fff;
}

/* Disabled */
[role="dialog"][data-type="action"] > menu > button[disabled] {
  background-color: rgba(87, 87, 87, 0.8);
  color: rgba(255, 255, 255, 0.4);
  opacity: 0.5;
  pointer-events: none;
}

[role="dialog"][data-type="action"] > menu > button[disabled]:last-child {
  background-color: #e7e7e7;
  color: #a6a6a6;
  opacity: 1;
}

/*
 * Right to Left view
 */

html[dir="rtl"] [role="dialog"][data-type="action"]:before {
  margin-left: auto;
  margin-right: -0.1rem;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > header h1 {
  text-align: right;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > header menu[type="toolbar"] {
  float: left;
  margin-left: -3rem;
  margin-right: 1rem;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > header menu[type="toolbar"] a,
html[dir="rtl"] [role="dialog"][data-type="action"] > header menu[type="toolbar"] button {
  float: right;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > header menu[type="toolbar"] a:last-child,
html[dir="rtl"] [role="dialog"][data-type="action"] > header menu[type="toolbar"] button:last-child {
  background-position: right center;
  margin-left: auto;
  margin-right: -0.1rem;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > header > button,
html[dir="rtl"] [role="dialog"][data-type="action"] > header > a {
  float: right;
  margin-left: -1rem;
  margin-right: -3rem;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > header > button:after,
html[dir="rtl"] [role="dialog"][data-type="action"] > header > a:after {
  left: auto;
  right: 0;
  background-position: 0 top;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > header > button .icon:after,
html[dir="rtl"] [role="dialog"][data-type="action"] > header > a .icon:after {
  left: auto;
  right: 0;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > menu > button {
  text-align: right;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > menu > button:last-child {
  left: auto;
  right: 0;
}

html[dir="rtl"] [role="dialog"][data-type="action"] > menu > button:last-child:before {
  left: auto;
  right: 0;
}

