@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  .container {
    margin-left: auto;
    margin-right: auto;
  }

  .container:before {
    content: unset;
  }

  .form {
    min-width: 400px;
  }

  .form .btn {
    margin-top: 1.5rem;
  }

  .form .text-input {
    max-width: none;
  }

  .form-group {
    margin-top: 1rem;
  }

  .form-group-error {
    margin-left: -1.25rem;
    border-left-width: 0.25rem;
    border-left-color: theme('colors.error');
    border-left-style: solid;
    padding-left: 1rem;
    position: relative;
  }

  .btn {
    padding: 0.4rem 1rem 0.4rem 1rem;
  }

  .btn-primary {
    background-color: theme('colors.primary');
    color: theme('colors.white');
    border-color: theme('colors.primary');
  }

  .btn-primary:hover {
    background-color: theme('colors.primary-dark');
    border-color: theme('colors.primary-dark');
  }

  .btn-primary:active {
    background-color: theme('colors.primary-darker');
    border-color: theme('colors.primary-darker');
  }

  .btn-primary:focus,
  .btn-secondary:focus {
    outline: 0.2rem solid theme('colors.primary-light');
    outline-offset: 0.15rem;
  }

  .btn-secondary {
    background-color: theme('colors.white');
    color: theme('colors.primary');
    border-color: theme('colors.primary');
  }

  .btn-secondary:hover {
    color: theme('colors.primary-dark');
    border-color: theme('colors.primary-dark');
  }

  .btn-secondary:active {
    color: theme('colors.primary-darker');
    border-color: theme('colors.primary-darker');
  }

  .button-group {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
  }

  .button-group-item {
    margin: 0.25rem;
  }

  .label {
    max-width: 30rem;
  }

  .text-input,
  .file-input,
  .text-area,
  .select {
    width: 100%;
    margin-top: 0.5rem;
  }

  .text-input,
  .text-area,
  .select {
    border: 1px solid theme('colors.gray-darkest');
    border-radius: 0;
  }

  .text-input:focus,
  .file-input:focus,
  .text-area:focus,
  .select:focus {
    outline: 0.2rem solid theme('colors.primary-light');
  }

  .text-area {
    min-height: 6rem;
  }

  .toggle {
    margin-top: 0.5rem;
  }

  .toggle-dot {
    background-color: theme('colors.white');
    border: 1px solid theme('colors.gray-lighter');
  }

  .toggle-body {
    background-color: theme('colors.gray-lighter');
  }

  .toggle-body-on {
    background-color: #c316e9;
  }

  .toggle-label {
    color: theme('colors.text-dark');
  }

  .text-red {
    color: theme('colors.error');
  }

  .card {
    width: 280px;
    border: 2px solid theme('colors.gray-lighter');
    border-radius: 0.25rem;
  }

  .card:focus {
    outline: 0.2rem solid theme('colors.primary-light');
  }

  .card-header {
    padding: 1.5rem 1.5rem 0.5rem;
  }

  .card-header-menu {
    width: 100%;
    display: flex;
    justify-content: right;
    position: relative;
    top: 5px;
    right: 5px;
  }

  .card-header-media {
    min-height: 1px;
  }

  .card-header-img {
    height: 150px;
    background-color: theme('colors.gray-lighter');
    overflow: hidden;
  }

  .card-header-img > img {
    margin: auto auto;
  }

  .card-body {
    min-height: 75px;
    padding: 0.5rem 1.5rem;
  }

  .card-footer {
    padding: 0.5rem 1.5rem 1.5rem;
  }

  .modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    width: 100vw;
    height: 100vh;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: fixed;
  }

  .modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
  }

  .modal-main {
    min-width: 280px;
    min-height: 160px;
    background-color: theme('colors.white');
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.04);
  }

  .modal-heading {
    background-color: theme('colors.white');
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
  }

  .modal-title {
    margin: 0;
    padding: 10px 24px;
    color: theme('colors.text-dark');
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid theme('colors.gray-lighter');
  }

  .modal-close-btn {
    color: theme('colors.text-dark');
    font-weight: 700;
    width: 12px;
    height: 12px;
    margin: 8px;
    border: none;
    background-color: theme('colors.white');
    box-shadow: 0 5px 20px 0 rgba(0, 0, 0, 0.06);
    position: absolute;
    right: 8px;
    top: 8px;
    align-self: flex-end;
  }

  .modal-close-btn:active {
    border: 2px solid theme('colors.primary-darker');
  }

  .modal-body {
    min-height: 120px;
    max-height: 90vh;
    overflow-y: auto;
    color: theme('colors.text-dark');
    padding: 16px 24px;
    font-size: 0.93rem;
  }

  .modal-footer {
    border-top: 1px solid theme('colors.gray-lighter');
    padding: 10px 24px;
  }

  .modal-btn-group {
    display: flex;
    justify-content: flex-end;
  }

  .modal-btn-group button {
    margin-left: 8px;
  }

  .tag {
    background-color: theme('colors.gray-lighter');
    color: theme('colors.gray-darkest');
    font-size: 0.93rem;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
  }

  .alert {
    border-left: 0.5rem solid theme('colors.gray-lighter');
    color: #1b1b1b;
  }

  .alert-body {
    padding-left: 4rem;
    padding-right: 4rem;
    color: theme('colors.text-dark');
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem;
    font-size: 1rem;
  }

  .alert-text {
    color: theme('colors.text-dark');
  }

  .alert-success {
    border-left-color: theme('colors.success');
    background-color: theme('colors.success-light');
  }

  .alert-warning {
    border-left-color: theme('colors.warning');
    background-color: theme('colors.warning-light');
  }

  .alert-error {
    border-left-color: theme('colors.error');
    background-color: theme('colors.error-light');
  }

  .alert-info {
    border-left-color: theme('colors.info');
    background-color: theme('colors.info-light');
  }

  .card:hover .context-menu-container,
  .card:focus .context-menu-container {
    display: block;
  }

  .context-menu-container {
    display: none;
    position: absolute;
    color: theme('colors.text-dark');
    width: 24px;
    height: 24px;
    border: 1px solid theme('colors.gray-lighter');
    border-radius: 50%;
    background-color: theme('colors.white');
    cursor: pointer;
  }

  .context-menu-container:focus .context-menu {
    display: block;
  }

  .context-menu {
    display: none;
    list-style: none;
    position: absolute;
    top: 28px;
    right: 0;
    background-color: theme('colors.white');
    border: theme('colors.gray-lighter');
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0;
    min-width: 120px;
  }

  .context-menu li {
    padding: 6px 12px;
    cursor: pointer;
  }

  .context-menu li:hover {
    background-color: theme('colors.gray-lightest');
  }

  .context-menu li a {
    text-decoration: none;
    color: theme('colors.text-dark');
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .context-menu li a.disabled {
    cursor: not-allowed;
    color: theme('colors.gray-light') !important;
  }

  .grid-heading-left,
  .grid-heading-right {
    width: 120px;
  }

  .grid-spacer {
    position: relative;
    top: 12px;
  }

  @media only screen and (min-width: 1537px) {
    .grid-spacer {
      width: 1460px;
    }
  }

  @media only screen and (min-width: 1537px) and (max-width: 1920px) {
    .grid-spacer {
      width: 1160px;
    }
  }

  @media only screen and (min-width: 1281px) and (max-width: 1536px) {
    .grid-spacer {
      width: 960px;
    }
  }

  @media only screen and (min-width: 1025px) and (max-width: 1280px) {
    .grid-spacer {
      width: 660px;
    }
  }

  @media only screen and (min-width: 769px) and (max-width: 1024px) {
    .grid-spacer {
      width: 460px;
    }
  }

  @media only screen and (min-width: 641px) and (max-width: 768px) {
    h1 {
      padding-bottom: 24px;
    }

    .grid-spacer {
      width: 320px;
    }

    #create-app {
      width: 120px;
    }
  }

  @media only screen and (max-width: 640px) {
    .container {
      padding-left: 15px;
      padding-right: 15px;
    }

    h1 {
      padding-bottom: 24px;
    }

    .btn {
      width: 100%;
    }

    .card {
      width: 100%;
    }

    .card-header-media,
    .grid-heading-center,
    .grid-heading-right,
    .grid-heading-right > h2 {
      display: none;
    }

    #create-app {
      width: 120px;
    }
  }
}
