/// icon.scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-
@import 'extends';

$icon-badge-size: 2 * $baseline-grid;

// TODO: encode font in base64 to include it in the CSS
// perl -MMIME::Base64 -0777 -ne 'print encode_base64($_, "")' < fonts/MaterialIcons-Regular.woff

// http://google.github.io/material-design-icons/#icon-font-for-the-web
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/MaterialIcons-Regular.eot'); /* For IE6-8 */
  src: local('Material Icons'),
       local('MaterialIcons-Regular'),
       url('../fonts/MaterialIcons-Regular.woff2') format('woff2'),
       url('../fonts/MaterialIcons-Regular.woff') format('woff'),
       url('../fonts/MaterialIcons-Regular.ttf') format('truetype');
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;  /* Preferred icon size */
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  font-feature-settings: 'liga';
}

md-icon[ng-click]:hover {
  cursor: pointer;
}

// Define CSS styles to use ng-class with md-icon
md-icon {
  transition: transform 240ms;
  &.sg-icon-toolbar-bg {
    font-size: 84px;
    opacity: 0.2;
    overflow: hidden;
    position: absolute;
    right: $mg * 3;
    transform: rotate(-15deg);
    color: white;
  }
  &.sg-icon--large {
    font-size: $sg-md-grid-pitch;
    font-size: 6 * $baseline-grid;
  }
  &.sg-icon--badge {
    border-radius: 50%;
    font-size: $icon-badge-size;
    min-height: $icon-badge-size;
    min-width: $icon-badge-size;
    position: absolute;
    right: ($icon-size - $icon-badge-size) * 0.5;
    top: ($icon-size - $icon-badge-size) * 0.5;
  }
  &.sg-icon--badge-bottom {
    bottom: ($icon-size - $icon-badge-size) * 0.5;
    top: auto;
  }
  &.md-rotate-45 {
    transform: rotate(45deg);
  }
  &.md-rotate-90 {
    transform: rotate(90deg);
  }
  &.md-rotate-180 {
    transform: rotate(180deg);
  }
  &.md-rotate-180-ccw {
    transform: rotate(-180deg);
  }
  &.md-flip {
    transform: scaleY(-1);
  }
  &.icon-delegated:before,
  &.icon-arrow-forward:before {
    content: "arrow_forward";
  }
  &.icon-accepted:before,
  &.icon-check:before {
    content: "check";
  }
  &.icon-needs-action:before,
  &.icon-help:before {
    content: "help";
  }
  &.icon-more-horiz:before {
    content: "\e5d3";
  }
  &.icon-tentative:before,
  &.icon-person:before {
    content: "person";
  }
  &.icon-declined:before,
  &.icon-remove-circle:before {
    content: "remove_circle";
  }
}

.sg-icon-badge-container {
  position: relative;
}

// Message flag
//.sg-msg-flag {
//  md-icon {
//    color: sg-color($sogoGreen, 50) !important;
//    &.flagged {
//      color: sg-color($sogoBlue, 600) !important;
//    }
//  }
//}
