/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--fg-color);
  font-size: 16px;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  font-feature-settings: 'tnum', 'calt', 'cv02';
  line-height: 1.2;
  position: relative;
  min-height: 100vh;
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

article {
  position: relative;
  flex: 1;
  width: calc(100% - 4em);
  max-width: 48em;
  margin: 0 auto;
  padding: 0;
}

.info {
  font-size: 0.75em;
  color: var(--disabled-color);
  padding: 0 0 1rem;
}

#main-nav {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  align-items: center;
  justify-content: center;

  background-color: var(--nav-color);
  font-size: 0.75em;
  height: 4rem;
  position: fixed;
  bottom: 0;
  left: 0;

  a {
    height: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;

    color: #ccc;
    padding: 1rem;

    text-decoration: none;

    & > * {
      transition: all ease 0.2s;
    }

    span {
      display: none;
      margin-left: 0.25em;
    }

    svg {
      width: 2.5em;
      fill: #ccc;
    }

    &:hover {
      color: #fff;

      svg {
        fill: #fff;
      }
    }
  }
}

header {
  margin: 0;
  padding: 2em 0 2em;


  &.simple {
    margin: 0 0 1em;
    border-bottom: 0.0625rem solid var(--border-color);
    .header-details {
      display: block;
      text-transform: none;
    }
  }

  .diff {
    font-size: 1.5em;
  }
}

h1 {
  font-size: 2.5em;
  font-weight: 800;
  line-height: 1;
  margin: 0.1em 0;
}

.header-details {
  color: #767D95;
  font-weight: 400;
  font-size: 1em;
}

table {
  margin: 0 auto;
  width: 100%;
  border-collapse: collapse;
}

thead tr:last-child {
  border-bottom: 0.0625rem solid var(--border-color);
}

th {
  text-transform: uppercase;
  font-size: 0.5em;
  font-weight: normal;
  padding: 0.5em 0;
  color: var(--mid-color);

  &.currency {
    text-align: right;
  }
}

tr.disabled td {
  opacity: 0.5;
}

tr.totals {
  font-weight: 800;
  border-top: 0.0625rem solid var(--border-color);
}

td {
  padding: 0.4em 0;

  &.disabled {
    color: var(--disabled-color);
  }

  &.small {
    font-size: 0.8em;
  }

  &.currency {
    text-align: right;
  }

  a {
    color: inherit;
    text-decoration: none;
    &:hover {
      text-decoration: underline;
    }
  }
}

.account-name {
  font-size: 0.875em;
  font-weight: 400;
}

.account-balance {
  text-align: right;
  font-size: 1em;
  font-weight: bold;
  color: var(--fg-color);
}

.account-diff {
    text-align: right;
    font-weight: 400;
    font-size: 0.75em;
  }

.diff, .account-diff {
  color: var(--positive-color);
  &.neg {
    color: var(--negative-color);
  }

  &.zero, & > .zero {
    color: var(--fg-color);
  }
}

.graph-report {
  --height: 10rem;
  display: flex;
  width: 100%;
  height: var(--height);
  margin: 2em 0 0;
  background-color: #555;
  position: relative;

  .graph-account {
    box-sizing: border-box;
    width: var(--percent);
    height: 100%;

    &:hover span {
      opacity: 1;
    }
  }

  span {
    display: inline-block;
    padding: 0.5rem 0;
    font-size: 0.75em;
    position: absolute;
    right: 0.5rem;
    bottom: var(--height);
    opacity: 0;
    transition: 0.2s ease all;
  }
}

.barchart-text {
  a {
    fill: var(--fg-color);
  }
  font-size: 0.75em;
}

.navigation {
  text-align: center;
  margin: 1em 0 0;
  & > a, & > span {
    display: inline-block;
    width: 4em;
    padding: 0;
  }

  svg {
    fill: var(--border-color);
  }

  .disabled {
    display: none;
  }
}

#charts {
  margin: 0 0 2em;
}

@media screen and (max-width: 40em) {
  table.balance-sheet th span {
    display: none;
  }
}

@media screen and (min-width: 28em) {
  .header-details {
    font-size: 1.25em;
  }

  h1 {
    font-size: 3em;
  }

  table {
    font-size: 1.25em;
  }
}

@media screen and (min-width: 40em) {
  #main-nav {
    position: absolute;
    font-size: 0.875rem;
    bottom: auto;
    top: 0;

    a {
      padding: 0em 1.5em;

      svg {
        width: 1.5em;
      }

      span {
        display: inline-block;
      }
    }
  }

  body {
    padding: 4rem 0 0;
  }

  table {
    font-size: 1.5em;
  }

  h1 {
    font-size: 3em;
  }

  header.settings {
    display: flex;
    justify-content: space-between;
  }
}

@media screen and (min-width: 45em) {
  #main-nav {
    font-size: 1rem;
  }

  table {
    font-size: 1.75em;
  }

  h1 {
    font-size: 4em;
  }
  .account-balance {
    .diff {
      font-weight: 400;
    }
  }
}

@media screen and (min-width: 55em) {
  .navigation {
    margin: 0;
    & > a, & > span {
      position: absolute;
      top: 3.5em;
      width: 5em;
    }
    .next_page {
      right: -6em;
    }
    .previous_page {
      left: -6em;
    }
  }
}

