@import "variables";
@import "bootstrap-sass/assets/stylesheets/bootstrap";
@import "datatables";
@import "wizard";
@import "widgets";
@import "reg";
@import "header";
@import "footer";
@import "orgs";
@import "resources";
@import "single";
@import "forms";
@import "maps";
@import "modals";

/* =Fonts
-------------------------------------------------------------- */

@font-face {
  font-family: 'Roboto';
  src: url('/static/fonts/roboto_regular_macroman/roboto-regular-webfont.eot');
  src: url('/static/fonts/roboto_regular_macroman/roboto-regular-webfont.eot?#iefix') format('embedded-opentype'),
       url('/static/fonts/roboto_regular_macroman/roboto-regular-webfont.woff') format('woff'),
       url('/static/fonts/roboto_regular_macroman/roboto-regular-webfont.ttf') format('truetype'),
       url('/static/fonts/roboto_regular_macroman/roboto-regular-webfont.svg#roboto') format('svg');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Roboto Condensed';
  src: url('/static/fonts/roboto_condensed_macroman/roboto-condensed-regular-webfont.eot');
  src: url('/static/fonts/roboto_condensed_macroman/roboto-condensed-regular-webfont.eot?#iefix') format('embedded-opentype'),
       url('/static/fonts/roboto_condensed_macroman/roboto-condensed-regular-webfont.woff') format('woff'),
       url('/static/fonts/roboto_condensed_macroman/roboto-condensed-regular-webfont.ttf') format('truetype'),
       url('/static/fonts/roboto_condensed_macroman/roboto-condensed-regular-webfont.svg#roboto') format('svg');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'PadaukW';
  src: url('/static/fonts/Padauk/Padauk-Regular.woff') format('woff'),
       url('/static/fonts/Padauk/Padauk-Regular.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'KNU Unicode';
  src: url('/static/fonts/KNU/knuunicode-webfont.woff') format('woff'),
       url('/static/fonts/KNU/knuunicode-webfont.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Noto Sans Bengali';
  src: url('/static/fonts/NotoSansBengali/NotoSansBengali-Regular.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

/* =Basics
-------------------------------------------------------------- */

html {
  font-family: sans-serif;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body, #cadasta {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: auto;
}

#cadasta {
  display: table;
  padding-bottom: 40px;
  @media (max-width: $screen-sm-max) {
    padding-bottom: 0;
  }
}

h1, h2 {
  font-family: $font-family-sans-serif-alt;
}

h3, h4, h5 {
  letter-spacing: -0.3px;
}

h4.div {
  border-top: 1px solid $table-border-color;
  border-bottom: 2px solid $table-border-color;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 14px;
  opacity: 0.7;
  -moz-opacity: .70;
  padding: 8px;
  background: $body-bg;
}

label {
  font-weight: 400;
}

a {
  color: $link-color;
  &:hover,
  &:focus {
   color: $brand-darkblue;
   outline: none;
  }
}

a > .glyphicon,
.btn > .glyphicon {
  margin-left: 4px;
  margin-right: 4px;
  opacity: 0.8;
  -moz-opacity: .80;
  top: 2px;
  text-decoration: none;
  @media (max-width: $screen-xs-min) {
    margin-left: 0;
    margin-right: 0;
  }
}

.btn-sm > .glyphicon {
  margin-left: 0;
  margin-right: 0;
}

.dashboard-box .btn > .glyphicon {
  @media (max-width: $screen-xs-min) {
    display: none;
  }
}

a:hover > .glyphicon,
.btn:hover > .glyphicon {
  text-decoration: none;
  opacity: 1.0;
  -moz-opacity: 1.0;
  -webkit-transition: all .2s ease-in-out;
  -moz-transition: all .2s ease-in-out;
  -ms-transition: all .2s ease-in-out;
  -o-transition: all .2s ease-in-out;
}

kbd {
  background: $gray-light;
  color: $gray-dark;
}

/* =Page Content
-------------------------------------------------------------- */

#page-content { // for page content
  z-index: 800;
  position: relative;
  padding-bottom: 20px;
}

#projects,
#organizations,
#users {
  #page-content { // index pages without subnav that overlap page-header
    max-width: 1220px;
    margin: -190px auto 10px;
    padding-top: 30px;
    background: #fff;
    -webkit-box-shadow: 0 0 6px rgba(0,0,0,.3);
    -moz-box-shadow: 0 0 6px rgba(0,0,0,.3);
    box-shadow: 0 0 6px rgba(0,0,0,.3);
    border-radius: 4px;
    @media (max-width: $screen-md-max) {
      border-radius: 0;
      box-shadow: none;
    }
    @media (max-width: $screen-sm-max) {
      border-radius: 0;
      margin-top: -220px;
      padding-top: 14px;
      -webkit-box-shadow: none;
      -moz-box-shadow: none;
      box-shadow: none;
    }
  }
}

body.tinted-bg #page-content { // for bg image
  background: transparent;
}

#project-wizard #page-content { // for non-map pages
  background: transparent;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}

#dashboard #page-content,
#registration #page-content,
#project-single #page-content,
#project-wizard.map #page-content,
#organization-single #page-content,
#user-single #page-content { // for single project, org, and user pages with or without left subnav
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  position: absolute;
  top: 160px;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
}

#dashboard #page-content,
#project-wizard.page #page-content,
#registration #page-content { // full height page with only site header
  top: $header-height;
}

@media (max-width: $screen-sm-max) {
  #project-single #page-content,
  #project-wizard.page #page-content,
  #organization-single #page-content,
  #user-single #page-content,
  #registration #page-content {
    position: relative;
    top: 0;
  }
}

/* =Main container
-------------------------------------------------------------- */

main.container-fluid {
  padding-bottom: 50px; // for footer
}

/* =Main content to right of sidebar
-------------------------------------------------------------- */

#project-single,
#organization-single {
  #page-content {
    main {
      position: relative;
      left: 0;
      margin-left: 0;
      min-height: 100%;
      overflow: hidden;
      @media (max-width: $screen-sm-max) {
        margin-left: 0;
        background: #fff;
      }
    }
    main.show-sidebar {
      margin-left: 100px;
      @media (max-width: $screen-sm-max) {
        margin-left: 0;
        background: #fff;
      }
    }
    main.container-fluid {
      @media (max-width: $screen-sm-max) {
        padding-bottom: 0;
      }
    }
  }
}

/* =Table views
-------------------------------------------------------------- */

.table {
  background: #fff;
  border-top: 1px solid $table-border-color;
  border-bottom: 3px solid $table-border-color;
  h4 {
    font-weight: bold;
    margin-top: 0;
    color: $gray-darker;
    .glyphicon { // private icon
      margin: 0 4px;
      color: $gray-dark;
      opacity: 0.5;
      -moz-opacity: 0.5;
    }
  }
  > thead > tr > th {
    border-bottom: 1px solid $table-border-color;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    opacity: 0.7;
    -moz-opacity: 0.7;
    background: $body-bg;
  }
  > tbody > tr.linked > td:hover {
    cursor: pointer;
  }
  .btn-sm {
    min-width: 80px !important;
  }
  &.table-condensed {
    .btn-sm {
      min-width: 60px !important;
    }
    .help-block {
      margin-top: 0;
      margin-bottom: 5px;
    }
    samp {
      font-size: 12px;
    }
  }
  div.org-logo {
    padding: 4px 0;
    display: none;
  }
}

table.table-location { // location details in map area
  border-top: none;
  tr:first-child td {
    border-top: none;
  }
  label {
    text-transform: uppercase;
    font-size: 12px;
  }
}

table.table-media { // detail table for resource
  margin-top: 20px;
  border-bottom-width: 1px;
}

table#select-list {
  border-bottom-width: 1px;
  margin-bottom: 0;
}

.table.noborder {
  border: none;
  > tbody > tr > td {
    border: none;
  }
}

@media (max-width: $screen-xs-max) {
  table {
    overflow-x: auto;
  }
}

@media (max-width: 500px) {
 .table > thead > tr > th, .table > thead > tr > td, .table > tbody > tr > th, .table > tbody > tr > td, .table > tfoot > tr > th, .table > tfoot > tr > td {
    padding: 8px;
    font-size: 12px;
    h4 > a {
      font-size: 16px;
    }
 }
 .form-group, .form-control, .public-private-widget, .s3-buckets .file-input, #id_select_file-file {
   font-size: 12px;
 }
 .form-control {
   padding: 6px;
 }
}

/* =Dashboard map
-------------------------------------------------------------- */

#dashboard-map {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 30px;
  z-index: 900;
  padding: 0;
  overflow: hidden;
  height: 100%;
  height: -webkit-calc(100% - 30px);
  height: -moz-calc(100% - 30px);
  height: calc(100% - 30px);
}

/* =Dashboard Stats
-------------------------------------------------------------- */

.tile-box {
  line-height: inherit;
  display: block;
  position: relative;
  height: auto;
  padding: 0;
  text-align: center;
  border-radius: 4px;
  border: 1px solid $table-border-color;
  margin-bottom: 20px;
  .tile-header {
    font-size: 14px;
    padding: 5px 10px;
    text-align: left;
    text-transform: uppercase;
    border: 0 !important;
    background: rgba(255, 255, 255, .2);
  }
  .tile-content-wrapper {
    position: relative;
    overflow: hidden;
    padding: 10px;
    min-height: 78px;
    > .glyphicon {
      font-size: 56px;
      line-height: 70px;
      position: absolute;
      top: 50%;
      left: 16px;
      height: 60px;
      margin-top: -36px;
      opacity: .30;
      -moz-opacity: .30;
    }
    > .glyphicon-center {
      position: absolute;
      top: 50%;
      left: 16px;
      height: 60px;
      margin-top: -36px;
    }
    .tile-content {
      span {
        font-size: 13px;
        text-align: right;
        display: block;
        color: #fff;
        opacity: .70;
        -moz-opacity: .70;
        .glyphicon {
          font-size: 11px;
        }
      }
      .num {
        font-size: 35px;
        line-height: 38px;
        text-align: right;
        opacity: 1;
        -moz-opacity: 1;
      }
    }
  }
  .tile-footer {
    display: block;
    margin: 0;
    padding: 5px 10px;
    text-align: left;
    color: inherit;
    background: rgba(0, 0, 0, .1);
    &:hover {
      opacity: .80;
      color: inherit;
      -moz-opacity: .80;
    }
  }
}

a.tile-box.btn,
.tile-box-shortcut {
  .tile-content-wrapper > .glyphicon {
      -webkit-transition: all .2s ease-in-out;
      -moz-transition: all .2s ease-in-out;
      -ms-transition: all .2s ease-in-out;
      -o-transition: all .2s ease-in-out;
  }
  &:hover .tile-content-wrapper > .glyphicon {
    opacity: .70;
    -moz-opacity: .70;
  }
}

.tile-box.bg-white  { // for white backgrounds
  background: #fff;
  .tile-header {
    border-bottom: solid 1px $table-border-color !important;
  }
  .tile-footer {
    background: #fff;
  }
}

/* =Dashboard Overlays
-------------------------------------------------------------- */

.overlay-wrapper {
  z-index: 2;
  width: 100%;
  .overlay {
    background: #f2f4f7;
    min-height: 150px;
    padding: 20px;
    text-align: center;
    vertical-align: middle;
    border-radius: 4px;
    &.no-bg {
      background: transparent;
    }
    .glyphicon.large {
      font-size: 400%;
      background-color: $gray-dark;
      color: transparent;
      text-shadow: 0px 2px 3px rgba(255,255,255,0.5);
      -webkit-background-clip: text;
      -moz-background-clip: text;
      background-clip: text;
      opacity: 0.7;
      -moz-opacity: .70;
      margin: 30px auto;
    }
    p {
      font-size: 18px;
      font-weight: 500;
      letter-spacing: 0;
      max-width: 450px;
      margin-left: auto;
      margin-right: auto;
    }
  }
  .btn {
      margin: 10px 4px 20px;

  }
}

.overlay-wrapper.map {
  padding: 15px;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  height: 100%;
  min-height: 100%;
  .overlay {
    background: rgba(255, 255, 255, 0.5);
    height: 100%;
    min-height: 100%;
    padding: 40px 20% 0;
    margin-bottom: 0;
  }
}

/*= User Dashboard
--------------------------------------------------------------*/

#org-wrapper {
  &.well {
    background: transparent;
  }
  h3 {
    margin-top: 0;
    .role {
      text-transform: none;
      margin-left: 3px;
      color: $gray-medium;
    }
  }
  .table-search { // search
    display: none;
  }
  .overlay.smaller {
    min-height: auto;
  }
  .btn-full.smaller {
    margin: 0;
    padding: 0;
  }
}

#user-single #org-wrapper {
  .panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid $body-bg;
  }
  p {
    min-width: auto;
  }
}

/* =Dashboard box
-------------------------------------------------------------- */

td.dashboard-box {
  width: 48%;
  &:first-child {
    border-right: 1px dotted $table-border-color !important;
  }
}

/* =Img sizing
-------------------------------------------------------------- */

img.org-logo, img#org-logo {
  max-width: 120px;
  max-height: 50px;
  @media (max-width: $screen-xs-max) {
    max-width: 80px;
    max-height: 30px;
  }
}

#organizations .table div.org-text {
  @media (max-width: $screen-xs-max) {
    margin-left: 0;
  }
}

.avatar-box {
  margin: 0 10px 0 0;
  width: 64px;
  height: 64px;
  background-color: white;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.avatar-box-sm {
  width: 32px;
  height: 32px;
}

.avatar {
  width: auto;
  height: 64px;
  position: absolute;
  top: -9999px;
  bottom: -9999px;
  left: -9999px;
  right: -9999px;
  margin: auto;
  @media (max-width: $screen-xs-max) {
    height: 33px;
  }
}

.avatar-sm {
  height: 32px;
}

.avatar-lg {
  height: 128px;
}

.thumb-60 {
  width: 60px;
  height: 60px;
}

.thumb-128 {
  width: 128px;
  height: 128px;
  float: left;
  margin-right: 20px;
}

/* =Section & Panels
-------------------------------------------------------------- */

section {
  @include clearfix;
}
.panel {
  &.panel-default {
    border: 1px solid $table-border-color;
    .panel-heading {
      border-bottom: 0;
      padding-bottom: 0;
    }
  }
  &.panel-plain {
    border: none;
    background: transparent;
    box-shadow: none;
    &.border-left {
      border-left: 1px solid $table-border-color;
    }
  }
  &.panel-default {
    .panel-heading {
      background: transparent;
    }
  }
  &.panel-about {
    padding-left: 0;
  }
  .panel-topimage { // above header that spans panel
    padding-bottom: 20px;
    border-bottom: 1px solid $table-border-color;
    #preview-box {
      margin: 20px auto 10px auto;
      width: 150px;
      height: 150px;
      background-color: white;
      border-radius: 3px;
      overflow: hidden;
      position: relative;
      text-align: center;
    }
    #avatar-preview {
      width: auto;
      height: 150px;
      position: absolute;
      top: -9999px;
      bottom: -9999px;
      left: -9999px;
      right: -9999px;
      margin: auto;
    }
  }
  .panel-heading {
    @include clearfix;
    .glyphicon-cog,
    .glyphicon-plus {
      font-size: 18px;
      margin-top: 4px;
      margin-left: 4px;
      color: $gray-dark;
      opacity: 0.5;
      -moz-opacity: .50;
      float: right;
    }
    a > .glyphicon-cog,
    a > .glyphicon-plus {
      -webkit-transition: all .2s ease-in-out;
      -moz-transition: all .2s ease-in-out;
      -ms-transition: all .2s ease-in-out;
      -o-transition: all .2s ease-in-out;
    }
    a:hover > .glyphicon-cog,
    a:hover > .glyphicon-plus {
      opacity: .90;
      -moz-opacity: .90;
    }
  }
  .panel-body {
    position: relative;
    overflow-x: hidden;
    @include clearfix;
    > h3 {
      margin-bottom: 10px;
      margin-top: 4px;
      padding-bottom: 10px;
      border-bottom: solid 1px $gray-light;
    }
    .top-add {
      margin-bottom: -30px;
    }
  }
  .panel-footer {
    background: lighten($body-bg, 2%);
  }
  .panel-buttons { // holds buttons at bottom of panels containing forms
    padding: 20px 15px;
    .btn {
      min-width: 110px;
      margin-right: 20px;
      &:last-child {
        margin-right: 0;
      }
    }
  }
  .panel-title { // applied to h3
    font-size: 24px;
    @media (max-width: $screen-sm-max) {
      font-size: 1.4em;
    }
  }
  .panel-title-bordered {
    border-bottom: solid 1px $gray-light;
    padding-bottom: 8px;
  }
  .panel-subtitle { // applied to h4
    text-transform: uppercase;
    opacity: 0.7;
    -moz-opacity: .70;
    font-size: 15px;
    margin-top: 24px;
    letter-spacing: 0;
  }
  &.panel-contacts .panel-subtitle {
    margin-top: 0;
  }
}

/* =Media layout
-------------------------------------------------------------- */

.media-body {
  @media (max-width: $screen-xs-min) {
    display: block;
    width: auto;
  }
}

/* =Buttons
-------------------------------------------------------------- */

.top-btn {
  position: relative;
  z-index: 9;
  margin-top: 10px;
  margin-bottom: 10px;
  .btn {
    @media (max-width: $screen-sm-max) {
      min-width: auto;
      font-size: 13px;
      color: black;
    }
    @media (max-width: $screen-xs-max) {
      min-width: auto;
    }
  }
  .btn-rt, .btn-action {
    min-width: 34px;
  }
}

.btn-primary { // for green buttons on dark background
  &:hover,
  &:focus {
    background-color: darken($btn-primary-bg, 5%);
  }
}

.btn-default {
  &:hover,
  &:focus {
    background-color: darken($btn-default-bg, 5%);
  }
}

.btn-full {
  text-align: center;
  padding: 20px;
  clear: both;
  margin: 20px 0;
  .btn {
    min-width: 160px;
    @media (max-width: $screen-md-max) {
      min-width: 100px;
    }
  }
  .btn-group .btn {
    margin: 0;
  }
}

.btn-link {
  min-width: 60px;
}

.btn-panel {
  vertical-align: middle;
  padding: 20px 10px;
  .glyphicon {
    font-size: 48px;
    color: $btn-primary-bg;
    display: block;
    padding: 0 10px 10px;
  }
}

.btn-primary { // for green buttons on dark background
  &:hover {
    background-color: darken($btn-primary-bg, 5%);
  }
}

.btn-half { // 2 buttons inline
  width: 48%;
}

div.add-btn-btm { // add party link at bottom of table
  padding: 10px 24px;
  text-align: left;
  border-bottom: 3px solid $table-border-color;
  margin-bottom: 20px;
}

.more-menu { // for ellipsis menu on small screens
  float: left;
  font-size: 24px;
  margin: 2px 0 0 10px;
  width: 48px;
  height: 48px;
  display: block;
}

@media (max-width: $screen-sm-max) {
  #project-single .page-header,
  #organization-single .page-header {
    .top-btn {
      padding: 4px 10px 0;
      margin-top: 0;
      .btn {
        min-width: auto;
      }
    }
  }
}

/* =Alerts, labels, text
-------------------------------------------------------------- */

.alert {
  text-align: center;
  max-width: 50%;
  margin: 0 auto;
  -webkit-box-shadow:: 10px 10px 6px -8px rgba(0,0,0,.5);
  -moz-box-shadow:  10px 10px 6px -8px rgba(0,0,0,.5);
  box-shadow:  10px 10px 6px -8px rgba(0,0,0,.5);
  @media (max-width: $screen-sm-max) {
    max-width: none;
  }
}

.form-narrow .alert {
  max-width: 100%;
  margin-bottom: 20px;
}

.alert-full {
  width: 100%;
  max-width: 100%;
  text-align: left;
  margin-bottom: 20px;
  display: table;
  box-shadow: none;
  -moz-box-shadow: none;
  -webkit-box-shadow: none;
  > div {
    display: table-cell;
    vertical-align: top;
    padding: 2px;
    > span.glyphicon, > i.glyphicon {
      padding-right: 10px;
    }
    ul {
      padding-top: 6px;
    }
  }
}

.form-narrow, .narrow {
  .alert-full {
    margin-bottom: 20px;
  }
}

.form-narrow, .narrow {
  .alert-full {
    margin-bottom: 20px;
  }
}

.translation-wrapper {
  background-color: fuchsia;
}

#messages { // success messages on top of map
  position: relative;
  z-index: 999;
  //margin-top: 10px;
  //margin-bottom: 10px;
}

.alert-error { // same as alert-danger
  @include alert-variant($alert-danger-bg, $alert-danger-border, $alert-danger-text);
}

.label {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
  text-transform: none !important;
}

h1 .label {
  font-size: 16px;
  @media (max-width: $screen-xs-max) {
    font-size: 12px;
  }
}

.entity, .area { // small entity title above link and area calculation following
  font-size: 14px;
  font-weight: normal;
  color: $gray-medium;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0;
}

.area { // small area
  font-size: 13px;
  display: inline-block;
  text-transform: none;
}

.text-wrap .entity { // map popovers
  font-size: 11px;
}

.name-break {
  word-break: break-all;
}

.highlight { // for emphasis for inline text
  font-weight: 600;
  color: #000;
}

.border-btm {
  margin-bottom: 10px;
  margin-top: 0;
  border: 0;
  border-bottom: 1px solid $table-border-color;
}

.inline {
  display: inline;
}

.no-margin-bottom {
  margin-bottom: 0;
}

.break { // for email and url long links
  word-break: break-all;
}
