/*!
 * Copyright 2017 Banco Bilbao Vizcaya Argentaria, S.A.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.header{
    align-items: center;
    background-color: $header-bg;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 15px;
    display: flex;
    min-height: $header-height;

    &.component-host, &.component-wrapper {
      padding: 0;
    }

    .logo--mg{
        position: absolute;
        clip: rect(0, 30px, 30px, 0px);
        top: 8px;
        left: 10px;
    }

    .menu{
        text-align: right;

        .btn-group {
            align-items: center;
            justify-content: flex-end;
            flex-wrap: wrap;

            .btn {
                padding: 6px 12px;
            }

            .form-control {
                font-size: 14px;
            }
        }

        button{
            background: none;
            border: none;
            color: $header-color;

            &[aria-expanded="true"]{
                background-color: darken(white, 10);
            }

            &:hover,
            &:focus {
                opacity: 0.7;
            }
        }

        .dropdown{

            .dropdown-menu {
                font-size: $level-4;
                left: auto;
                right: 0;
                min-width: 160px;

                .dropdown-header {
                    font-size: $level-5;
                    text-transform: uppercase;
                }

                a:hover,
                a:focus{
                    background-color: darken(white, 10);
                }
            }
        }
    }

    img{
        max-height: $header-height - 15;
        max-width: 100%;
    }

    .twitter-typeahead .tt-query,
    .twitter-typeahead .tt-hint {
        margin-bottom: 0;
    }

    .tt-hint {
        color: #000;
        display: block;
        width: 100%;
    }

    .tt-input {
        color: #000;
        font-weight: 300;
    }

    .typeahead {
        border-radius: 0;
        height: 26px;
        padding: 0;
        width: 140px;
        border: none;
        border-bottom: 1px solid #ccc;
        box-shadow: none;

        &:focus{
            border-bottom: 1px solid #666;
        }
    }

    .tt-menu {
        background-color: #fff;
        border-radius: 4px;
        border: 1px solid rgba(0, 0, 0, .15);
        font-size: 1.8rem;
        left: auto !important;
        margin: 2px 0 0;
        max-height: 150px;
        padding: 5px 0;
        overflow-y: auto;
        right: 0 !important;
        width: 380px;

        a {
            font-weight: 300;
            position: relative;

            &:hover,
            &.tt-cursor,
            &:focus {
                cursor: pointer;
                background-color: darken(white, 10);
            }
        }

        .team-logo {
            left: 6px;
            top: 1px;
            max-height: 22px;
            max-width: 22px;
            position: absolute;
        }
    }

    .tt-dropdown-menu {
        @extend .dropdown;
        @extend .dropdown-menu;
        background-clip: padding-box;
        background-color: #fff;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
        margin: 2px 0 0;
        padding: 5px 0;
        width: 100%;
    }

    .tt-suggestion {
        display: block;
        padding: 3px 20px 3px 35px;
        color: #000;
        font-size: $level-4;
        text-align: left;

        p {
            margin: 0;
            vertical-align: middle;
        }

        &.tt-suggestion--backoffice {
            padding-top: 5px;
            border-top: 1px solid #eee;
        }
    }
}

details-dashboard{
    flex: 0 1 100%;
    max-width: 80%;
}

@media all and (max-width: $m){
    .header{

        .logos{
            min-height: $header-height;
        }
    }
}

@media all and (min-width: $m){
    .header{

        .logo--mg{
            position: static;
        }

        .menu{
            text-align: right;
            min-width: 200px;
        }

        details-tile {
            white-space: nowrap;
        }
    }
}

@media all and (min-width: $l) {
    .header{

        .menu{
          button{
            font-size: $level-3 * 1.25;
          }
        }
    }
}
