/* RWTH LAYOUT TITLE ADJUSTMENTS */
.navbar #title {
  margin-right: unset !important;
}

#nav-global #search-bar {
  max-width: 400px;
}

/* RWTH LAYOUT DROPDOWN-ITEM ADJUSTMENTS */
.dropdown-item.active, .dropdown-item:active {
  background-color: #eceded;
  color: unset;
}

.dropdown-menu-dark .dropdown-item.active, .dropdown-menu-dark .dropdown-item:active {
  background-color: rgba(255, 255, 255, 0.15);
}

/* DISPLAY TEXT PROPERLY INSIDE TOOLTIP TABLES */
.tooltip-inner .table {
  color: inherit;
}

/* LABEL ALIGNED RIGHT AND ITALIC */
.col-form-label, .form-control-label {
  font-style: italic;
}

/* ADDS CHEVRON TO COLLAPSES */
.card-header[data-bs-toggle="collapse"] {
  cursor: pointer;

  &::before {
    font-family: "Font Awesome 7 Free";
    content: "\f078";
    text-rendering: auto;
    font-variant: normal;
    font-style: normal;
    font-weight: 900;
    margin-right: 0.5rem;
  }

  &.collapsed::before {
    content: "\f054";
    margin-right: calc(0.5rem + 0.25em);
  }
}

@media (min-width: 768px) {
  .form-horizontal .col-form-label, .form-horizontal .form-control-label {
    text-align: right;
  }
}

/* BUTTON GROUPS SHOULD NOT STRETCH MOBILE VIEW; MAKE THEM BEHAVE LIKE VERTICAL BUTTON GROUPS */
@media (max-width: 767px) {
  .btn {
    white-space: initial;
  }
  .btn-group {
    flex-direction: column;
    align-items: flex-start;
    display: block;
    justify-content: center;

    > .btn:not(:last-child):not(.dropdown-toggle), > .btn-group:not(:last-child) > .btn {
      border-bottom-right-radius: 0;
      border-bottom-left-radius: 0;
    }

    > .btn:first-child, > .btn-group:first-child > .btn {
      border-top-right-radius: 0.25rem !important;
    }

    > .btn:last-child, > .btn-group:last-child > .btn {
      margin-left: 0;
      border-bottom-left-radius: 0.25rem !important;
    }

    > .btn:not(:first-child), > .btn-group:not(:first-child) > .btn {
      border-top-left-radius: 0;
      border-top-right-radius: 0;
      margin-left: 0;
    }

    > .btn + .btn {
      margin-top: -1px;
      margin-left: 0;
    }

    .btn-group {
      width: 100%;
    }

    .btn {
      width: 100%;
      white-space: initial;
    }
  }
}

.btn-group {
  > .btn:first-child {
    margin-left: 0;
  }
  > .btn:last-child {
    margin-right: 0;
  }
}

.link-disabled {
  opacity: 0.65;
  pointer-events: none;
}

/* OVERWRITE MEDIA QUERY TO PREVENT DISPLAY ISSUES IN INLINE FORMS */
.form-inline label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}
.form-inline .form-group {
  display: flex;
  flex: 0 0 auto;
  flex-flow: row wrap;
  align-items: center;
  margin-bottom: 0;
}
.form-inline .form-control-plaintext {
  display: inline-block;
}
.form-inline .form-control {
  display: inline-block;
  vertical-align: middle;
}
.form-inline .input-group,
.form-inline .custom-select {
  width: auto;
}

@media(min-width: 576px) {
  .form-inline .form-check {
    justify-content: left;
  }
}
.form-inline .form-check-input {
  position: relative;
  margin-top: 0;
  margin-right: 0.25rem;
  margin-left: 0;
}
.form-inline .custom-control {
  align-items: center;
  justify-content: center;
}
.form-inline .custom-control-label {
  margin-bottom: 0;
}

/* INPUT GROUPS NOW WORK LIKE BEFORE */
.form-group-invalid .input-group ~ .invalid-feedback {
  display: block;
}

/* CREATE RED BORDER AROUND ERROR ELEMENTS */
.form-group-invalid .input-group {
  > * {
    border-color: #dc3545;
  }
}

/* USED FOR NAVIGATION */
.ms-10px {
  margin-left: 10px !important;
}

.ms-30px {
  margin-left: 30px !important;
}

.ms-50px {
  margin-left: 50px !important;
}

.ps-30px {
  padding-left: 30px !important;
}

.ps-50px {
  padding-left: 50px !important;
}

.ps-70px {
  padding-left: 70px !important;
}