// Logo
.navbar-logo {
  margin: 3px;

  img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
  }
}

// Navbar color
.navbar {
  background-color: #24292e;
}

// Selected table line
.table tr {
  &.active {
    td {
      background-color: #e8e8e8 !important;
    }
  }
}

// Tag tree
ul.tag-tree {
  list-style-type: none;
  padding: 0;

  li {
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
    white-space: nowrap;

    .active {
      font-weight: 500;
    }
  }
}

// Navigation
.table-navigation {
  margin-left: 22px !important;

  tr {
    cursor: pointer;

    td {
      border: none !important;
    }

    td.tree-structure {
      padding: 0;
      width: 1em;
      border-left: 1px solid #aaa !important;

      .tree-line {
        border-bottom: 1px solid #aaa !important;
        border-left: 1px solid #aaa;
        margin-left: -1px;
        width: 100%;
        height: 18px;
      }
    }

    &:last-child {
      td.tree-structure {
        border-left: 1px solid transparent !important;
      }
    }
  }
}

.breadcrumb-navigation {
  background: none;
  margin-bottom: 10px;
  display: flex;

  &> li + li:before {
    content: '/';
  }

  li {
    display: flex;
  }

  .label {
    display: flex;
    align-items: center;
  }
}

// Button to add tag from the navigation
.btn-add-tag {
  .fa-plus {
    font-size: 70%;
    position: absolute;
    right: 7px;
    top: 5px;
  }
}

// Documents list
.table-documents {
  margin-top: 18px !important;

  thead th {
    cursor: pointer;
    white-space: nowrap;
    text-transform: uppercase;
    font-weight: 500;
    background-color: #bdbdbd17;
    border: none !important;
    font-size: 90%;
  }
	
  tbody tr {
    cursor: pointer;

    td {
      .tags {
        line-height: 190%;
      }

      .label {
        margin-left: 5px;
      }

      border: none;
    }
  }
}

// Footer
.footer {
  border-top: 1px #e1e4e8 solid;
  padding: 20px;

  img {
    opacity: 0.1;
  }

  .dropdown-menu {
    top: -10px;
    transform: translateY(-100%);
  }
}

// $http loader
.loader {
	position: relative;
	top: -2px;

	&.loader-hide {
	  visibility: hidden;
	}
}

// Users list
.table-users {
	tbody tr {
    cursor: pointer;
  }
}

// Logs list
.table-logs {
	tbody tr td {
    &:first-child {
      white-space: nowrap;
    }
    
    .cell-message {
      word-wrap: break-word;
    }
	}
}

// File view
.modal-fileview {
	top: 2%;
	max-height: 96%;
	overflow-y: scroll;

  img {
    width: 100%;
  }
}

// File thumbnails
.thumbnail {
  &.active {
    border: 1px solid #2ab2dc;
  }

  .file-processing-indicator {
    position: absolute;
    z-index: 2;
    margin-left: 8px;
    margin-top: 8px;
    color: #2ab2dc;
  }

  a.file-thumbnail {
    height: 200px;
    display: block;
    overflow: hidden;
    background: #eee;
  }

  .file-name {
    overflow: hidden;
    word-wrap: break-word;
    white-space: normal;
    text-overflow: ellipsis;
  }

  .file-info {
    display: flex;
    justify-content: space-between;

    .v-align {
      height: 42px;
      padding: 0;
      display: flex;
      align-items: center;
      margin: 4px;
    }
  }

  input[type="checkbox"] {
    width: 26px;
    height: 26px;
  }

  img {
    width: 100%;
    cursor: pointer;
    margin-top: 100px;
    transform: translateY(-50%);
  }
}

// File list
.table-files {
  td {
    vertical-align: middle !important;
  }

  .thumbnail-list {
    display: inline-block;
    position: relative;
    width: 32px;
    height: 32px;
    overflow: hidden;

    img {
      position: absolute;
      left: 50%;
      top: 50%;
      height: 100%;
      width: auto;
      transform: translate(-50%,-50%);
    }
  }
}

// Permissions table
.table-permissions {
  .label-acl {
    margin-right: 6px;
  }
}

// Fields bound to datepicker
input[readonly][datepicker-popup] {
	cursor: pointer;
}

// Share link
input[readonly].share-link {
  cursor: pointer;
}

// Inline edition
.inline-edit {
	cursor: pointer;
	display: block;
	
	span {
    display: block;
	}
	
	input {
	  display: none;
	  margin-bottom: 0;
	}
	
	&.active {
    span {
		  display: none;
		}
		
		input {
		  display: inline-block;
		}
	}
}

// Pagination
.pagination > .active > a {
  cursor: pointer !important;
}

// Pagination box
.pagination-box {
  select {
    vertical-align: top;
    width: auto;
    display: inline-block;
    margin: 20px 0;
  }
}

.nav-text-error {
  color: #b94a48 !important;
}

// Comments
.page-header-side {
  margin: 14px 0 20px;
}

// Dirty Bootstrap 3 fix, see https://github.com/twbs/bootstrap/issues/6686
.row { margin: 0; padding: 0 }
.navbar-nav.navbar-right:last-child {
  margin-right: auto;
}

// Drag & drop related
.upload-zone {
  min-height: 150px;
  background: none;
  border: 2px dashed #eee;
  padding-top: 15px;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.bg-success {
  background-color: #dff0d8;
}

.thumbnail-checked {
  box-shadow: inset 0 1px 2px rgba(27,31,35,0.075), 0 0 0 0.2em rgba(3,102,214,0.3);
  transition: box-shadow ease-in-out .15s;
}

.pointer {
  cursor: pointer;
}

.tab-pane {
  margin-top: 20px;
}

// Advanced search
.btn-open-search > * {
  vertical-align: middle;
}

.btn-open-search .fas {
  top: 0;
}

.search-dropdown-anchor {
  position: relative;
}

.search-dropdown-menu {
  left: 0 !important;
  top: 34px !important;
  padding-top: 15px;
  padding-left: 15px;
  padding-right: 15px;
  padding-bottom: 0;
}

// Workflow model edition
.route-step-row {
  display: flex;
  align-items: center;

  .text-center {
    font-size: 200%;
  }
}

.workflow-action {
  border: 2px dashed #ccc;
  padding: 4px;
}

// Settings
.settings-menu {
  .panel-default {
    border: 1px solid #eee;
    box-shadow: 0 7px 14px 0 rgba(50,50,93,.1), 0 3px 6px 0 rgba(0,0,0,.07);
    border-radius: 4px;

    & > .panel-heading {
      border-bottom: none;
      background: #f9f9f9;

      strong {
        font-weight: 500;
      }
    }

    .list-group-item {
      border: none;
    }

    .list-group-item.active {
      background: none;
      color: #337ab7;
      font-weight: 500;
    }
  }
}

.settings-content {
  margin-bottom: 10px;

  .well {
    box-shadow: 0 7px 14px 0 rgba(50,50,93,.1), 0 3px 6px 0 rgba(0,0,0,.07);
    background: none;
    padding: 0;
    border-radius: 4px;

    .table {
      margin-bottom: 0;
    }

    th {
      text-transform: uppercase;
      font-weight: 500;
      background-color: #f6f9fc;
      border-bottom: 1px solid #ddd;
      font-size: 90%;
    }
  }
}

// Feedback
.feedback {
  display: block;
  position: fixed;
  right: 0;
  top: 200px;
  transform: rotate(-90deg) translateY(-100%);
  background: #ccc;
  padding: 8px;
  color: #fff;
  font-weight: bold;
  transform-origin: 100% 0;

  &:hover {
    background: #aaa;
    text-decoration: none;
    color: #fff;
  }

  &:active {
    background: #444;
  }

  &:active, &:focus {
    text-decoration: none;
    color: #fff;
  }
}

// Video player
.video-overlay {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 500%;
  color: #242424;
  text-decoration: none !important;

  .fas {
    text-shadow: 0 0 20px #fff;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    position: relative;
  }

  &:hover {
    color: #444;
  }

  video {
    cursor: default;
    width: 100%;
  }
}

// PDF viewer
.pdf-viewer {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 80vh;
}

// Vertical alignment
.vertical-center {
  min-height: 100vh;
  height: 100vh; /* IE fix */

  /* Make it a flex container */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;

  /* Align the bootstrap's container vertically */
  -webkit-box-align : center;
  -webkit-align-items : center;
  -moz-box-align : center;
  -ms-flex-align : center;
  align-items : center;
}

// Login
.login-img-container {
  background: url('../../api/theme/image/background') no-repeat center;
  background-size: cover;
  height: 100%;
  box-shadow: 0 0 0 1px rgba(136,152,170,.1), 0 15px 35px 0 rgba(49,49,93,.1), 0 5px 15px 0 rgba(0,0,0,.13);
}

.login-box {
  .btn-password-lost {
    padding-bottom: 0;
  }

  form .row .col-md-6 {
    padding: 0;
  }

  .btn-primary {
    background-color: #2aabd2;
    border-color: transparent;
  }

  .img-responsive {
    margin-bottom: 30px;
  }
}

/* Styling for the ngProgress itself */
#ngProgress {
  margin: 0;
  padding: 0;
  z-index: 99998;
  background-color: green;
  color: green;
  box-shadow: 0 0 10px 0; /* Inherits the font color */
  height: 2px;
  opacity: 0;

  /* Add CSS3 styles for transition smoothing */
  -webkit-transition: all 0.5s ease-in-out;
  -moz-transition: all 0.5s ease-in-out;
  -o-transition: all 0.5s ease-in-out;
  transition: all 0.5s ease-in-out;
}

/* Styling for the ngProgress-container */
#ngProgress-container {
  position: fixed;
  margin: 0;
  padding: 0;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
}

// Translate
.translate-cloak {
  display: none;
}

// Heart
.fa-heart {
  &:hover {
    color: #e74c3c;
    animation: pulse 1s linear infinite;
  }
}

@keyframes pulse{
  0% {
    transform:scale(1.1);
  }
  50%{
    transform:scale(0.8);
  }
  100%{
    transform:scale(1.1);
  }
}

// Margins
.mt-10 {
  margin-top: 10px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-19 {
  margin-bottom: 19px;
}

.mt-30 {
  margin-top: 30px;
}

.ml-10 {
  margin-left: 10px;
}

.mr-10 {
  margin-right: 10px;
}

.va-middle {
  vertical-align: middle !important;
}

// BS customizations
.btn {
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  font-weight: 500;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(50,50,93,.1), 0 2px 5px 0 rgba(50,50,93,.08), 0 1px 1.5px 0 rgba(0,0,0,.07), 0 1px 2px 0 rgba(0,0,0,.08), 0 0 0 0 transparent;
}

.form-control {
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(49,49,93,.03), 0 2px 5px 0 rgba(49,49,93,.1), 0 1px 2px 0 rgba(0,0,0,.08);
}

.dropdown-menu {
  border: none;
  box-shadow: 0 0 0 1px rgba(136,152,170,.1), 0 15px 35px 0 rgba(49,49,93,.1), 0 5px 15px 0 rgba(0,0,0,.13);
}

.navbar-default {
  border: none;

  .navbar-brand {
    color: white;
  }
}

.navbar-brand {
  font-weight: 600;
  font-family: "Open Sans", sans-serif;
}

.nav > li {
  font-weight: 500;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: #2ab2dc;
  background: none;
}

.well-3d {
  border: 1px solid #eee;
  box-shadow: 0 7px 14px 0 rgba(50,50,93,.1), 0 3px 6px 0 rgba(0,0,0,.07);
  background: none;
  border-radius: 4px;

  .well-3d-header {
    font-size: 20px;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 19px;
  }

  table {
    margin-bottom: 0;
  }
}

.well-3d-background {
  position: absolute;
  top: 60px;
  right: 60px;
  z-index: -1;
  opacity: 0.03;

  .fas {
    font-size: 15vw;
  }
}

// Cards
.card {
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0,0,0,.125);
  border-radius: .25em;
  padding: 1.25em;
}

// Home widgets
.widgets .col-md-12 {
  padding-left: 0;
  padding-right: 0;
}

// Button placeholder
.btn-placeholder {
  visibility: hidden;
  width: 0;
  padding-left: 0;
  padding-right: 0;
}

// Financial Authority Form - A4 Styling
.fa-form-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #f5f5f5;
}

.fa-form.a4-page {
  width: 210mm;
  min-height: 297mm;
  padding: 15mm;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1.4;
  box-sizing: border-box;
}

.fa-header {
  display: flex;
  align-items: center;
  border: 2px solid #000;
  margin-bottom: 10px;
}

.fa-logo {
  width: 120px;
  padding: 10px;
  border-right: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fa-logo-img {
  max-width: 100px;
  max-height: 60px;
}

.fa-title-section {
  flex: 1;
  text-align: center;
  padding: 10px;

  h2 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
  }

  p {
    margin: 5px 0 0 0;
    font-size: 11px;
  }
}

.fa-row {
  display: flex;
  border: 1px solid #000;
  border-top: none;

  &:first-of-type {
    border-top: 1px solid #000;
  }
}

.fa-ref-row {
  border: 2px solid #000;
  border-top: none;
}

.fa-cell {
  padding: 8px;
  border-right: 1px solid #000;

  &:last-child {
    border-right: none;
  }

  label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 10px;
  }
}

.fa-cell-2 {
  width: 50%;
}

.fa-cell-3 {
  width: 33.333%;
}

.fa-cell-5 {
  width: 20%;
}

.fa-cell-full {
  width: 100%;
}

.fa-subtext {
  font-size: 9px;
  font-weight: normal;
  display: block;
}

.fa-input {
  border: none;
  border-bottom: 1px solid #000;
  outline: none;
  font-size: 11px;
  padding: 2px 0;
  background: transparent;
  width: 100%;

  &:focus {
    border-bottom-color: #2ab2dc;
  }
}

.fa-input-wide {
  width: 100%;
}

.fa-input-full {
  width: 100%;
  margin-bottom: 5px;
}

.fa-input-number {
  text-align: right;
}

.fa-input-small {
  width: 50px;
  text-align: center;
}

.fa-textarea {
  width: 100%;
  border: 1px solid #000;
  resize: none;
  padding: 5px;
  font-size: 11px;
  font-family: inherit;

  &:focus {
    outline: 1px solid #2ab2dc;
  }
}

.fa-checkbox-row {
  display: flex;
  align-items: center;
  padding: 8px;
  flex-wrap: wrap;
}

.fa-checkbox-group {
  display: flex;
  align-items: center;
  margin-right: 20px;

  label {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 10px;
    margin: 0;
  }

  input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    margin-left: 5px;
  }
}

.fa-other-items {
  flex: 1;

  span {
    font-size: 9px;
    margin-right: 5px;
  }

  .fa-input {
    flex: 1;
    min-width: 100px;
  }
}

.fa-table {
  border: 1px solid #000;
  border-top: none;
}

.fa-table-row {
  display: flex;

  &.fa-table-header {
    background: #f0f0f0;
    font-weight: bold;
  }
}

.fa-table-cell {
  flex: 1;
  padding: 6px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  font-size: 10px;
  text-align: center;

  &:last-child {
    border-right: none;
  }

  .fa-input {
    text-align: center;
  }
}

.fa-signature-row {
  min-height: 60px;
}

.fa-signature-line {
  border-bottom: 1px solid #000;
  height: 40px;
  margin-top: 10px;
}

.fa-section {
  margin-top: 0;
}

.fa-section-header {
  background: #f0f0f0;
  padding: 6px;
  font-weight: bold;
  text-align: center;
  border: 1px solid #000;
  border-top: none;
  font-size: 11px;
}

.fa-bottom-row {
  border: 1px solid #000;
  border-top: none;
}

.fa-cost-distribution {
  display: flex;
  align-items: center;
  gap: 5px;

  span {
    font-weight: bold;
  }
}

.fa-details-row {
  border: 1px solid #000;
  border-top: none;
}

.fa-details-section {
  label {
    display: block;
    font-weight: bold;
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 10px;

    &:first-child {
      margin-top: 0;
    }
  }

  .fa-section-label {
    font-size: 11px;
    margin-bottom: 10px;
  }
}

.fa-date-input {
  position: relative;
}

// Print styles for A4
@media print {
  .no-print {
    display: none !important;
  }

  body {
    margin: 0;
    padding: 0;
    background: white;
  }

  .navbar,
  .footer,
  .page-header {
    display: none !important;
  }

  .fa-form-container {
    padding: 0;
    background: white;
  }

  .fa-form.a4-page {
    width: 210mm;
    min-height: 297mm;
    padding: 10mm;
    margin: 0;
    box-shadow: none;
    page-break-after: always;
  }

  @page {
    size: A4;
    margin: 0;
  }
}