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

* {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  background-color: #1b2838;
  color: #fff;
}

a {
  color: cyan;
}

.base-container {
  width: 1760px;
  max-width: 90%;
  min-height: calc(
    100dvh - 56px
  ); /* Calculating Dynamic view height and subtracting footer size */
  margin: 0 auto;
}

.page-header {
  /* margin-top: 64px; */
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.page-header img {
  height: 150px;
  max-width: 100%;
  object-fit: contain;
}

.page-header .title,
.page-header .subTitle,
.page-header img {
  animation: fadeInUp 0.25s both;
  text-align: center;
}

.page-header .title {
  font-weight: 600;
  font-size: 2.75rem;
  font-family: "Kode Mono", Arial, sans-serif;
  font-weight: bolder;
}

.page-header .subTitle {
  animation-delay: 0.1s;
  font-size: 1rem;
  font-weight: 300;
  color: #bbb;
}

.search-container {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.search-container .input-group {
  width: 100%;
  display: grid;
  align-items: center;
  justify-content: center;
  grid-template-columns: minmax(auto, 500px) 128px;
}

.search-container .input-group input {
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: 100px 0 0 100px;
  /* border: 1px solid #ccc; */
  outline: none;
}

.search-container .input-group button {
  background: linear-gradient(45deg, green, rgb(0, 204, 0));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.2);
  text-wrap: nowrap;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  border-radius: 0 100px 100px 0;
  cursor: pointer;
  font-size: 1rem;
  transition: opacity 0.25s;
}

button > img {
  margin-right: 5px;
  height: 20px;
}

button:hover {
  opacity: 0.8;
}

.checkbox-container {
  display: flex;
}

.checkbox-container label {
  margin-right: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.checkbox-container [type="checkbox"] {
  margin-right: 5px;
  accent-color: rgb(0, 204, 0);
  height: 16px;
  width: 16px;
}

.checkbox-container [type="checkbox"]:checked {
  box-shadow: 0 0 6px green;
}

.page-content {
  position: relative;
  margin: 64px 0;
}

.main-content {
  position: relative; /* Needed for selected stickers list positioning  */
  flex: 1; /* Needed to keep the footer on the bottom */

  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
}

.selected-stickers-container {
  height: 100%;
}

.selected-stickers-wrapper {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.selected-stickers-list {
  width: 150px;
  flex-direction: column;
  text-align: center;
  font-weight: bold;
  list-style: none;
  gap: 3px;
  box-shadow: 0 0 5px #1b2838;
}

.selected-sticker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  -webkit-user-select: text;
  -moz-user-select: text;
  -o-user-select: text;
  user-select: text;
  backdrop-filter: blur(20px);
}

.selected-sticker-item:not(:has(> img), :nth-of-type(1))::after {
  content: "No sticker selected";
  margin: auto 0;
  font-family: Arial, sans-serif;
  font-weight: lighter;
  font-size: 13px;
  color: #bbb;
}

.selected-sticker-item:has(.sticker-image:hover) {
  background-image: url("/assets/img/icons/trash-2.svg");
  background-repeat: no-repeat;
  background-size: 20px;
  background-position-x: 10px;
  background-position-y: 10px;
}

/* Round top and bottom items */
.selected-sticker-item:first-child {
  border-radius: 5px 5px 0 0;
}

.selected-sticker-item:last-child {
  border-radius: 0 0 5px 5px;
}

.selected-sticker-info {
  font-weight: normal;
  font-size: small;
}

.results-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  flex: 1;
  padding: 0 32px;
}

.result-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 150px;
}

.matched-part,
.info-message {
  text-align: center;
}

.matched-part {
  font-weight: bold;
  margin-bottom: 10px;
}

.sticker-image {
  width: 100%;
  height: auto;
  margin-bottom: 5px;
  cursor: pointer;
  position: relative; /* Needed for tooltip positioning */
}

.sticker-image:hover::after {
  content: attr(data-name); /* Use data attribute for tooltip text */
  visibility: visible;
  position: absolute;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  z-index: 1;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.info-message {
  margin-top: 20px;
  font-style: italic;
  width: 100%;
}

.sticker-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
  animation: fadeInUp 0.25s both;
}

.sticker-wrapper::after {
  content: attr(data-name); /* Use the data-name attribute for the tooltip */
  visibility: hidden;
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%) translateY(-10px);
  white-space: nowrap;
  z-index: 1;
  background-color: black;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  opacity: 0;
  transition: visibility 0s, opacity 0.2s ease-in-out;
}

.sticker-wrapper:hover {
  z-index: 2;
}

.sticker-wrapper:hover::after {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-15px); /* Slightly raise the tooltip */
}

#result-index-controls {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  font-size: 2rem;
  gap: 1rem;

  display: none;
}
#result-index-controls > * {
  cursor: pointer;
}
footer {
  text-align: center;
  padding: 20px 0;
  background-color: #131d29;
  color: #bbb;
  font-size: 0.875rem;
  width: 100%;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 0;
  padding: 0;
}

#infoContainer {
  margin: 10px 0;
  text-align: center;
}

#infoContainer {
  margin: 10px 0;
  text-align: center;
}

#add-selected-to-canvas {
  display: none;
  width: 100%;
}

#add-selected-to-canvas button {
  background: linear-gradient(45deg, green, rgb(0, 204, 0));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.2);
  text-wrap: nowrap;
  width: 100%;
  height: 35px;
  color: #fff;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: 0.25s;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Mobile media queries*/
@media only screen and (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .selected-stickers-container {
    position: sticky;
    bottom: 0;
  }

  .selected-sticker-item:first-child {
    border-radius: 5px;
  }

  .selected-sticker-item:last-child {
    border-radius: 5px;
  }

  .selected-stickers-list {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
  }

  .selected-sticker-item {
    flex: 1 1 100px;
    border-radius: 5px;
  }

  /* Hide title on mobile */
  .selected-sticker-item:first-child {
    display: none;
  }

  .selected-sticker-item {
    font-size: small;
    border-radius: 5px;
  }

  .selected-sticker-item > .sticker-image {
    max-width: 56px;
  }

  .selected-sticker-info {
    font-size: x-small;
  }

  /* Hide tooltips on mobile */
  .sticker-wrapper::after {
    display: none;
  }
  .sticker-image::after {
    display: none;
  }
}

@media only screen and (max-width: 450px) {
  .page-header .title {
    font-size: 2rem;
  }

  .search-container .input-group {
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-content: stretch;
  }
  .search-container .input-group input {
    border-radius: 100px;
  }

  .search-container .input-group button {
    height: 52px;
    margin-top: 10px;
    border-radius: 100px;
  }
}

#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  width: 50px;
  height: 50px;
  display: block;
  text-decoration: none;
  border-radius: 35px;
  display: none;
}

#back-to-top i {
  color: #fff;
  margin: 0;
  position: relative;
  left: 16px;
  top: 13px;
  font-size: 19px;
}

.navigation {
  display: flex;
  justify-content: flex-end;
  margin-top: 30px;
  align-items: center;
  flex-direction: row;
  align-content: center;
}

.navigation .blog-btn {
  background: linear-gradient(45deg, green, rgb(0, 204, 0));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.2);
  text-wrap: nowrap;
  height: 35px;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: 0.25s;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navigation .blog-btn a {
  text-decoration: none;
  color: #fff;
  padding: 15px 40px;
  font-size: 14px;
}

.selected-sticker-header:first-of-type{
  border-radius: 5px 5px 0 0;
}

.selected-sticker-header {
  width: 100%;
  background: hsla(0, 0%, 100%, 0.15);
  padding: 5px;
  margin-bottom: 10px;
}

.selected-sticker-info {
  color: rgb(96 165 250);
}

.selected-sticker-price {
  margin-top: 5px;
  color: rgb(74 222 128);
}

.selected-sticker-total {
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  background: hsla(0, 0%, 100%, 0.15);
  padding: 10px 0;
  border-radius: 0 0 5px 5px;
}


.selected-sticker-total div {
  margin: 0 10px;
}

.selected-sticker-total-price {
  color: rgb(74 222 128);
}

.site-description {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  color: #e0e0e0;
}

.site-description h2 {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: 'Kode Mono', monospace;
}

.site-description h3 {
  font-size: 1.4rem;
  color: #4CAF50;
  margin: 2rem 0 1rem;
  font-family: 'Kode Mono', monospace;
}

.site-description p {
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.site-description-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .site-description-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.feature-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-index-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

#result-index-control-left,
#result-index-control-right {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Kode Mono', monospace;
  transition: all 0.2s ease;
}

#result-index-control-left:hover,
#result-index-control-right:hover {
  background: rgba(255, 255, 255, 0.1);
}

#result-index-control-left:active,
#result-index-control-right:active {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(1px);
}

#result-index-label {
  color: #e0e0e0;
  font-family: 'Kode Mono', monospace;
  min-width: 4rem;
  text-align: center;
}