@import url("https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400..700;1,400..700&display=swap");

:root {
  --secondary-color: #f5f5f5;
  --secondary-color-highlight: #f3f3f3;
  --third-main-color: #ffff;
  --main-color: #5636d9;
  --main-color-highlight: #6a4aec;
  --success-color: #146714;
  --error-color: #b11616;
  --color-dark: black;
  --color-light: #ffff;
  --color-dynamic-dark: black;
  --color-dynamic-light: #ffff;
  --image-width: 250px;
  --box-shadow-dynamic: rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cabin", sans-serif;
  font-size: 16px;
}
body {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(1px, 1fr);
  background-color: var(--third-main-color);
}
h1 {
  font-size: 2.2rem;
}
h2 {
  font-size: 1.5rem;
}
button {
  cursor: pointer;
}
a {
  text-decoration: none;
  color: black;
}
a:hover,
a:visited:hover {
  color: var(--main-color);
}
a:visited {
  color: inherit;
}

.navbar {
  height: 60px;
  padding: 0 25px;
  background-color: var(--secondary-color);
  position: sticky;
  top: 0;
  z-index: 99;
}
.nav-container {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar-brand {
  color: var(--main-color) !important;
}
.navbar-brand:hover,
.navbar-brand:visited:hover {
  color: var(--main-color-highlight) !important;
}
.navbar-user-part {
  display: flex;
  align-items: center;
}
.navbar-user-part a {
  margin-right: 15px;
}
.nav-right {
  display: flex;
  flex-direction: row;
}
.nav-right a {
  margin-left: 10px;
}
#nav-avatar {
  width: 45px;
  height: 45px;
  cursor: pointer;
  z-index: 100;
}
.upload-button {
  height: 100%;
  padding: 5px 12px;
  background-color: var(--main-color);
  border-radius: 5px;
}
.upload-button:hover {
  background-color: var(--main-color-highlight);
}
.upload-button img {
  width: 25px;
}
.nav-profile-menu {
  position: absolute;
  width: 200px;
  height: 225px;
  display: flex;
  flex-direction: column;
  align-items: end;
  justify-content: space-between;
  padding: 55px 10px 10px 10px;
  right: 0;
  top: 0;
  z-index: 99;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  background-color: var(--secondary-color);
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.5s;
  visibility: hidden;
}
.nav-profile-menu.active {
  opacity: 1;
  visibility: visible;
}
#nav-profile-menu-logout {
  width: 100%;
  display: flex;
  padding-top: 5px;
  justify-content: end;
  border-top: 2px solid var(--main-color);
}
#nav-profile-menu-username {
  position: absolute;
  top: 20px;
  left: 15px;
  max-width: 100px;
  word-break: break-all;
  color: var(--color-dynamic-dark);
}
#nav-profile-menu-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: 5px;
  padding-right: 10px;
  align-items: end;
  color: var(--color-dynamic-dark);
}
#nav-profile-menu-links div {
  display: flex;
  flex-direction: row;
  align-items: center;
}
#nav-profile-menu-links div p {
  margin-right: 5px;
}
#nav-profile-menu-links a {
  color: var(--color-dynamic-dark);
}
#nav-profile-menu-links a:visited {
  color: var(--color-dynamic-dark);
}
#nav-profile-menu-links a:hover {
  color: var(--main-color);
}

#search-form {
  max-width: 600px;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  margin: 0 25px;
  border: 2px solid var(--color-dark);
  border-radius: 5px;
  padding-left: 8px;
  background-color: var(--color-light);
}
#search-input-field,
#search-input-field-responsive {
  height: 35px;
  width: 100%;
  border: none;
  outline: none;
  background-color: transparent;
}
#search-button {
  width: 50px;
  height: 35px;
  outline: none;
  border: none;
  display: flex;
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
  justify-content: center;
  align-items: center;
  background-color: transparent;
}
#search-button:hover {
  background-color: var(--secondary-color);
}
#search-icon {
  width: 20px;
  pointer-events: none;
}

.container {
  width: 100%;
  height: 100%;
  margin: auto;
  padding: 50px 10px 20px 10px;
  background-color: var(--third-main-color);
}
.home-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
}
#home-title {
  font-size: 3.2rem;
  text-align: center;
}
.home-info-text {
  font-size: 1.2rem;
  margin-top: 15px;
}
.home-container .link-button {
  margin-top: 8px;
}

.link-button {
  text-decoration: none;
  color: var(--color-light);
  outline: none;
  border: none;
  height: 40px;
  min-width: 70px;
  padding: 0 10px;
  border-radius: 5px;
  background-color: var(--main-color);
  font-size: 1rem;
}
.link-button:hover {
  background-color: var(--main-color-highlight);
}

.form-title {
  text-align: center;
  color: var(--color-dynamic-dark);
}
.form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  color: var(--color-dynamic-dark);
}
.form-container div {
  width: 100%;
  max-width: 425px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}
.errorlist {
  list-style: none;
  color: var(--error-color);
  max-width: 420px;
  text-align: center;
}
.helptext {
  font-size: 0.8rem;
  margin-top: 0 !important;
}
.form-container label {
  font-size: 1.1rem;
}
.form-container input {
  border-radius: 5px;
  height: 30px;
  outline: none;
  padding: 0 5px;
  border: 2px solid var(--color-dark);
  margin-top: 5px;
  font-size: 1rem;
}
.form-container input[type="file"] {
  max-width: 300px;
  border: none;
}
.form-container .link-button {
  margin-top: 5px;
}
.alert {
  text-align: center;
  color: var(--error-color);
}
.alert-success {
  color: var(--success-color);
  position: absolute;
  width: 100%;
  text-align: center;
  top: 75px;
  left: 0;
  transition: opacity 0.5s;
  font-size: 1.1rem;
}
.alert-success.hide {
  opacity: 0;
}
.tag-input-container {
  display: flex;
  flex-direction: row !important;
  border: 2px solid var(--color-dark);
  justify-content: space-between;
  align-items: center;
  border-radius: 5px;
  background-color: var(--color-light);
}
.tag-input-container input {
  flex: 1;
  margin-top: 0 !important;
  border: none;
  background-color: transparent;
}
.add-tag-button {
  height: 30px;
  width: 60px;
  /* border-top-right-radius: 2px; */
  /* border-bottom-right-radius: 2px; */
  border: none;
  outline: none;
  cursor: default;
  color: var(--color-light);
  background-color: var(--secondary-color);
}
.add-tag-button.active:hover {
  background-color: var(--main-color-highlight);
}
.add-tag-button.active {
  cursor: pointer;
  background-color: var(--main-color);
}

footer {
  width: 100%;
  min-height: 100px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-top: 2px solid var(--main-color);
  background-color: var(--secondary-color);
  font-size: 14px;
  color: var(--color-dynamic-dark);
}

#no-results-text {
  text-align: center;
  color: var(--color-dynamic-dark);
}
.images-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--image-width));
  grid-auto-rows: 10px;
  column-gap: 1.2rem;
  justify-content: center;
}
.item {
  width: 100%;
  display: flex;
  flex-direction: column;
  max-width: var(--image-width);
  break-inside: avoid;
  border-radius: 5px;
  background-color: var(--third-main-color);
  box-shadow: 0 2px 10px var(--box-shadow-dynamic);
  visibility: hidden;
}

.item.show {
  visibility: visible;
}
.item-image {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.item-image:hover {
  filter: brightness(0.7);
}
.item-detail-container {
  display: flex;
  height: 45px;
  max-height: 45px;
  flex-direction: row;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  color: var(--color-dynamic-dark);
}
.item-detail-container a {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-decoration: none;
  color: var(--color-dynamic-dark);
}
.item-detail-container a:hover {
  color: var(--main-color);
}
.item-username {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 3px;
}

.item-username-left {
  margin-left: 5px;
}
.item-desc {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-dynamic-dark);
}
.item-desc:hover {
  color: var(--main-color);
}

.profile-avatar-img {
  width: 30px;
  height: 30px;
}
.avatar {
  border-radius: 50%;
  object-fit: cover;
}
.profile-container {
  width: 100%;
  max-width: 1000px;
  padding: 0 10px;
  margin: auto;
}
.profile-avatar {
  width: 250px;
  height: 250px;
  margin-bottom: 25px;
}
.profile-about-container {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  padding: 25px;
}
#profile-username {
  padding-top: 30px;
  padding-right: 5px;
  word-break: break-word;
  color: var(--color-dynamic-dark);
}
.profile-about-right {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
}
.profile-show-selection {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}
.profile-show-button {
  text-align: center;
  width: 135px;
  padding: 8px 5px;
  border-radius: 5px;
  color: var(--color-dynamic-dark);
}
.profile-show-button:hover,
.profile-show-button.active {
  background-color: var(--secondary-color);
}
.profile-show-button:visited,
.profile-show-button:hover,
.profile-show-button:visited:hover {
  color: var(--color-dynamic-dark);
}
#profile-show-buttons-inbetween-bar {
  height: 30px;
  width: 3px;
  margin: 0 10px;
  border-radius: 10px;
  background-color: var(--main-color);
}
.no-photos-text {
  text-align: center;
  color: var(--color-dynamic-dark);
}
.profile-uploads-container .edit-image-button {
  height: 35px;
}

.edit-profile-avatar-container {
  display: flex;
  flex-direction: row !important;
}
.edit-profile-avatar-wrapper {
  align-items: center;
}
.edit-profile-avatar-container img {
  width: 80px;
  height: 80px;
}
#edit-profile-upload-button-wrapper {
  width: 100%;
  margin-top: 15px;
  display: flex;
  justify-content: center;
}
.edit-profile-upload-button {
  height: 45px;
  width: 100px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background-color: var(--main-color);
  outline: none;
  border: none;
  color: var(--color-light);
  border-radius: 5px;
  padding: 5px 8px;
}
.edit-profile-upload-button:visited,
.edit-profile-upload-button:visited:hover {
  color: var(--color-light);
}
.edit-profile-upload-button:hover {
  background-color: var(--main-color-highlight);
}
.edit-profile-upload-button img {
  height: 25px;
}

#upload-image-preview {
  width: 300px;
  height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 5px;
  border: 2px dotted var(--color-dynamic-dark);
  margin: auto;
}
#upload-image-preview.highlight,
#upload-image-preview.show.highlight {
  background-color: var(--secondary-color-highlight);
}
#upload-image-preview.show {
  border: none;
  background: rgba(0, 0, 0, 0.9);
}
#upload-preview-image {
  display: none;
}
#upload-preview-image.show {
  display: block;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.edit-image-container {
  width: 100%;
  margin: auto;
  display: flex;
  padding-top: 10px;
  flex-direction: row;
  max-width: 1000px;
  justify-content: center;
}
.edit-image-preview {
  height: 450px !important;
  max-width: 525px;
  margin-right: 15px;
}
#imagePreview {
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
#edit-form-wrapper {
  width: 100%;
  max-width: 525px;
}
#editForm {
  width: 100%;
}
.tag-input-wrapper {
  flex-direction: row !important;
  justify-content: space-between;
  align-items: center;
  border: 2px solid black;
  border-radius: 5px;
  padding-left: 2px;
  background-color: var(--color-light);
}
.tag-input-wrapper input {
  height: 30px;
  outline: none;
  border: none;
  margin-top: 0px !important;
  flex: 1;
}
#addTagBtn {
  background-color: var(--secondary-color);
  cursor: auto;
}
#addTagBtn.active {
  cursor: pointer;
  background-color: var(--main-color);
}
.tag-input-wrapper button {
  height: 30px;
  border-radius: 0;
  margin-top: 0px !important;
}
.delete-button-container {
  width: 100%;
  max-width: 425px;
  margin: auto;
}
#deleteBtn {
  width: 100%;
  max-width: 140px;
  margin-top: 10px;
  background-color: var(--error-color);
}
.close {
  outline: none;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
}

.image-details {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}
.image-details span,
.image-details p {
  color: var(--color-dynamic-dark);
}
.details-image-container {
  width: 100%;
  height: 500px;
  margin-bottom: 5px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 5px;
}
.details-image {
  display: block;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.image-details-info-container {
  display: flex;
  justify-content: space-between;
  padding: 0 5px;
  margin-bottom: 5px;
  color: var(--color-dynamic-dark);
}
.edit-image-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-light) !important;
}
.edit-image-button,
.edit-image-button:hover,
.edit-image-button:visited,
.edit-image-button span {
  color: var(--color-light) !important;
}
.edit-image-button span {
  margin-right: 5px;
}
.details-profile-link {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}
.add-field {
  display: flex;
  margin: 10px 0;
  justify-content: space-between;
  align-items: center;
  border: 2px solid;
  border-radius: 5px;
  padding: 6px;
  background-color: var(--color-light);
}
.add-button {
  border-radius: 5px;
  height: 40px;
  min-width: 55px;
  border: none;
  padding: 2px;
  color: var(--color-light);
  background-color: var(--main-color);
}
.add-button:hover {
  opacity: 0.8;
}
.tags-list {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row !important;
  justify-content: start;
  width: auto;
  margin-top: 0 !important;
}
.tag-pill {
  min-width: 80px !important;
  margin: 2px;
  background-color: black;
  /* background-color: var(--main-color); */
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
  width: fit-content !important;
  align-items: center;
  height: 35px;
  display: flex;
  flex-direction: row !important;
  justify-content: space-between;
  border-radius: 2em;
  color: var(--color-light);
}
.tags-text {
  padding: 12px;
  flex: 1;
  text-align: center;
  font-weight: 500;
  color: var(--color-light) !important;
}
.tag-remove {
  background: none;
  border: none;
  color: var(--color-light);
  margin-right: 10px;
}
.tag-remove:hover {
  color: var(--main-color);
}
textarea {
  resize: none;
  outline: none;
  border: none;
  margin-right: 5px;
  border-bottom: 2px;
  /* Works only on chrome   */
  field-sizing: content;
  flex-grow: 1;
}
.comment-field {
  border-radius: 5px;
  margin: 10px 0;
  padding: 6px;
  border: 1px solid;
}
.comment-header {
  display: flex;
  margin: 0 2px;
  align-items: center;
  justify-content: space-between;
}
.comment-age {
  color: #484a4a;
}
.comment-text {
  word-break: break-word;
  padding-bottom: 5px;
  margin: 10px;
}
.details-topbar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: var(--color-dynamic-dark);
}
.like-icon,
.like-icon-fill {
  width: 20px;
  height: 20px;
  cursor: pointer;
  stroke: var(--main-color);
}
.like-icon-fill {
  fill: var(--main-color);
}

.hidden {
  display: none;
}
.like-button {
  background: none;
  border: none;
}
#likes {
  margin: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.likes-amount {
  margin-left: 5px;
}
.detail-avatar-img {
  width: 40px;
  height: 40px;
}

#show-search-button {
  width: 45px;
  height: 35px;
  outline: none;
  border: none;
  display: none;
  border-radius: 5px;
  justify-content: center;
  align-items: center;
  background-color: var(--color-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
#show-search-button:hover {
  background-color: var(--secondary-color);
}

body.dark {
  --main-color: #6d4df0;
  --main-color-highlight: #7f60fc;
  --secondary-color: #1d1d1d;
  --secondary-color-highlight: #2c2c2c;
  --third-main-color: #303030;
  --color-dynamic-dark: #ffff;
  --color-dynamic-light: black;
  --box-shadow-dynamic: rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root {
    --main-color: #6d4df0;
    --main-color-highlight: #7f60fc;
    --secondary-color: #1d1d1d;
    --secondary-color-highlight: #2c2c2c;
    --third-main-color: #303030;
    --color-dynamic-dark: #ffff;
    --color-dynamic-light: black;
    --box-shadow-dynamic: rgba(0, 0, 0, 0.4);
  }
  .like-icon,
  .like-icon-fill {
    stroke: var(--color-light);
  }
}

@media (max-width: 680px) {
  .profile-about-container {
    flex-direction: column;
    padding: 0 25px 25px 25px;
  }
  .profile-avatar {
    width: 200px;
    height: 200px;
  }
  #profile-username {
    padding-top: 0;
    padding-right: 0;
    margin-bottom: 10px;
    text-align: center;
  }
  .edit-image-container {
    flex-direction: column !important;
    align-items: center;
    justify-content: start;
  }
  .edit-image-preview {
    margin-right: 0;
    height: 400px !important;
  }
}

@media (max-width: 580px) {
  #show-search-button {
    display: flex;
  }
  #search-form {
    width: 100%;
    height: 40px;
    position: absolute;
    top: 60px;
    left: 0;
    z-index: 99;
    display: none;
    flex-direction: row;
    margin: 0;
    border-radius: 0;
    border: none;
    align-items: center;
    flex: 1;
    padding-left: 8px;
    background-color: var(--color-light);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.2);
  }
  #search-form input,
  #search-form button {
    height: 100%;
  }
  #search-form.active {
    display: flex;
  }
  .navbar {
    padding: 0 10px;
  }
  .navbar-user-part a {
    margin-right: 10px;
  }
}

@media (max-width: 380px) {
  .navbar-brand h2 {
    font-size: 1.3rem;
  }
  .profile-show-button {
    font-size: 0.9rem;
  }
}
