/* LAYOUT */
.dashboard {
  display: flex;
  width: calc(100% - 2rem);
  height: calc(100vh - 2rem);
  margin: 1rem auto;
  background-color: var(--color-background);
  color: var(--color-foreground);
  animation: fadein 0.4s ease-in-out;
  overflow: hidden;
}

.sidenav {
  min-width: 200px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #f0f0f0;
  padding: var(--spacing);
  transition: margin-left 0.3s ease-in-out;
}

.sidenav a {
  color: var(--text);
  margin-bottom: 1rem;
  text-decoration: none;
}

.sidenav a:first-of-type {
  text-align: center;
}

.sidenav a > img {
  margin-right: 1rem;
}

.sidenav .dash-logo {
  width: 50px;
}

.sidenav .label {
  text-transform: uppercase;
  color: #cfcfcf;
  font-size: 10px;
}

.sidenav.closed {
  margin-left: -200px;
}

.dashboard .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.content header {
  padding: var(--spacing);
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.content header img {
  margin-right: 1rem;
}

.content header img:last-child {
  margin-left: 1rem;
  margin-right: 0;
}

.content .action-bar {
  display: flex;
  margin-bottom: 1rem;
}

.action-bar h4 {
  margin-top: 0;
}

.content section {
  padding: var(--spacing);
  background-color: #f6f8f8;
  flex: 1;
  animation: fadein 0.4s ease-in-out;
  overflow-y: scroll;
}

.cards {
  width: 100%;
}

/* BASE CARD COMPONENT */
.card {
  position: relative;
  background-color: var(--color-background);
  padding: 1rem;
  margin-right: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: box-shadow 0.4s ease-in-out;
}

.card h4 {
  font-size: 0.8rem;
  font-weight: 400;
  margin: 0;
}

.card:hover {
  box-shadow: 0 2px 5px var(--block-fx-shadow);
}

.card:last-of-type {
  margin-right: 0 !important;
}

.card > .content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.card > .content .indicator {
  flex: 1;
  display: flex;
  align-items: center;
}

.indicator.up {
  animation: up 0.8s 1 ease-in-out, fadein 0.7s ease;
}

.indicator.down {
  animation: down 0.8s 1 ease-in-out, fadein 0.7s ease;
}

.card > .content .indicator > img {
  width: 2rem;
  margin: 1rem;
}

.card > .content .data {
  text-align: right;
  flex: 2;
  display: flex;
  flex-direction: column;
}

.card > .content .data > .numbers {
  margin: 0 0 0 1rem;
  font-size: 3.2rem;
}

.card > .content .data > .description {
  margin: 0 0 0 1rem;
  font-size: 1rem;
  font-weight: 200;
}

/* PROCESSOR CARD */

.card .processor {
  flex-direction: column;
  align-items: flex-start;
}

.processor > .image-container {
  width: 100%;
  min-height: 80px;
  text-align: center;
  display: flex;
  align-items: center;
}

.image-container > img {
  width: 140px;
}

.graph-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: calc(100% - 1rem);
}

.graph-card > .graph {
  flex: 2;
  width: 100%;
}

.graph-card > .number {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

/* ITEMS CARD COMPONENT */

.card > .items-container {
  display: flex;
  align-items: center;
  min-width: 240px;
}

.items-container > .item {
  flex: 2;
  width: 100%;
  text-align: left;
  padding: 1rem 1rem 0 1rem;
}

.item > .number {
  font-size: 1.8rem;
  font-weight: 400;
  margin: 0;
  margin-bottom: 0.5rem;
}

.item > .name {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0;
}

/* TABLE */

.responsive-table {
  width: 100%;
  margin: 0;
  padding: 0;
  border-collapse: collapse;
  border-spacing: 0;
}

thead {
  background: transparent;
  visibility: visible;
  text-transform: uppercase;
}

tr {
  padding: 5px;
  display: table-row;
  border-bottom-width: 1px;
  margin-bottom: 0;
}

tr:nth-child(even) {
  background: #f6f8f8;
}

th,
td {
  padding: 10px;
  text-align: left;
}

th {
  text-transform: uppercase;
  font-size: 11px;
}

th:last-child {
  text-align: center;
}

td {
  display: table-cell;
  text-align: left;
  font-size: 1rem;
  border-bottom: none;
}

td:last-child {
  border-bottom: none;
  text-align: center;
}

td:before {
  content: '';
  display: none;
  float: left;
  text-transform: uppercase;
  font-weight: bold;
}

/* DETAILS PANEL COMPONENT */

.details-panel {
  padding: var(--spacing);
  position: absolute;
  height: 100%;
  width: 500px;
  right: 0;
  background-color: var(--color-background);
  transition: transform 0.8s cubic-bezier(0.4, 1.3, 0.2, 1), opacity 0.1s ease-in-out;
  box-shadow: 0 10px 30px var(--block-fx-shadow);
  z-index: 2;
}

.details-panel.closed {
  transform: translateX(520px);
  opacity: 0;
}

/* DASHBOARD FAKE GRID */

.row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  flex-grow: 12;
}

.col-2 {
  flex: 2;
}

.col-3 {
  flex: 3;
}

.col-4 {
  flex: 4;
}

.col-5 {
  flex: 5;
}

.col-8 {
  flex: 1;
}

/* UTILS */

.spacer {
  flex: 1 0 auto;
}

.active {
  font-weight: 600;
}

a.active > img {
  fill: var(--color-brand-primary);
  stroke: var(--color-brand-primary);
}

.error {
  background: none;
  background-color: var(--color-error);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.loader {
  justify-content: center;
  align-items: center;
  flex: 1;
  display: flex;
  height: 100%;
  width: 100%;
}

.box {
  width: 100px;
  height: 100px;
  border: 3px solid var(--color-foreground);
  transform: rotate(180deg);
  animation: roll 2s infinite ease-in-out;
  position: relative;
  z-index: 1;
  background-color: transparent;
}

.inner-box {
  width: 100%;
  background: var(--color-brand-primary);
  animation: fill 2s infinite ease-in-out;
  left: -10%;
  top: -15%;
  position: absolute;
  z-index: -100;
}

.bar {
  width: 100%;
  margin: 0 auto;
  height: 10px;
  background-color: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.bar > .inner-bar {
  width: 0%;
  height: 10px;
  left: 0;
  background-color: var(--color-brand-primary);
  position: absolute;
}

/* GENERIC ACTIONS */

.ui-action {
  cursor: pointer;
  transition: scale 0.4s ease-in-out, opacity 0.3s ease;
}

.ui-action:hover {
  opacity: 0.9;
  transform: scale(0.98);
}

.ui-action:active {
  transform: scale(0.94);
}

.ui-action.btn {
  height: 30px;
  font-weight: 800;
  transition: all 0.4s ease-in-out;
  border-color: transparent;
  box-shadow: 0 0 2px rgba(3, 3, 3, 0.1);
}

.action-bar .ui-action.btn {
  margin-left: 1rem;
}

.btn.primary {
  color: var(--text-inverted);
  background-color: var(--color-foreground);
  border-color: var(--color-foreground);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  background-color: rgba(3, 3, 3, 0.5);
  animation: fadein 0.4s ease-in-out;
}

/* ANIMATIONS */

@keyframes fadein {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes slideup {
  0% {
    transform: translateY(100px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes up {
  0% {
    transform: translateY(10px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes down {
  0% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes fill {
  0% {
    height: 0px;
  }
  40% {
    height: 105%;
  }
  60% {
    height: 105%;
  }
  100% {
    height: 0px;
  }
}

@keyframes roll {
  0% {
    transform: rotate(180deg);
  }
  40% {
    transform: rotate(180deg);
  }
  60% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media screen and (max-width: 1200px) {
  .card > .content .data .numbers {
    font-size: 2.4rem;
  }

  .card > .content .data .description {
    font-size: 0.8rem;
  }

  .bar {
    height: 4px;
  }

  .bar > .inner-bar {
    height: 4px;
  }
}

@media screen and (max-width: 840px) {
  .content header {
    font-size: 0.8rem;
  }

  .row {
    flex-direction: column;
  }

  .card {
    margin-right: 0 !important;
    margin-bottom: 1rem;
  }

  .card > .content .data .numbers {
    font-size: 3rem;
  }

  .card > .content .data .description {
    font-size: 1rem;
  }

  .card > .content .indicator > img {
    width: 4rem;
  }

  .details-panel {
    bottom: 0;
    height: calc(100vh - 3rem);
    width: calc(100vw - 4rem);
    right: 1rem;
  }

  .details-panel.closed {
    transform: translateY(100vh);
    opacity: 0;
  }

  .hide-mobile {
    display: none;
  }

  .bar {
    height: 10px;
  }

  .bar > .inner-bar {
    height: 10px;
  }

  thead {
    visibility: hidden;
  }

  tr {
    margin-bottom: 10px;
    display: block;
    border: 1px solid var(--color-light-grey);
  }

  td {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    border-bottom: 1px dotted var(--color-light-grey);
  }

  td:before {
    content: attr(data-label);
    color: var(--color-foreground);
    display: block;
  }

  th:last-child {
    text-align: right;
  }

  td:last-child {
    text-align: right;
  }
}

@media screen and (max-width: 380px) {
  :root {
    font-size: 12px;
  }
}

/* Kitchen Sink Utils */
.kitchen-examples {
  height: 100%;
  overflow-y: scroll;
}

.kitchen-examples > .row > * {
  margin: 1rem;
}

.kitchen-examples > * {
  margin: 1rem;
}
