/* GENERAL */

:root {
  --digi-green: #84C361;
  --digi-green-transparent: rgba(132, 195, 97, 0.3);
  --digi-green-dark: #6E9C54;
  --digi-gray: #717174;
  --digi-gray-transparent: rgba(113, 113, 116, 0.3);
  --nav-img-size: 34px;

  --font-family-open-sans: "Open Sans", Arial, "sans serif";
}

@font-face {
  font-family: 'Open Sans';
  src: local('Open Sans'),
       url('../fonts/OpenSans-Regular.ttf') format('truetype');
}

/* BODY */

html, body {
  overflow: hidden;
}

body {
  font-family: var(--font-family-open-sans);
}

.btn-primary {
  background-color: var(--digi-green) !important;
  border-color: var(--digi-green) !important;
}

.btn-outline-primary {
  border-color: var(--digi-green) !important;
  color: var(--digi-green) !important;
}

.btn-outline-primary:hover, .btn-outline-primary:active {
  background-color: var(--digi-green) !important;
  color: white !important;
}

.btn-primary:focus, .btn-outline-primary:focus {
  box-shadow: 0 0 0 .2rem var(--digi-green-transparent) !important;
}

/* NAVIGATION BAR */

.banner-icon, .map-icon {
  height: var(--nav-img-size);
}

#banner-text {
  font-size: 20px;
  line-height: 14px;
  height: 14px;
  margin: 0px;
  color: var(--digi-gray);
}

.navbar-brand {
  padding-top: 2px;
  padding-bottom: 2px;
}

#topBar {
  z-index: 1000;
}

.dropdown-toggle, .widget-button {
  background-color: transparent;
  border: 0px solid transparent;
  padding: 0px;
}

.dropdown-toggle:focus, .widget-button:focus {
  outline: 0;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}

.dropdown-toggle::after {
  vertical-align: 0px;
}

.dropdown-menu {
  right: 0;
  left: auto;
  margin: 12px 0px;
  border: 0px solid transparent;
  border-radius: 0px;
  padding: 2px 0px;
}

.digi-gray .dropdown-toggle::after {
  color: var(--digi-gray)
}

.digi-green .dropdown-toggle::after {
  color: var(--digi-green)
}

.dropdown-item {
  color: var(--digi-gray);
}

.dropdown-item:hover {
  background-color: var(--digi-gray-transparent);
  color: var(--digi-gray);
}

@media (min-width: 992px) {
  .navbar-expand-lg > .nav-container {
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
  }
}
.navbar > .nav-container {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: justify;
  justify-content: space-between;
  width: 100%;
  padding-right: 30px;
  padding-left: 30px;
  margin-right: auto;
  margin-left: auto;
}

.nav-right-container {
  display: flex;
}

.map-icon:hover {
  opacity: 0.8;
  color: var(--digi-green);
}

.simulation-controls-container {
  padding: 10px;
  min-width: 300px;
}

.widget-title {
  font-size: 14px;
  margin-bottom: 2px;
}

.widget-desc {
  font-size: 10px;
}

.widget-button-container {
  margin: auto;
}

.widget-button {
  margin-left: 5px;
  margin-right: 5px;
}

#current-time {
  margin-bottom: 5px;
  text-align: center;
}

.vertical-separator {
  border-left: 2px solid var(--digi-gray);
  height: var(--nav-img-size);
  margin-left: 20px;
  margin-right: 20px;
}

#farm_name {
  height: var(--nav-img-size);
  font-size: 20px;
  color: var(--digi-gray);
  font-weight: bold;
  padding-top: 4px;
  margin: 0px 10px;
}

.farm-title-img {
  padding-top: 6px;
  width: 24px;
}

/* SIDEBAR */

#body-row {
  margin-left:0;
  margin-right:0;
  height: calc( 100vh - var(--nav-img-size) - 20px ); /* height of the top toolbar or banner plus 20 px of padding */
  display: flex;
}

#sidebar-container {
  height: 100%;
  background-color: var(--digi-gray);
  padding: 0px;
  box-shadow: 4px 0 0.25rem rgba(0,0,0,.075);
  z-index: 999;
}

/* Sidebar sizes when expanded and collapsed */
.sidebar-expanded {
  width: 230px;
}

.sidebar-collapsed {
  width: 60px;
}

.sidebar-expanded, .sidebar-collapsed {
  transition: width 0.2s;
  -moz-transition: width 0.2s; /* Firefox 4 */
  -webkit-transition: width 0.2s; /* Safari and Chrome */
  -o-transition: width 0.2s; /* Opera */
}

#sidebar-contents {
  height: 100%;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

/* Menu item */
#sidebar-container .list-group a {
  height: 50px;
  color: white;
  background-color: var(--digi-gray);
}

.list-group-item:first-child {
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
}

.list-group-item:last-child {
  border-bottom-right-radius: 0px;
  border-bottom-left-radius: 0px;
}

.list-group-item {
  border: 0px solid transparent;
  padding: 10px 17px;
}

#sidebar-container #sections .selected {
  background-color: white;
  color: var(--digi-gray);
}

#sidebar-container #sections a:hover,
#sidebar-container #collapsator > a:hover,
#sidebar-container #sections .selected:hover {
  background-color: var(--digi-green);
  color: white;
}

/* Submenu item */
#sidebar-container .list-group .sidebar-submenu a {
  height: 45px;
  padding-left: 30px;
}

.sidebar-submenu {
  font-size: 0.9rem;
}

/* Separators */
.sidebar-separator-title {
  background-color: var(--digi-gray);
  height: 35px;
}

.sidebar-separator {
  background-color: var(--digi-gray);
  height: 25px;
}

.logo-separator {
  background-color: var(--digi-gray);
  height: 60px;
}

/* Submenu icon */
#sidebar-container .list-group .list-group-item .submenu-icon::after {
  font-family: FontAwesome;
  display: inline;
  text-align: right;
  padding-left: 10px;
}

/* Closed submenu icon */
#sidebar-container .list-group .list-group-item[aria-expanded="false"] .submenu-icon::after {
  content: " \f0d7";
}

/* Opened submenu icon */
#sidebar-container .list-group .list-group-item[aria-expanded="true"] .submenu-icon::after {
  content: " \f0da";
}

.digi-menu-icon {
  min-width: 25px;
  max-width: 25px;
}

#collapsator {
  height: 100%;
}

#sidebar-container #collapsator > a {
  margin-top: auto;
  background-color: #4C4C4D;
}

.icon-widget {
  color: var(--digi-gray);
}

.icon-widget:hover {
  opacity: 0.8;
}

.selected-icon-widget {
  color: var(--digi-green);
}

/* CONTENT */

/* LOADING */
#loading {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 997;
  text-align: center;
}

#loading-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.water-space {
  position: relative;
}

.tank-valve-loading-container {
  height: 60%;
  width: 100%;
  flex-direction: column;
}

.tank-loader {
  position: absolute;
  margin: auto;
}

.popup {
  z-index: 2;
  position: absolute;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px 10px;
  border-radius: 15px;
  top: 50%;
  left: 50%;
  text-align: center;
  max-width: 800px;
}

.popup i {
  font-size: 1.3vw;
}

.popup .popup-item {
  width: 70%;
}

.popup .popup-title, .popup .popup-text {
  color: var(--digi-gray);
}

.popup .popup-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
}

.tank-valve-loader {
  height: 40px;
  width: 80px;
  z-index: 1;
}

.element-grayed {
  opacity: 20%;
  background-color: white;
  pointer-events: none;
}

/* CENTRAL CONTAINER */
.container-fluid {
  padding: 15px 60px;
  overflow: auto;
  font-size: 15px;
}

.card {
  padding: 10px;
  margin: 8px 6px;
  border: 0px solid transparent;
  border-radius: 0px;

  transition: height 0.2s;
  -moz-transition: height 0.2s; /* Firefox 4 */
  -webkit-transition: height 0.2s; /* Safari and Chrome */
  -o-transition: height 0.2s; /* Opera */
}

.card-body {
  padding: 10px;
}

.card-img-digi {
  width: 100%;
  border-radius: 0px;
}

.column {
  padding: 0px 10px;
}

.column .card {
  padding: 15px 0px 0px 0px;
  margin: 8px 6px;
  border: 0px solid transparent;
  border-radius: 0px;

  transition: height 0.2s;
  -moz-transition: height 0.2s; /* Firefox 4 */
  -webkit-transition: height 0.2s; /* Safari and Chrome */
  -o-transition: height 0.2s; /* Opera */
}

.column .card-body {
  padding: 0px;
}

.column .card .row {
  margin-right: 0px;
  margin-left: 0px;
}

.column .card-title {
  padding: 0px 15px 15px 15px;
  border-bottom: 1px solid var(--digi-gray-transparent);
  margin-bottom: 0px;
}

.col,
.col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto,
.col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto,
.col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto,
.col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto,
.col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
  padding-right: 0px;
  padding-left: 0px;
}

.card-padding {
  padding: 15px;
}

.card-title {
  font-weight: bold;
}

.card-value {
  font-size: 20px;
  font-weight: bold;
}

.button-extended {
  width: 100%;
}

.title {
  font-size: 15px;
  font-weight: bold;
}

/* DASHBOARD */
.main-row {
  display: flex;
  flex-flow: column;
  height: 90.5vh;
  min-height: 790px;
}

.main-row .main-map-card,
.main-row .dashboard-map-card,
.main-row .water-tank-row {
  flex: 1;
}

.dashboard-map-card {
  padding: 0px !important;
}

.main-map {
  position: relative;
  /* This height is to set the legend and status boxes at the bottom and top
  of the div. The height of the div is 100% of its parent minus 35px of the
  header (19px of the h6 plus 15px of padding bottom plus 1px of border) */
  height: calc(100% - 35px);
}

.dashboard-map {
  position: relative;
  height: 100%;
}

.map-card {
  background-color: white;
  margin: 10px;
  padding: 10px;
  position: absolute;
  z-index: 2;
}

.farm-status {
  width: 220px;
  height: 100px;
  top: 45px;
  right: 0px;
}

.map-legend {
  width: 180px;
  bottom: 0px;
}

.box {
  height: 35px;
  width: 60px;
}

.legend-text {
  padding: 0px 10px;
}

.legend-img {
  padding: 5px 0px;
}

.small-title {
  font-size: 16px;
  font-weight: bold;
  display: block;
  clear: both;
  margin-bottom: 8px;
}

.status {
  padding: 0px 15px;
}

.status-value {
  float: right;
}

.digi-icon-color {
  color: var(--digi-gray);
  display: inline-block;
  margin-bottom: 10px;
  vertical-align: middle;
}

.digi-weather-image {
  width: 2em;
}

.weather-sensor {
  padding: 10px;
  text-align: center;
}

.weather-station-sensors {
  padding: 10px 0px;
}

.weather-station-sensors table,
.weather-widget table {
  width: 100%;
  text-align: center;
  table-layout: fixed;
  padding: 5px 0px;
}

.forecast-day {
  height: 160px;
}

.current-icon {
  font-size: 60px;
  color: var(--digi-green);
}

.forecast {
  background-color: #EEEEEE;
}

@media (max-width: 1200px) {
  .current {
    width: 39.6% !important;
    display: inline-block;
    padding: 0% !important;
    margin-bottom: 0px !important;
    float: left;
  }
  .forecast {
    width: 59.6% !important;
    display: inline-block;
    float: right;
  }
  .forecast-day {
    height: 185px;
  }
}

@media (max-width: 900px) {
  .weather-widget {
    height: 220px;
  }
  .current, .forecast {
    width: 100% !important;
    display: block;
  }
  .current-icon {
    font-size: 60px;
  }
}

.weather-widget .current {
  padding: 0px;
  margin-bottom: 10px;
}

.weather-widget .current .current-element {
  display: inline-block;
  width: 49%;
  text-align: center;
}

.weather-widget .current .current-icon {
  padding-right: 1.2vw;
  text-align: right;
}

.weather-widget .current .current-info {
  padding-left: 1.2vw;
  text-align: left;
  font-size: 25px;
  font-weight: bold;
  line-height: 20px;
  height: 65px;
  vertical-align: middle;
  color: var(--digi-gray);
}

#current-temp {
  font-size: 35px;
}

#current-status {
  font-size: 18px;
  font-weight: normal;
}

.weather-widget .forecast tr {
  height: 30px;
}

.weather-widget .forecast #day-2 {
  background-color: white;
}

.weather-widget .forecast .forecast-icon {
  font-size: 20px;
  color: var(--digi-gray);
}

.weather-widget .forecast .forecast-icon img {
  width: 20px;
}

.weather-widget .forecast-day {
  font-size: 16px;
  color: var(--digi-gray);
}

.weather-widget .forecast-max-temp {
  font-size: 16px;
  color: red;
}

.weather-widget .forecast-min-temp {
  font-size: 16px;
  color: blue;
}

.water-tank-container {
  margin: auto;
  top: 50%;
  left: 50%;
  position: absolute;
  transform: translate(-50%, -46%);
  width: 70%;
}

@media (min-width: 559px) {
  .water-tank-container {
    width: 60%;
  }
}

@media (min-width: 1080px) {
  .water-tank-container {
    width: 95%;
  }
}

.water-tank {
  position: relative;
}

.water-tank, .tank-valve {
  text-align: center;
  position: relative;
}

.tank-valve {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.water-tank .static-image {
  width: 90%;
  position: relative;
  z-index: 4;
  max-width: 202px;
  max-height: 363px;
}

.tank-valve .static-image {
  width: 70%;
  max-width: 141px;
  margin-top: 5%;
  margin-bottom: 5%;
}

.water-tank-row .card {
  height: calc( 100% - 16px );
}

.water-container {
  width: 56.8%;
  height: 50.5%;
  position: absolute;
  bottom: 39.45%;
  left: 50%;
  z-index: 1;
  max-width: 130px;
  transform: translate(-50%, 0%);
}

.water-space {
  position: relative;
  height: 100%;
  width: 100%;
  z-index: 2;
}

#water {
  background-color: #87CEFA;
  height: 0%;
  width: 100%;
  position: absolute;
  bottom: 0;
  z-index: 3;
}

.tank-level {
  color: white;
  font-weight: bold;
  font-size: 18px;
  position: absolute;
  z-index: 5;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@media (min-width: 1200px) {
  .tank-level {
    font-size: 1.2vw; /* Set it always to 1.3%of the viewport width */
  }
}

.btn-digi {
  color: white;
  background-color: var(--digi-green);
  border-color: var(--digi-green);
}

.btn-digi:hover {
  color: white;
  background-color: var(--digi-green-dark);
  border-color: var(--digi-green-dark);
}

.refill-button {
  height: 35px;
  width: 100%;
  color: white;
  background-color: var(--digi-gray);
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  bottom: 0px;
}

.refill-button p {
  margin: 0;
}

.refill-button:hover {
  background-color: var(--digi-green);
  cursor: pointer;
}

.refill-button:active {
  color: var(--digi-gray);
  background-color: white;
}

/* MAP */
.farms-list-title {
  color: white;
  width: 185px;
  text-align: center;
  font-size: 20px;
  width: 100%;
  padding: 5px 0px;
  border-bottom: 1px solid white;
}

.farms-list-entry {
  color: white;
  background-color: var(--digi-gray);
  cursor: pointer;
  padding: 10px 17px;
  width: 100%;
  white-space: normal;
}

.farms-list-entry:hover {
  background-color: var(--digi-green);
}

.map-loading-wrapper {
  position: relative;
  height: 100%;
  z-index: 1;
}

.map-loading, .map-error, .farms-map, .stations-map {
  position: absolute;
  width: 100%;
  height: 100%;
}

.map-error {
  padding-top: 300px;
  text-align: center;
  font-weight: bold;
  color: #BD362F;
  font-size: 18px;
  background-color: rgba(255, 255, 255, 0.85);
  display: none;
}

.map-marker, .map-marker-off {
  border-radius: 5px;
  background: white;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  padding: 2px;
  padding-right: 5px;
  padding-left: 5px;
  transform: translateX(-50%);
}

.map-marker {
  border: 2px solid var(--digi-gray);
  color: var(--digi-green);
}

.map-marker-off {
  border: 2px solid #AAAAAA;
  color: #CCCCCC;
}

/* FARM INFORMATION WINDOW */
.marker-info {
  min-width: 150px;
  background-color: white;
}

.marker-info hr {
  margin-top: 3px;
  border-top: 1px solid;
  border-color: var(--digi-gray);
}

.marker-info-title {
  text-align: center;
  color: var(--digi-gray);
  font-weight: bold;
  font-size: 16px;
}

.marker-info-element {
  min-height: 36px;
  margin-top: 8px;
  display: table;
}

.marker-info-icon {
  float: left;
  margin-right: 5px;
  width: 40px;
  text-align: center;
}

.marker-info-value {
  float: left;
  color: var(--digi-gray);
  font-size: 24px;
  padding-top: 2px;
}

.marker-info-value-status-loading {
  color: #ECB300;
}

.marker-info-value-status-on {
  color: var(--digi-green);
  font-weight: bold;
}

.marker-info-value-status-off {
  color: #C9302C;
  font-weight: bold;
}

.marker-info-location {
  font-size: 16px;
}

.marker-info-button-container {
  padding: 5px;
  position: relative;
  height: 50px;
}

.marker-info-button, .marker-info-button-loading {
  font-size: 18px;
  position: absolute;
  border: none;
  color: white;
  left: 8%;
  width: 84%;
  height: 40px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  border-radius: 5px 5px 5px 5px;
}

.marker-info-button {
  cursor: pointer;
  background-color: var(--digi-green);
}

.marker-info-button:focus, .marker-info-button:checked {
  border: none;
  outline: 0px auto transparent;
}

.marker-info-button-loading {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 0px;
}

.marker-info-button-off {
  background-color: #DC3545;
}

/* CONFIGURATION */
.cycle-modal-container {
  margin-left: 30px;
}

.cycle-modal-label {
  display: block;
  margin-top: 10px;
}

#cycles-table th, #cycles-table td {
  text-align: center;
  vertical-align: middle;
}

.remove-logo {
  height: 24px;
}

.schedule-body {
  min-height: 500px;
}

/* IRRIGATION STATIONS MAP */
.stations-map-toolbar {
  min-height: 42px;
  background-color: var(--digi-gray);
}

.stations-map-status {
  float: left;
  color: white;
  padding-top: 7px;
  padding-left: 10px;
  font-size: 18px;
  display: none;
}

.stations-map-button {
  float: right;
  padding: 5px;
  margin-left: 5px;
  margin-right: 5px;
  cursor: pointer;
}

.stations-map {
  display: flex;
  flex-flow: column;
}

.stations-map-control {
  flex-grow: 1;
}

/* HISTORY */
.chart-container {
  color: #666666;
  padding: 20px 0px 20px 0px;
}

.chart-wrapper {
  position: relative;
}

.big-chart {
  width: 100%;
  min-height: 300px;
  padding: 20px;
}

.chart-loading {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.85);
}

.loading-chart-image, .no-data-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
