/*  1 iso-name
    2 cool-blue
    3 country-welcome
    4 background-color
    5 country-welcome-pointer (lighter color of country-welcome)
    6 partners-holder background
    7 partners-holder text color
    8 tile-aims big number text color
    9 news tile background color
    10 map tile background color
    11 map hover coordinates (responsive)
    12 side-menu background
    13 side-menu button normal state
    14 side-menu button hover and active state
*/


$countries: (
    (cog, #db514b, #e4c779, #2b686a, #f5e5bb,#e0f1ee,#abb9c4, #b8d7da, #869c93,#97bead,50% 76%,#29403e, #305a52, #3a7f70),
    (mdg, #db514b, #e4c779, #2b686a, #f5e5bb,#e0f1ee,#abb9c4, #b8d7da, #869c93,     #29403e, #305a52, #3a7f70, #3a7f70, #3a7f70, #3a7f70, #3a7f70, #3a7f70, #3a7f70, #3a7f70, #3a7f70, #3a7f70, #3a7f70)
);


@each $country in $countries{

  body.#{nth($country, 1)} {


    //// Start of theme builder



    //CountrySTAT Home

    .country-welcome{
      background-color:nth($country, 3);

    }

    .country-details {
      background-image: url("http://fenixrepo.fao.org/countrystat/assets/#{nth($country, 1)}/#{nth($country, 1)}-home.jpg");
    }


    .home-content{

      background-color: nth($country, 4);


      .home-detail-pointer{

        background-color: nth($country, 5);

        &:before{

          border-color: transparent transparent transparent nth($country, 5);
        }


      }

    }

    .country-details {

      .home-stats-footer {
        background-color: rgba(nth($country, 2), 0.5);
      }
    }


    .partners-holder{
      background-color: nth($country, 6);

      h4{
        color: nth($country, 7);
      }

    }

    .home-tile.aims{


      ol li:before {
        color: nth($country, 8);
      }
    }




    .home-tile.gray{
      background-color: nth($country, 9);

    }

    .home-tile.map{
      background-color: nth($country, 10);

      background-image: url("http://fenixrepo.fao.org/countrystat/assets/#{nth($country, 1)}/#{nth($country, 1)}-map.svg");


      &:hover{
        background-position: nth($country, 11);
      }

      .afg-title {

        background-color: nth($country, 10);

      }


    }

    //CountrySTAT Home End

    // CountrySTAT Sidebar

    #sidebar-wrapper{
      background-color: nth($country, 12);

      .sidebar-nav{

        li{

          background-color: nth($country, 13);

          &.active{
            a {
              background-color: nth($country, 14);



              &:before{
                background-color: nth($country, 2);
              }


              &:hover, &:active, &:focus, &:visited{
                background-color: nth($country, 14);
              }

            }
          }

          a {

            &:hover, &:active, &:focus, &:visited{
              background-color: nth($country, 14);
            }
          }
        }

      }

    }

    // Standard Fenix Theme


    $fx-cool-blue: nth($country, 2);

    .fx-text-primary-color{
      color: $fx-cool-blue;
    }

    .fx-background-color-primary-color{
      background-color: $fx-cool-blue;
    }


    .fx-button-primary-color {
      color: white;
      border-color: darken($fx-cool-blue, 10%);
      background-color: $fx-cool-blue;

      &:hover {
        color: white;
        border-color: darken($fx-cool-blue, 10%);
        background-color: darken($fx-cool-blue, 5%);
      }

      &:focus {
        color: white;
        border-color: darken($fx-cool-blue, 20%);
        background-color: darken($fx-cool-blue, 15%);
      }

    }


    //// Filter

    //jsTree

    .jstree-default .jstree-wholerow-clicked{
      background: none;
      background-color: lighten( $fx-cool-blue, 40%);

    }

    .jstree-default .jstree-wholerow-hovered{
      background: none;
      background-color: lighten( $fx-cool-blue, 45%);
    }

    .jstree-default .jstree-disabled.jstree-clicked{
      background: none;
      background-color: lighten( $fx-cool-blue, 40%);
    }




    // Range Slider
    .irs-bar {
      border-top: 1px solid $fx-cool-blue;
      border-bottom: 1px solid $fx-cool-blue;
    }


    .irs-bar-edge{
      border: 1px solid $fx-cool-blue;
    }


    .irs-bar, .irs-bar-edge{
      background: $fx-cool-blue;
    }

    .irs-from, .irs-to, .irs-single {
      color: $fx-cool-blue;
    }

    // Time

    [data-selector-time]{

      .day{

        &.active{
          background-color: $fx-cool-blue;

          &:hover{
            background-color: desaturate( $fx-cool-blue, 50% );
          }

        }

        &.today{
          &:before{
            border-bottom-color: $fx-cool-blue;
          }
        }

      }


      .month{

        &.active{
          background-color: $fx-cool-blue;
        }

      }

      .year{

        &.active{
          background-color: $fx-cool-blue;
        }



      }


      .fx-time-addon {
        color: $fx-cool-blue;
      }



      [data-action="incrementHours"], [data-action="decrementHours"],[data-action="incrementMinutes"],[data-action="decrementMinutes"]{
        color:$fx-cool-blue;
      }


      [data-action="togglePicker"]{


        span{

          color:$fx-cool-blue;


        }

      }


    }


    // Catalogue
    .cat-toolbar {

      button {

        &:hover {
          color: $fx-cool-blue;

        }

      }

    }

    .bootstrap-table{

      .pagination > li > a, .pagination > li > span {
        color: $fx-cool-blue;
      }

      .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus {
        color: white;
        background-color: $fx-cool-blue;
        border-color: $fx-cool-blue;
      }


    }



    // Visualization Box
    .vb-toolbar {

      button {


        &:hover {

          color: $fx-cool-blue;

        }

      }

    }


    .swiper-button-prev {
      background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'#{$fx-cool-blue}'%2F%3E%3C%2Fsvg%3E");
    }

    .swiper-button-next {
      background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'#{$fx-cool-blue}'%2F%3E%3C%2Fsvg%3E");
    }

    .swiper-pagination-bullet-active{
      background: $fx-cool-blue;
    }

    .gt-row-over td {
      border-bottom-color: $fx-cool-blue;
    }

    .fm-controller-box-item{

      .ui-widget-header{
        background-color: $fx-cool-blue;
      }

    }


    // Analysis

    .pulse-button {
      box-shadow: 0 0 0 0 rgba($fx-cool-blue, 0.7);
    }

    @-webkit-keyframes pulse {to {box-shadow: 0 0 0 45px rgba($fx-cool-blue, 0);}}
    @-moz-keyframes pulse {to {box-shadow: 0 0 0 45px rgba($fx-cool-blue, 0);}}
    @-ms-keyframes pulse {to {box-shadow: 0 0 0 45px rgba($fx-cool-blue, 0);}}
    @keyframes pulse {to {box-shadow: 0 0 0 45px rgba($fx-cool-blue, 0);}}




    // Data Management


    // End of theme builder


  }


}




