/*
 * 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.
 */

a {
  outline: none;
}

body.root {
  overflow: auto;
  margin: 12px;
  display: block;
  width: auto;
  height: auto;
  font-size: 13px;

  .header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;

    .logo {
      color: #58b;
      font-size: 1.5rem;
      font-weight: bold;

      .description {
        color: #369;
        font-size: 1rem;
        font-weight: normal;
        opacity: 0.6;
        text-wrap: nowrap;
      }
      a {
        text-decoration: none;
        color: #58b;

        &:hover {
          color: #8cf;
          border-bottom: 8px solid #8cf;
        }
      }
    }

    .top-nav {
      margin-right: 9rem;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 0.5rem;

      a {
        display: block;
        padding: 5px 8px;
        background: #58a;
        text-decoration: none;
        color: #eee;
        opacity: 0.7;
        border-radius: 5px;
        transition: all 0.1s ease-in;

        &:hover {
          opacity: 1;
          color: #fff;
        }
      }
    }
  }

  #footer {
    border-top: 0;
    margin-top: 20px;
    .sponsor a {
      border: 0;
    }
  }

  @media (max-width: 830px) {
    .header {
      flex-direction: column;

      .top-nav {
        margin-right: 0;
        justify-content: flex-start;
      }
    }

    .learn-yard {
      display: none;
    }
  }
}

#content .libraries {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;

  .row {
    font-size: 1rem;
    line-height: 1.4em;
    padding: 3px 5px;
    line-height: 2em;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;

    &.r1 {
      background: #eee;
    }
    &.r2 {
      background: #f8f8f8;
    }

    &:hover {
      background: #eef;
    }

    .library {
      flex-grow: 1;
      text-wrap: nowrap;
      white-space: nowrap;
      overflow: hidden;
      margin-right: 4px;
      text-overflow: ellipsis;
    }

    a:hover {
      background: transparent;
      color: #3ae;
    }

    .actions {
      display: flex;
      justify-items: flex-end;
      align-items: center;
      margin-right: 4px;
      gap: 2px;

      a,
      form {
        width: 22px;
        height: 22px;
        display: inline-block;
        &:hover {
          background: transparent;
        }

        img,
        button {
          width: 16px;
          height: 16px;
          border: 1px solid #ccc;
          background: #eee;
          padding: 2px;
          border-radius: 3px;

          &:hover {
            background: #fff;
          }
        }

        form {
          width: 22px;
          height: 22px;
        }

        .reload {
          border: 0;
          padding: 0;
          height: 16px;
          width: 16px;
          background: transparent;
          cursor: pointer;

          &:hover {
            background: #fff;
          }
        }
      }
    }
  }
}

.about {
  font-size: 1.1em;
  line-height: 1.4em;

  a {
    color: #05a;

    &:hover {
      color: #5af;
    }
  }
}

#notice {
  border-left: 8px solid #58b;
  padding: 12px;
  background: #333;
  color: #eee;
  width: 545px;
  font-size: 1em;
  line-height: 1.4em;

  strong {
    color: #fff;
  }
  a {
    color: #8cf;
    text-decoration: none;
  }
  #notice a:hover {
    text-decoration: underline;
  }
}

.learn-yard {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 9500;
  opacity: 0.9;

  &:hover {
    opacity: 1;
  }

  img {
    border: 0;
  }
}

.alpha_index {
  display: block;
  padding-left: 0;
  font-size: 1.2em;
  margin-bottom: 30px;

  li {
    display: inline;
    padding: 0 1px;

    &.selected {
      padding: 3px 4px;
      margin-right: 0;
      background: #dedede;
    }

    a {
      padding: 3px 4px;
      margin-right: 0;
      background: #eee;
    }
  }
}

.tabbed-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: larger;

  &.alpha {
    margin-bottom: 1rem;
    & > * {
      padding: 3px 4px;
    }
  }

  &.numeric {
    font-size: small;
    & > * {
      padding: 3px 4px;
    }
    .selected {
      background: #e5e5e5;
    }
    a {
      background: #f8f8f8;
    }
  }

  & > * {
    padding: 6px 8px;

    &.search {
      padding: 0;
    }
  }
  .selected {
    background: #dedede;
  }
  a {
    background: #eee;
    text-decoration: none;
  }
}

nav {
  form {
    display: inline;

    input {
      border: 1px solid #dedede;
      color: #111;
      padding: 6px 8px;
      width: 200px;
    }
  }
}

#content {
  h1 {
    margin: 0;
  }

  h2 {
    margin-top: 0.8em;

    .small {
      font-size: small;
    }
  }

  &.fof {
    h1 {
      margin-bottom: 0;
      font-size: 3em;
    }

    h2.nomargin {
      margin-top: 0;
      border: 0;
      font-size: 1.2em;
      color: #888;
      margin-bottom: 20px;
    }
  }
}

.sponsor {
  margin-top: 12px;

  p {
    padding: 0;
    margin: 0;
    margin-bottom: 9px;
  }

  a {
    margin-right: 9px;

    &:last {
      margin-right: 0;
    }
  }

  img {
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 12px;
  }
}

#modal-show {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  z-index: 9999;

  a.close {
    display: block;
    width: 100%;
    text-align: right;
    font-weight: bold;
    text-decoration: none;
    color: black;
  }

  .content {
    position: fixed;
    top: 4rem;
    left: 50%;
    translate: -50% 0;
    background: #fefefe;
    padding: 20px;
    box-shadow: 0px 2px 15px #aaa;
    z-index: 10000;
    width: 80%;
    max-width: 600px;
    border-radius: 6px;

    h2 {
      margin-top: 0;
    }

    .tender {
      border: 0;
      width: 100%;
      height: 80vh;
    }
  }

  &.no-margin {
    a.close {
      position: fixed;
      top: -1.4rem;
      right: -1.4rem;
      width: auto;
      z-index: 9999;
      display: block;
      color: white;
      background-color: rgba(0, 0, 0, 0.7);
      border-radius: 50%;
      width: 24px;
      height: 24px;
      text-align: center;

      span {
        position: relative;
        top: 2px;
      }
    }

    .content {
      padding: 0;
    }
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;

  .group {
    display: flex;
    flex-direction: row;
    gap: 1rem;

    .field_with_errors {
      color: #e00;
      display: flex;
      flex-direction: row;

      input {
        border: 1px solid #e00;
        background-color: #fdd;
        flex-grow: 1;
      }

      & + .field_with_errors {
        flex-grow: 1;
      }
    }

    label {
      width: 8rem;
    }

    input {
      flex-grow: 1;
    }
  }

  .errors {
    margin-top: 1rem;
  }

  .btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.5rem;
    background-color: #58a;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;

    &:hover {
      background-color: #58b;
    }

    &:disabled {
      background-color: #ccc;
      cursor: default;
    }
  }
}

#content {
  .add-library-small {
    width: 400px;
    padding: 12px 16px;
    padding-bottom: 16px;
    border-radius: 4px;
    background: #eee;

    h2 {
      margin-top: 0;
    }
  }
}
