@use "../../../../../styles/abstracts/variables";
@use "../../../../../styles/abstracts/mixins";

.add {
  background: rgba(0, 0, 0, 0.9);
  position: fixed;
  inset: 0; // shorthand for top, right, bottom, left = 0
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; // keeps background fixed
  animation: fadeIn 0.25s ease-in-out;

  &__content {
    width: 100%;
    max-width: 520px;
    max-height: 90vh; // ensures modal fits screen height
    background: #1e1e1e;
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    font-size: 0.95rem;
    color: variables.$col-white;
    position: relative;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
    overflow-y: auto; // allows only modal body to scroll
    scrollbar-width: none;
    animation: slideUp 0.3s ease-out;

    // hide scrollbar visually but keep scrolling functional
    &::-webkit-scrollbar {
      width: 0;
      background: transparent;
    }

    &--close {
      position: absolute;
      top: 1rem;
      right: 1rem;
      background: variables.$col-danger-bg;
      color: variables.$col-danger-color;
      padding: 0.35rem 0.7rem;
      border-radius: 5px;
      cursor: pointer;
      font-weight: 600;
      font-size: 0.75rem;
      transition: all 0.2s ease-in-out;

      &:hover {
        background: darken(variables.$col-danger-bg, 10%);
        transform: scale(1.05);
      }
    }

    &--details {
      margin-top: 1rem;

      &--header {
        &--helper {
          background: variables.$col-orange;
          margin-bottom: 1rem;
          max-width: 30%;
          padding: 0.4rem 0.3rem;
          border-radius: 20px;
          color: variables.$col-dark;
          font-size: 0.7rem;
          font-weight: 600;
          text-align: center;
          text-transform: capitalize;
          @media only screen and (max-width: 600px) {
            max-width: 45%;
          }
        }

        h2 {
          font-weight: 600;
          font-size: 1.05rem;
          border-bottom: 1px solid variables.$col-border-lining;
          padding-bottom: 0.4rem;
          color: variables.$col-white;
          margin-bottom: 0.5rem;
        }

        p {
          font-size: 0.83rem;
          line-height: 1.6;
          opacity: 0.8;
          margin-bottom: 1.5rem;
        }
      }

      form {
        display: flex;
        flex-direction: column;
        gap: 1rem;

        label {
          font-size: 0.8rem;
          color: #ccc;
          font-weight: 400;
          margin-bottom: 0.3rem;
        }

        input,
        select,
        textarea {
          width: 100%;
          background: #1a1a1a;
          border: 1px solid #333;
          border-radius: 0.5rem;
          padding: 0.6rem 0.9rem;
          font-size: 0.85rem;
          color: #eee;
          transition: all 0.2s ease-in-out;

          &:focus {
            outline: none;
            border-color: variables.$col-orange;
            box-shadow: 0 0 0 2px rgba(variables.$col-orange, 0.15);
          }

          &::placeholder {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.85rem;
          }
        }

        textarea {
          height: 7rem;
          resize: vertical;
        }

        button {
          background: variables.$col-orange;
          padding: 0.8rem;
          border-radius: 10px;
          color: variables.$col-dark;
          font-size: 0.85rem;
          font-weight: 600;
          width: 100%;
          margin-top: 0.5rem;
          transition: all 0.25s ease;

          &:hover {
            background: darken(variables.$col-orange, 5%);
            transform: translateY(-2px);
          }

          &:active {
            transform: translateY(0);
          }
        }
      }
    }
  }
}

@keyframes fadeIn {
  from {
    background: rgba(0, 0, 0, 0);
  }
  to {
    background: rgba(0, 0, 0, 0.9);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
