/* http://red-team-design.com/css3-animated-dropdown-menu/ */

/* Reset the default ul styles.*/
#menu, #menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* the main ul for this menu, with CSS3 things like gradients, shadows and rounded corners */  
#menu {
    width: 1050px;
    margin: 5px auto;
    border: 1px solid #222;
    background-color: #111;
    background-image: linear-gradient(#444, #111);
    border-radius: 6px;
/*	-moz-box-shadow: 0 1px 14px #777;
	-webkit-box-shadow: 0 1px 14px #777;*/
    box-shadow: 0 1px 5px #777;
}

/* clearing floats */
#menu:before,
#menu:after {
    content: "";
    display: table;
}
#menu:after {
    clear: both;
}
#menu {
    zoom:1;
}

/* list elements: "a" element is child of "li", "li" element a descendant of the "#menu" */
#menu li {
    float: left;
    border-right: 3px solid #222;
    box-shadow: 1px 0 0 #444;
    position: relative;
}
#menu a {
    float: left;
    padding: 12px 45px;
    color: #CCCCCC;
    text-transform: uppercase;
    font: bold 14px Arial, Helvetica;
    text-decoration: none;
    text-shadow: 0 1px 0 #000;
}
#menu li:hover > a {
    color: #fafafa;
}

/* submenus: with CSS3 transitons we can animate changes to CSS properties like margin or opacity */
#menu ul {
    margin: 20px 0 0 0;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 38px;
    left: 0;
    z-index: 1;    
    background: #444;   
    background: linear-gradient(#444, #111);
    box-shadow: 0 -1px 0 rgba(255,255,255,.3);  
    border-radius: 3px;
    transition: all .2s ease-in-out;
}
#menu li:hover > ul {
    opacity: 1;
    visibility: visible;
    margin: 0;
}
#menu ul ul {
    top: 0;
    left: 150px;
    margin: 0 0 0 20px;
    box-shadow: -1px 0 0 rgba(255,255,255,.3);      
}
#menu ul li {
    float: none;
    display: block;
    border: 0;
    box-shadow: 0 1px 0 #111, 0 2px 0 #666;
}
#menu ul li:last-child {   
    box-shadow: none;    
}
#menu ul a {    
    padding: 10px;
    width: 150px;
    display: block;
    white-space: nowrap;
    float: none;
    text-transform: none;
}
#menu ul a:hover {
    background-color: #933;
    background-image: linear-gradient(#C06, #933);
}

/* first & last elements styles */
#menu ul li:first-child > a {
    border-radius: 3px 3px 0 0;
}
#menu ul li:first-child > a:after {
    content: '';
    position: absolute;
    left: 40px;
    top: -6px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #444;
}
#menu ul ul li:first-child a:after {
    left: -6px;
    top: 50%;
    margin-top: -6px;
    border-left: 0; 
    border-bottom: 6px solid transparent;
    border-top: 6px solid transparent;
    border-right: 6px solid #3b3b3b;
}
#menu ul li:first-child a:hover:after {
    border-bottom-color: #C06; 
}
#menu ul ul li:first-child a:hover:after {
    border-right-color: #0299d3; 
    border-bottom-color: transparent;   
}
#menu ul li:last-child > a {
    border-radius: 0 0 3px 3px;
}
