/* mopidy-mobile uses 64x64 px thumbnails */
$item-thumbnail-width:            64px;
$item-thumbnail-height:           64px;

/* give playback controls a little more breathing space */
$bar-footer-height:               48px;

/* increase width of popup for German translation */
$popup-width:                     280px;

/* path to ionicons font files, relative to www/css */
$ionicons-font-path: "../lib/ionic/fonts" !default;

/* include all of Ionic */
@import "www/lib/ionic/scss/ionic";

/* include default variables */
@import "variables";

/* FIXME: ionic bug? */
.bar .button.button-small.button-icon:before {
    font-size: $button-icon-size !important;
}

/* FIXME: Ionic bug? */
.item-button-right > .mopidy-mobile-button-icon {
    /*height: 100% !important;*/
    left: auto !important;
    padding: 0 !important;
    right: 3px !important;
}
.item-button-right .mopidy-mobile-button-icon:before {
    display: block;
    width: 32px;
    text-align: center;
}

/* FIXME: icon-accessory style for button */
.item-button-left .icon-accessory, .item-button-right .icon-accessory {
  color: $item-icon-accessory-color;
  font-size: $item-icon-accessory-font-size;
}

/* FIXME: Override some hardcoded/missing colors */
.item-select {
  select {
    color: $input-label-color !important;
  }
}
.popup-body {
  input {
    background-color: transparent;
  }
}

/* make ion-android-more-vertical as wide as other buttons */
.bar-stable .button {
    min-width: 34px;
}

/* clickable anchors and buttons in toggle labels */
.item-toggle a {
    pointer-events: initial !important;
}
.item-toggle button {
    pointer-events: initial !important;
}

/* anchors as items */
a.item {
  color: $button-default-text;
}

/* standard text links */
h1, h2, h3, h4, h5, h6, p {
    a {
        color: $base-color;
    }
}

/* "i" is for icons */
i {
    @extend .icon
}

button {
    svg {
        fill: currentColor;
        height: 40px;
        padding-bottom: 4px;
        vertical-align: middle;
    }
}

/* wider popup if generated from template */
.popup-container.mopidy-mobile-popup .popup {
    width: 80% !important;
}

/* custom icon classes */
.mopidy-mobile-icon-playback {
    @extend .#{$mopidy-mobile-icon-playback};
}
.mopidy-mobile-icon-tracklist {
    @extend .#{$mopidy-mobile-icon-tracklist};
}
.mopidy-mobile-icon-library {
    @extend .#{$mopidy-mobile-icon-library};
}
.mopidy-mobile-icon-playlists {
    @extend .#{$mopidy-mobile-icon-playlists};
}
.mopidy-mobile-icon-settings {
    @extend .#{$mopidy-mobile-icon-settings};
}

.mopidy-mobile-icon-create {
    @extend .#{$mopidy-mobile-icon-create};
}
.mopidy-mobile-icon-check {
    @extend .#{$mopidy-mobile-icon-check};
}
.mopidy-mobile-icon-close {
    @extend .#{$mopidy-mobile-icon-close};
}
.mopidy-mobile-icon-edit {
    @extend .#{$mopidy-mobile-icon-edit};
}
.mopidy-mobile-icon-link {
    @extend .#{$mopidy-mobile-icon-link};
}
.mopidy-mobile-icon-menu {
    @extend .#{$mopidy-mobile-icon-menu};
}
.mopidy-mobile-icon-search {
    @extend .#{$mopidy-mobile-icon-search};
}

.mopidy-mobile-icon-consume {
    @extend .#{$mopidy-mobile-icon-consume};
}
.mopidy-mobile-icon-random {
    @extend .#{$mopidy-mobile-icon-random};
}
.mopidy-mobile-icon-repeat {
    @extend .#{$mopidy-mobile-icon-repeat};
}
.mopidy-mobile-icon-repeat1 {
    @extend .#{$mopidy-mobile-icon-repeat1};
}
.mopidy-mobile-icon-single {
    @extend .#{$mopidy-mobile-icon-single};
}

.mopidy-mobile-icon-album {
    @extend .#{$mopidy-mobile-icon-album};
}
.mopidy-mobile-icon-artist {
    @extend .#{$mopidy-mobile-icon-artist};
}
.mopidy-mobile-icon-directory {
    @extend .#{$mopidy-mobile-icon-directory};
}
.mopidy-mobile-icon-track {
    @extend .#{$mopidy-mobile-icon-track};
}

.mopidy-mobile-icon-play {
    @extend .#{$mopidy-mobile-icon-play};
}
.mopidy-mobile-icon-pause {
    @extend .#{$mopidy-mobile-icon-pause};
}
.mopidy-mobile-icon-stop {
    @extend .#{$mopidy-mobile-icon-stop};
}
.mopidy-mobile-icon-next {
    @extend .#{$mopidy-mobile-icon-next};
}
.mopidy-mobile-icon-previous {
    @extend .#{$mopidy-mobile-icon-previous};
}

.mopidy-mobile-icon-volume-low {
    @extend .#{$mopidy-mobile-icon-volume-low};
}
.mopidy-mobile-icon-volume-high {
    @extend .#{$mopidy-mobile-icon-volume-high};
}
.mopidy-mobile-icon-mute {
    @extend .#{$mopidy-mobile-icon-mute};
}

.mopidy-mobile-icon-info {
    @extend .#{$mopidy-mobile-icon-info};
}
.mopidy-mobile-icon-warn {
    @extend .#{$mopidy-mobile-icon-warn};
}
.mopidy-mobile-icon-error {
    @extend .#{$mopidy-mobile-icon-error};
}
.mopidy-mobile-icon-debug {
    @extend .#{$mopidy-mobile-icon-debug};
}

/* custom button styles */
.mopidy-mobile-button-icon {
    @extend .button;
    @extend .button-clear;
    @extend .button-icon;
    @extend .icon;
}

.mopidy-mobile-button-control {
    @extend .button;
    @extend .button-icon;
    @extend .icon;
}

/* thumbnail default backgrounds */
.mopidy-mobile-thumbnail-artist {
    width: $item-thumbnail-width;
    height: $item-thumbnail-height;
    background: $mopidy-mobile-thumbnail-artist-bg;
}
.mopidy-mobile-thumbnail-album {
    width: $item-thumbnail-width;
    height: $item-thumbnail-height;
    background: $mopidy-mobile-thumbnail-album-bg;
}
.mopidy-mobile-thumbnail-track {
    width: $item-thumbnail-width;
    height: $item-thumbnail-height;
    background: $mopidy-mobile-thumbnail-track-bg;
}

/* popover menus */
.mopidy-mobile-menu {
    height: auto !important;
    button.item {
        @extend .button-full;
        text-align: left !important;
    }
    button[disabled] {
        color: #ccc !important;
    }
    ion-content {
        position: relative !important;
    }
    .item.button-bar {
        button {
            padding: 0;
        }
        border-left: 0;
        border-right: 0;
        margin-left: 0;
        margin-right: 0;
     }
}

/* playback controls */
.mopidy-mobile-playback {
    text-align: center;
    h2, h3, h4 {
        margin-top: 0;
        margin-bottom: 4px;
    }
    h2 {
        font-size: 16px;
        font-weight: bold;
    }
    h3 {
        font-size: 14px;
        font-weight: inherit;
    }
    h4 {
        font-size: 12px;
        font-weight: inherit;
    }
    div {
        margin: 0 !important;
    }
    img {
        height: 75%;
        width: 75%;
    }
    ion-footer-bar {
        background-image: none;
        border: 0;
        padding: 0 5px;
        vertical-align: top;
    }
    .button-bar {
        border: 0;
        margin-bottom: 6px;
        vertical-align: top;
        button {
            border: 0;
            vertical-align: top;
        }
        button:before {
            vertical-align: super !important;
        }
    }
    .range {
        margin: 0;
        padding: 0;
        width: 100%;
        input {
            margin-top: 0;
        }
    }
}

/* about page header */
.mopidy-mobile-about {
    img {
        float: left;
        margin-right: 10px;
        height: 64px;
        width: 64px;
    }
    h1 {
        font-size: 22px;
        margin: 0;
        padding-top: 10px;
    }
    font-size: 12px;
    margin: 0;
}

/* minor styles */
a img.mopidy-mobile-image {
    height: 32px;
    vertical-align: text-bottom;
}

.mopidy-mobile-artists span + span:before{
    content: "\00b7";
    padding: 0 1ex;
}

/* hide depending on orientation */
@mixin orientation-display-none($selector, $orientation) {
    @media (orientation: $orientation) {
        #{$selector} {
            display: none;
        }
    }
}

@include orientation-display-none('.hidden-portrait', 'portrait');
@include orientation-display-none('.hidden-landscape', 'landscape');

/* custom responsive-grid-break with orientation selector */
@mixin orientation-grid-break($selector, $orientation) {
  @media (orientation: $orientation) {
    #{$selector} {
      -webkit-box-direction: normal;
      -moz-box-direction: normal;
      -webkit-box-orient: vertical;
      -moz-box-orient: vertical;
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;

      .col, .col-10, .col-20, .col-25, .col-33, .col-34, .col-50, .col-66, .col-67, .col-75, .col-80, .col-90 {
        @include flex(1);
        margin-bottom: ($grid-padding-width * 3) / 2;
        margin-left: 0;
        max-width: 100%;
        width: 100%;
      }
    }
  }
}

@include orientation-grid-break('.responsive-portrait', 'portrait');
/* doesn't really make sense */
@include orientation-grid-break('.responsive-landscape', 'landscape');
