/* The parent of the input - made to look like a text field */
.theme-foundation {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    color: #bfbfbf;
    color: rgba(0, 0, 0, 0.75); /* IE8 will ignore this */
    display: inline-block;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 32px;
    margin: 0;
    overflow: hidden;
    padding: 0;
    position: relative;
    text-overflow: ellipsis;
    transition: all 0.15s linear;
    vertical-align: top;
    white-space: nowrap;
    width: 350px;
}


/* The actual input - made opaque but styled so the cursor positions well */
.theme-foundation input[type="file"] {
    border: none;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    font-size: inherit;
    height: 100%;
    line-height: 32px;
    left: 0;
    margin: 0;
    opacity: 0;
    outline: none;
    padding: 0 5px;
    position: absolute;
    top: 0;
    width: 100%;
}
/*
 * This makes the cursor appear nicely within the field when you tab into it in IE10/IE11
 * (target IE10/11 but not 9 - http://www.impressivewebs.com/ie10-css-hacks/)
 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .theme-foundation input[type="file"] {
        line-height: normal;
    }
}


/* The field value */
.theme-foundation[data-ffi-value]:after {
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    color: #bfbfbf;
    content: attr(data-ffi-value);
    display: block;
    font-style: normal;
    overflow: hidden;
    padding: 0 7px;
    text-overflow: ellipsis;
    z-index: -1;
}


/* The "browse" button */
.theme-foundation:before {
    background: #008CBA;
    border-left: 1px solid #ccc;

    -moz-box-sizing: border-box;
    box-sizing: border-box;
    color: #fff;
    content: attr(data-ffi-button-text);
    float: right;
    line-height: 32px;
    margin: 0;
    padding: 0 12px;
    white-space: nowrap;
    transition: background-color 300ms ease-out;
}

/* various states for interaction */
.theme-foundation:hover:before {
    color: #fff;
    background: #007BA1;
}
.theme-foundation:active:before,
.theme-foundation:active:hover:before,
.theme-foundation:focus:before,
.theme-foundation:focus:hover:before {
    background: #EBEBEB;
    border-color: #ADADAD;
}
.theme-foundation:active:before,
.theme-foundation:active:hover:before {
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

/* focused */
.theme-foundation.is-focused {
    background: #FAFAFA;
    border-color: #999;
    box-shadow: 0 0 5px #999;
    outline: none;
}

/* invalid state*/
.theme-foundation.is-invalid {
    border-color: #F04124;
}
.theme-foundation.is-invalid.is-focused {
    box-shadow: none;
}
.theme-foundation.is-invalid:before {
    background: #F04124;
    border-color: #F04124;
}
.theme-foundation.is-invalid.is-active:before {
    background: #F04124;
    border-color: #F04124;
}
.theme-foundation.is-invalid[data-ffi-value]:after {
    color: #F04124;
}

/* disabled */
.theme-foundation.is-disabled {
    background: #DDD;
}
.theme-foundation.is-disabled:hover {
    background: #DDD;
    border-color: #ccc;
}
.theme-foundation.is-disabled:before {
    background: #008CBA;
    color: #fff;
    opacity: .65;
    filter: alpha(opacity=65);
}
.theme-foundation.is-disabled:hover:before,
.theme-foundation.is-disabled:active:before,
.theme-foundation.is-disabled:active:hover:before,
.theme-foundation.is-disabled:focus:before,
.theme-foundation.is-disabled:focus:hover:before {
    background: #008CBA;
    color: #fff;
}


/* The clear field button */
.theme-foundation > .ffi-clear {
    background: url(../dist/clear.png) no-repeat 0 0;
    background-image: url(../dist/clear.svg);
    border: none;
    color: #333;
    cursor: pointer;
    float: right;
    height: 16px;
    line-height: 16px;
    margin: 8px;
    opacity: 0.56;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0.56)";
    overflow: hidden;
    padding: 0;
    position: relative;
    text-align: left;
    text-indent: 999em;
    white-space: nowrap;
    width: 16px;
}
.theme-foundation > .ffi-clear:hover {
    opacity: 1;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";
}


@media all and (max-width : 500px) {
    .theme-foundation {
        height: 34px;
    }
    .theme-foundation[data-ffi-value] {
        height: 68px;
    }
    .theme-foundation {
        width: 100%;
    }
    .theme-foundation:before {
        border-left: none;
        border-top: 1px solid #ccc;
        bottom: 0;
        right: 0;
        left: 0;
        position: absolute;
        text-align: center;
        width: auto !important;
    }
    .theme-foundation[data-ffi-value]:before {
        border-top: 1px solid #ccc;
    }
}