/*
 *  (c) 2000-2013 deviantART, Inc. All rights reserved.
 */
.ddbox .awarded {
    color: #8a9f91;
}
.filmBubble .gr-darkbox {
    width: 800px;
    margin: 0px auto;
}
.gr-darkbox .dd-tile {
    background: transparent url(/minish/deviation/dd_tile.gif) repeat-y 0 0;
    bottom:4px;top:4px;left:-1px;
    position:absolute;
    width: 35px;
    z-index: 20;
}
.gr-darkbox .ddbox {
}
.gr-darkbox .dd-icon {
    background: transparent url(/minish/deviation/dd_icon.gif) no-repeat center center;
    width: 35px;
    height: 100%;
}
.gr-darkbox .dd-content {
    margin-left: 40px;
}
.gr-darkbox .dd-heading {
    float:left;
    width:180px;
    margin:30px 0;
}
.dd-text {
    margin-top:12px;
}
.gr-darkbox i.dd1, .gr-darkbox i.dd2 {
    position: absolute;
    width: 35px;
    height: 8px;
    left: -1px;
    z-index: 40;
    background: transparent url(/minish/deviation/dd_caps__.gif) no-repeat;
}
.gr-darkbox i.dd1 {
    top: 0px;
    background-position: top left;
}
.gr-darkbox i.dd2 {
    bottom: 0px;
    background-position: bottom right;
}

/* Helper mixins */
.colormixin(@color:false) when not (@color=false) {color: @color;}
.bgcolormixin(@color:false) when not (@color=false) {background-color: @color;}
.bordercolormixin(@color:false) when not (@color=false) {border-color: @color;}

.widthmixin(@width:false) when not (@width=false) {width: @width;}
.minwidthmixin(@width:false) when not (@width=false) {min-width: @width;}
.maxwidthmixin(@width:false) when not (@width=false) {max-width: @width;}

.heightmixin(@height:false) when not (@height=false) {height: @height;}
.minheightmixin(@height:false) when not (@height=false) {min-height: @height;}
.maxheightmixin(@height:false) when not (@height=false) {max-height: @height;}

/* Helper variable for retina media queries */
@retina : ~"(-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (min-resolution: 2dppx), (min-resolution: 192dpi)";

/*
 * helper function for .linear-gradient
 * see http://blog.philipbrown.id.au/2012/09/base64-encoded-svg-gradient-backgrounds-in-less/ 
 * @encode - string of svg xml
 */
.base64DataUriBackground (@encode, @type: ~"image/svg+xml") {
    @dataUriPrefix: ~"url(data:@{type};base64,";
    @dataUriSuffix: ~")";
 
    // because our lessc doesn't give access to btoa()
    // we have to make our own
    @b64DataUri: ~`(function(a,b,c){function e(a){a=a.replace(/\r\n/g,'\n');var b='';for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128){b+=String.fromCharCode(d)}else if(d>127&&d<2048){b+=String.fromCharCode(d>>6|192);b+=String.fromCharCode(d&63|128)}else{b+=String.fromCharCode(d>>12|224);b+=String.fromCharCode(d>>6&63|128);b+=String.fromCharCode(d&63|128)}}return b}function f(a){var b='';var c,f,g,h,i,j,l;var m=0;a=e(a);while(m<a.length){c=a.charCodeAt(m++);f=a.charCodeAt(m++);g=a.charCodeAt(m++);h=c>>2;i=(c&3)<<4|f>>4;j=(f&15)<<2|g>>6;l=g&63;if(isNaN(f)){j=l=64}else if(isNaN(g)){l=64}b=b+d.charAt(h)+d.charAt(i)+d.charAt(j)+d.charAt(l)}return b}var d='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';return a+f(b)+c})('@{dataUriPrefix}','@{encode}','@{dataUriSuffix}')`;
 
    background: @b64DataUri;
}

/*
 * @angle - 1st param (eg 45deg, top, to left bottom)
 * @legacy_color - Color if no gradient at all is available
 * @ie_gradient_type - 0 (vertical) or 1 (horizontal).  If anybody wants to write a filter to deduce this 
 *                     angle, have at it
 */
.linear-gradient(@start_color, @end_color) {
    .linear-gradient(top, @start_color, @end_color, @start_color);
}
.linear-gradient(@angle, @start_color, @end_color) {
    .linear-gradient(@angle, @start_color, @end_color, @start_color);
}
.linear-gradient(@angle, @start_color, @end_color, @legacy_color: @start_color, @ie_gradient_type: 0) {
    @svg: ~'<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><linearGradient id="grad-ucgg-generated" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" stop-color="@{start_color}" stop-opacity="1"/><stop offset="100%" stop-color="@{end_color}" stop-opacity="1"/></linearGradient><rect x="0" y="0" width="1" height="1" fill="url(#grad-ucgg-generated)" /></svg>';
 
    
    /* base background */
    background: @legacy_color;
    
    /* IE9 you so special */
    .ie.eq9 & {
        .base64DataUriBackground(@svg);
    }
    /* IE8 is the bad kind of special */
    .ie.lt9 & {
        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@{start_color}', endColorstr='@{end_color}',GradientType=@ie_gradient_type );
    }
    
    /* hooray modern browsers */
    background: -webkit-linear-gradient(@angle, @start_color, @end_color);
    background: -moz-linear-gradient(@angle, @start_color, @end_color);
    background: linear-gradient(@angle, @start_color, @end_color);
}


/*
 * This is not compatible with IE8, don't use it if you have to support old IE
 * 
 * @lhs - Left hand side (height, width, whatever)
 * @rhs - Right hand side, whatever your calculation is.  You probably need a ~
 *
 * Example: .calc(height, ~"100% - 50px")
 *
 * Note, using a guard because less doesn't seem to like using a variable for lhs
 * Annoying, but don't know what else to do
 *
 * http://caniuse.com/calc
 */
.calc(@lhs, @rhs) when (@lhs = width) {
    width: -webkit-calc(@rhs);
    width: calc(@rhs);
}
.calc(@lhs, @rhs) when (@lhs = height) {
    height: -webkit-calc(@rhs);
    height: calc(@rhs);
}
.calc(@lhs, @rhs) when (@lhs = left) {
    left: -webkit-calc(@rhs);
    left: calc(@rhs);
}
.calc(@lhs, @rhs) when (@lhs = right) {
    right: -webkit-calc(@rhs);
    right: calc(@rhs);
}
.calc(@lhs, @rhs) when (@lhs = top) {
    top: -webkit-calc(@rhs);
    top: calc(@rhs);
}
.calc(@lhs, @rhs) when (@lhs = bottom) {
    bottom: -webkit-calc(@rhs);
    bottom: calc(@rhs);
}


/*
 * Not compatible with IE8 or IE9 (nothing breaks, they just don't get transitions)
 */
.transition(@arg) {
    -moz-transition: @arg;
    -webkit-transition: @arg;
    transition: @arg;
}

.transition(@transition, @duration, @timingFunction: ease-in-out ) when (@transition = transform) {
    -webkit-transition: -webkit-transform @duration @timingFunction;
    -moz-transition: -moz-transform @duration @timingFunction;
    -ms-transition: -ms-transform @duration @timingFunction;
    transition: transform @duration @timingFunction;
}

/*
 * Not supported in <=IE8
 */
.transform(@arg) {
    -ms-transform: @arg;
    -webkit-transform: @arg;
    transform: @arg;
}

.transform-scale(@arg) {
    -ms-zoom: @arg;
    -ms-transform: scale(@arg);
    -webkit-transform: scale(@arg);
    transform: scale(@arg);
}

.transform-origin(@arg) {
    -ms-transform-origin: @arg;
    -moz-transform-origin: @arg;
    -webkit-transform-origin: @arg;
    transform-origin: @arg;
}

.box-sizing(@arg) {
    -moz-box-sizing: @arg;
    -webkit-box-sizing: @arg;
    box-sizing: @arg;
}

.filter(@arg) {
    -ms-filter: @arg;
    -moz-filter: @arg;
    -webkit-filter: @arg;
    filter: @arg;
}

.border-radius(@arg) {
    border-radius: @arg;
}

.box-shadow (@arg) {
    -webkit-box-shadow: @arg;
    box-shadow: @arg;
}

.user-select(@arg) {
    -ms-user-select: @arg;
    -moz-user-select: @arg;
    -webkit-user-select: @arg;
    user-select: @arg;
}

.backface-visibility(@arg) {
    -webkit-backface-visibility: @arg;
    backface-visibility: @arg;
}

.perspective(@arg) {
    -webkit-perspective: @arg;
    perspective: @arg;
}

.cursor-zoom-in(@arg) {
    cursor: @arg;
    cursor: -webkit-zoom-in;
    cursor: -moz-zoom-in;
}

.cursor-zoom-out(@arg) {
    cursor: @arg;
    cursor: -webkit-zoom-out;
    cursor: -moz-zoom-out;
}

.appearance(@arg) {
    -webkit-apperance: @arg;
    -moz-appearance: @arg;
}

.text-size-adjust(@arg) {
    -webkit-text-size-adjust: @arg;
    -moz-text-size-adjust: @arg;
    -ms-text-size-adjust: @arg;
}

/* 
 *  Make something spin for infinite time, one rotation per @interval 
 *  example: .spin(3000ms)
*/
.spin(@interval) {
    -webkit-animation-name: spin;
    -webkit-animation-duration: @interval;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;
    -moz-animation-name: spin;
    -moz-animation-duration: @interval;
    -moz-animation-iteration-count: infinite;
    -moz-animation-timing-function: linear;
    -ms-animation-name: spin;
    -ms-animation-duration: @interval;
    -ms-animation-iteration-count: infinite;
    -ms-animation-timing-function: linear;
    animation-name: spin;
    animation-duration: @interval;
    animation-iteration-count: infinite;
    animation-timing-function: linear;

    @-ms-keyframes spin {
        from { -ms-transform: rotate(0deg); }
        to { -ms-transform: rotate(360deg); }
    }
    @-moz-keyframes spin {
        from { -moz-transform: rotate(0deg); }
        to { -moz-transform: rotate(360deg); }
    }
    @-webkit-keyframes spin {
        from { -webkit-transform: rotate(0deg); }
        to { -webkit-transform: rotate(360deg); }
    }
    @keyframes spin {
        from { transform:rotate(0deg); }
        to { transform:rotate(360deg); }
    }
}

/*
 * CSS3 multi-column layout.
 * Won't do anything for IE8 or 9.
 */
.column-count(@arg) {
    -moz-column-count: @arg;
    -webkit-column-count: @arg;
    column-count: @arg;
}
.column-gap(@arg) {
    -moz-column-gap: @arg;
    -webkit-column-gap: @arg;
    column-gap: @arg;
}

/*
 * Input placeholder text
 */
.placeholder-font-style(@style){
    &::-webkit-input-placeholder {
        font-style: @style;
    }
    &:-moz-placeholder {
        font-style: @style;
    }
    &::-moz-placeholder {
        font-style: @style;
    }
    &:-ms-input-placeholder {
        font-style: @style;
    }
}
.placeholder-color(@color: false, @bgcolor: false, @bordercolor: false){
    &::-webkit-input-placeholder {
        .colormixin(@color);
        .bgcolormixin(@bgcolor);
        .bordercolormixin(@bordercolor);
    }
    &:-moz-placeholder {
        .colormixin(@color);
        .bgcolormixin(@bgcolor);
        .bordercolormixin(@bordercolor);
    }
    &::-moz-placeholder {
        .colormixin(@color);
        .bgcolormixin(@bgcolor);
        .bordercolormixin(@bordercolor);
    }
    &:-ms-input-placeholder {
        .colormixin(@color);
        .bgcolormixin(@bgcolor);
        .bordercolormixin(@bordercolor);
    }
}

/* Full-screen mixin */
.full-screen-width(@width: false, @minwidth: false, @maxwidth: false) {
    &:-webkit-full-screen {
        .widthmixin(@width);
        .minwidthmixin(@minwidth);
        .maxwidthmixin(@maxwidth);
    }
    &:-moz-full-screen {
        .widthmixin(@width);
        .minwidthmixin(@minwidth);
        .maxwidthmixin(@maxwidth);
    }
    &:-ms-full-screen {
        .widthmixin(@width);
        .minwidthmixin(@minwidth);
        .maxwidthmixin(@maxwidth);
    }
    &:-o-full-screen {
        .widthmixin(@width);
        .minwidthmixin(@minwidth);
        .maxwidthmixin(@maxwidth);
    }
    &:full-screen {
        .widthmixin(@width);
        .minwidthmixin(@minwidth);
        .maxwidthmixin(@maxwidth);
    }
}
.full-screen-height(@height: false, @minheight: false, @maxheight: false) {
    &:-webkit-full-screen {
        .heightmixin(@height);
        .minheightmixin(@minheight);
        .maxheightmixin(@maxheight);
    }
    &:-moz-full-screen {
        .heightmixin(@height);
        .minheightmixin(@minheight);
        .maxheightmixin(@maxheight);
    }
    &:-ms-full-screen {
        .heightmixin(@height);
        .minheightmixin(@minheight);
        .maxheightmixin(@maxheight);
    }
    &:-o-full-screen {
        .heightmixin(@height);
        .minheightmixin(@minheight);
        .maxheightmixin(@maxheight);
    }
    &:full-screen {
        .heightmixin(@height);
        .minheightmixin(@minheight);
        .maxheightmixin(@maxheight);
    }
}

