/*********
 * Menus *
 *********/

.context-menu {
	font: initial;
	text-shadow: none;
}

menu,
.menu {
    background-color: @menu_bg_dark_color;
    background-image: -gtk-gradient (linear,
                                     left top, left bottom,
                                     from (shade(@menu_bg_dark_color, 1.03)),
                                     to   (shade(@menu_bg_dark_color, 0.97)));
    border-style: solid;
    border-width: 1px;
    border-radius: 0px;
    border-color: shade(@menu_bg_dark_color, 0.97);
    border-image:     none;
}

menu button,
.menu button {
    padding: 0px;
    background-image: none;
    background-color: shade (@menu_bg_dark_color, 0.95);
    color: mix (@menu_fg_dark_color, @menu_bg_dark_color, 0.3);
    box-shadow: none;
    border-image: none;
    border-style: none;
}

menu button:hover,
.menu button:hover {
    background-color: shade (@menu_bg_dark_color, 1.07);
    background-image: -gtk-gradient (linear,
                                     left top, left bottom,
                                     from (@menu_bg_dark_color),
                                     to (shade(@menu_bg_dark_color, 0.96)));
    border-radius: 0;
    border-style: none;
    border-width: 1px;
    border-image: none;
}

menu button:disabled,
.menu button:disabled {
	background-color: transparent;
    color: mix (@menu_fg_dark_color, @menu_bg_dark_color, 0.6);
	border-image: none;
	border-style: none;
	text-shadow: none;
}

/* this controls the general appearance of the menubar */
menubar,
.menubar {
    -GtkWidget-window-dragging: true;
    /* line 3D  (dark) */
    box-shadow: inset  0px -1px @menu_line_dark_color;
    /* line 3D at the buttom of the menu bar */
    border-width: 0px 0px 1px 0px;
    border-style: solid;
    border-radius: 0px;
    border-color: transparent;
    border-bottom-color:  shade(@theme_bg_dark_color, 1.60);
    background-color: shade (@theme_bg_dark_color, 1.00);
    color: @menu_fg_dark_color;
    min-height: 18px;
}

menubar > menuitem,
.menubar > menuitem {
    padding: 5px 5px;
    transition: all 300ms ease-out;
    border-radius: 0px;
    border-width: 0px;
    min-height: 18px;
}

menubar > menuitem:hover,
.menubar > menuitem:hover {
    background-color: shade (@theme_bg_dark_color, 1.2);
    border-radius: 4px;
    color: shade (@theme_selected_bg_color, 1.2);
    text-shadow: none;
    background-image: -gtk-gradient (linear,
                                     left top, left bottom,
                                     from (shade(@menu_bg_dark_color, 2.03)),
                                     to   (shade(@menu_bg_dark_color, 1.17)));
    box-shadow: inset  0px  1px shade(@selected_bg_color, 1.05),
                inset  1px  0px shade(@selected_bg_color, 0.97),
                inset -1px  0px shade(@selected_bg_color, 0.93),
                inset  0px -1px shade(@selected_bg_color, 0.93);
}

menu > menuitem,
.menu > menuitem {
    background-color: @menu_bg_dark_color;
    transition: all 300ms ease-out;
    border-radius: 0px;
    color: @menu_fg_dark_color;
    text-shadow: none;
    padding: 5px 5px;
    min-height: 18px;
}

menu > menuitem:active,
menu > menuitem:hover,
.menu > menuitem:active,
.menu > menuitem:hover {
    background-color: shade (@theme_bg_dark_color, 1.2);
    background-image: -gtk-gradient (linear,
                                     left top, left bottom,
                                     from (shade(@menu_bg_dark_color, 2.03)),
                                     to   (shade(@menu_bg_dark_color, 1.17)));
    color: shade (@theme_selected_bg_color, 1.2);
    text-shadow: none;
    border-radius: 4px;
    border-width: 1px;
    border-image: none;
    padding: 5px 5px;
    box-shadow: inset  0px  1px shade(@selected_bg_color, 1.05),
                inset  1px  0px shade(@selected_bg_color, 0.97),
                inset -1px  0px shade(@selected_bg_color, 0.93),
                inset  0px -1px shade(@selected_bg_color, 0.93);
}

menu > menuitem:disabled,
.menu > menuitem:disabled {
    background-color: @menu_bg_dark_color;
    color: mix (@menu_fg_dark_color, @menu_bg_dark_color, 0.4);
    text-shadow: none;
}

menu > menuitem accelerator,
.menu > menuitem accelerator {
    color: alpha (@menu_fg_dark_color, 0.8);
}

menu > menuitem:disabled > label > accelerator,
.menu > menuitem:disabled > label > accelerator {
    color: alpha (mix (@menu_fg_dark_color, @menu_bg_dark_color, 0.4), 0.8);
    text-shadow: none;
}

menu > menuitem:hover > label > accelerator,
.menu > menuitem:hover > label > accelerator {
    color: alpha (@theme_selected_fg_color, 0.8);
}

menuitem:disabled image,
.menuitem:disabled image,
menuitem:active:disabled image,
.menuitem:active:disabled image{
	 opacity: 0.5;
}

/* combobox menus */
combobox #gtk-combobox-popup-menu menuitem cellview {
    text-shadow: none;
    color: @menu_fg_dark_color;
}

combobox #gtk-combobox-popup-menu menuitem:hover cellview {
    text-shadow: none;
    color: shade (@theme_selected_bg_color, 1.6);
}

menuitem > arrow {
    min-height: 16px;
    min-width: 16px;
    margin-left: 10px;
    color: @menu_fg_color;
}

menu > menuitem > arrow:dir(ltr),
.menu > menuitem > arrow:dir(ltr) {
	-gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
}

menu > menuitem > arrow:dir(rtl),
.menu > menuitem > arrow:dir(rtl) {
        -gtk-icon-source: -gtk-icontheme("pan-end-symbolic-rtl");
}

menu > arrow.top,
.menu > arrow.top {
      -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
}

menu > arrow.bottom,
.menu > arrow.bottom {
      -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
}

/* settings for 4 menu level, this is needed to override the menuitem:hover
   state from previous menu level, as GtkArrow itself don't support states very well.
   thanks gtk+ devs for this madness */
menu > menuitem > arrow.right,
menu > menuitem:hover menu > menuitem > arrow.right,
menu > menuitem:hover menu > menuitem:hover menu > menuitem > arrow.right,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem > arrow.right,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem > arrow.right,
menu > menuitem > arrow.left,
menu > menuitem:hover menu > menuitem > arrow.left,
menu > menuitem:hover menu > menuitem:hover menu > menuitem > arrow.left,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem > arrow.left,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem > arrow.left,
.menu > menuitem > arrow.right,
.menu > menuitem:hover .menu > menuitem > arrow.right,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem > arrow.right,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem > arrow.right,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem > arrow.right,
.menu > menuitem > arrow.left,
.menu > menuitem:hover .menu > menuitem > arrow.left,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem > arrow.left,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem > arrow.left,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem > arrow.left  {
    color: @menu_fg_dark_color;
}

menu > menuitem:hover > arrow.right,
menu > menuitem:hover menu > menuitem:hover arrow.right,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover arrow.right,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover arrow.right,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover arrow.right,
menu > menuitem:hover > arrow.left,
menu > menuitem:hover menu > menuitem:hover arrow.left,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover arrow.left,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover arrow.left,
menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover menu > menuitem:hover arrow.left,
.menu > menuitem:hover > arrow.right,
.menu > menuitem:hover .menu > menuitem:hover arrow.right,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover arrow.right,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover arrow.right,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover arrow.right,
.menu > menuitem:hover > arrow.left,
.menu > menuitem:hover .menu > menuitem:hover arrow.left,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover arrow.left,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover arrow.left,
.menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover .menu > menuitem:hover arrow.left {
    color: shade (@theme_selected_bg_color, 0.8);
   -gtk-icon-shadow:  0px  1px shade (@menu_fg_dark_color, 1.0),
                      1px  0px shade (@menu_fg_dark_color, 1.0),
                     -1px  0px shade (@menu_fg_dark_color, 1.0),
                      0px -1px shade (@menu_fg_dark_color, 1.0);
}

menu > menuitem:disabled > arrow,
.menu > menuitem:disabled > arrow {
    background-color: @menu_bg_dark_color;
    color: mix (@menu_fg_dark_color, @menu_bg_dark_color, 0.4);
   -gtk-icon-shadow: none;
}

/* scroll arrows */
menu > arrow,
.menu > arrow {
    border-color: transparent;
    background-color: transparent;
    background-image: none;
    min-height: 16px;
    min-width: 16px;
    padding: 4px;
    color: @menu_fg_dark_color;
}

menu > arrow.top,
.menu > arrow.top {
    margin-top: -2px;
    margin-left: -1px;
    margin-right: -1px;
}

menu > arrow.bottom,
.menu > arrow.bottom {
    margin-bottom: -2px;
    margin-left: -1px;
    margin-right: -1px;
}

menu > arrow:hover,
.menu > arrow:hover {
    color: shade (@theme_selected_bg_color, 0.8);
   -gtk-icon-shadow:  0px  1px shade (@menu_fg_dark_color, 1.0),
                      1px  0px shade (@menu_fg_dark_color, 1.0),
                     -1px  0px shade (@menu_fg_dark_color, 1.0),
                      0px -1px shade (@menu_fg_dark_color, 1.0);
    background-color: shade (@theme_bg_dark_color, 1.2);
    background-image: -gtk-gradient (linear,
                                     left top, left bottom,
                                     from (shade(@menu_bg_dark_color, 2.03)),
                                     to   (shade(@menu_bg_dark_color, 1.17)));
    text-shadow: none;
    border-radius: 0px;
    border-width: 1px;
    border-image: none;
    padding: 5px 5px;
    box-shadow: inset  0px  1px shade(@selected_bg_color, 1.05),
                inset  1px  0px shade(@selected_bg_color, 0.97),
                inset -1px  0px shade(@selected_bg_color, 0.93),
                inset  0px -1px shade(@selected_bg_color, 0.93);
}

menu > arrow:disabled,
.menu > arrow:disabled {
    color: mix (@menu_fg_color, @menu_bg_color, 0.6);
   -gtk-icon-shadow: none;
    background-color: transparent;
    border-color: transparent;
}

menu separator,
.menu separator,
menuitem separator {
    min-height: 1px;
    background-color: shade(@menu_fg_dark_color, 0.3);
    border-image: -gtk-gradient (linear,
                                 left top, right top,
                                 from (alpha (#000, 0.00)),
                                 color-stop (0.25, alpha (#000, 0.03)),
                                 color-stop (0.85, alpha (#000, 0.03)),
                                 to (alpha (#000, 0.00))) 1;
}

/* fix for broken firefox */
menu separator {
    color: shade(@menu_fg_dark_color, 0.3);
}

menuitem check,
menuitem radio,
menuitem check:hover,
menuitem radio:hover,
menuitem check:checked,
menuitem radio:checked,
menuitem check:disabled,
menuitem radio:disabled,
menuitem check:checked:disabled,
menuitem radio:checked:disabled,
menuitem check:indeterminate:disabled,
menuitem radio:indeterminate:disabled,
menuitem .check,
menuitem .radio,
menuitem .check:hover,
menuitem .radio:hover,
menuitem .check:checked,
menuitem .radio:checked,
menuitem .check:disabled,
menuitem .radio:disabled,
menuitem .check:checked:disabled,
menuitem .radio:checked:disabled,
menuitem .check:indeterminate:disabled,
menuitem .radio:indeterminate:disabled {
    border-width: 0px;
    border-style: none;
    background-image: none;
    background-color: transparent;
	min-height: 12px;
	min-width: 12px;
	background-position: center center;
    color: @menu_fg_dark_color;
}

menuitem check:disabled,
menuitem radio:disabled,
menuitem check:checked:disabled,
menuitem radio:checked:disabled,
menuitem check:indeterminate:disabled,
menuitem radio:indeterminate:disabled,
menuitem .check:disabled,
menuitem .radio:disabled,
menuitem .check:checked:disabled,
menuitem .radio:checked:disabled,
menuitem .check:indeterminate:disabled,
menuitem .radio:indeterminate:disabled {
    color: mix (@menu_fg_dark_color, @menu_bg_dark_color, 0.6);
    text-shadow: none;
}

/***************
 * Menu Button *
 ***************/

toolbar button.popup:selected,
toolbar .raised button.popup:selected,
button.popup:selected,
.linked button.popup:selected,
toolbar .linked.raised button.popup:selected {
/*	background-image: none;
	background-color: @menu_bg_color;
	border-image: none;
	border-color: @menu_bg_color;
	border-radius: 4px 4px 0 0;
	color: @theme_text_color;*/
}

button.popup:selected,
.linked button.popup:selected,
toolbar .linked.raised button.popup:selected {
	text-shadow: none;
	-gtk-icon-shadow: none;
	box-shadow: none;
}

.linked button.popup:selected:last-child,
toolbar .linked.raised button.popup:selected:last-child {
	border-top-left-radius: 0;
}

.linked button.popup:selected:first-child,
toolbar .linked.raised button.popup:selected:first-child {
	border-top-right-radius: 0;
}

menubar button.popup:selected {
	background-image: none;
	background-color: @menu_bg_color;
	border-radius: 4px 4px 0 0;
	border-image: none;
	border-width: 1px 1px 0 1px;
	border-color: @menu_bg_color;
	border-style: solid;
}

menubar button.popup:selected,
button.popup:selected,
toolbar button.popup:selected {
	color: @theme_text_color;
}

menu button.popup {
	text-shadow: none;
}

