.cardItem {
  display: flex;
  align-items: center;
  border: 2px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: fit-content;
  max-width: 100%;
  margin-bottom: 5px;
  margin-right: 5px;
  padding: 10px;
  justify-content: center;
  cursor: grab;
}

.cardItem,
.cardItem * {
  user-select: none;
}

.cardItem h3 {
  flex-grow: 1;
}

.cardItem.wiggling {
  animation: wiggle 0.5s infinite;
  background-color: rgba(255, 255, 0, 0.1); /* Add yellow tint */
}

.cardItem.selected {
  background-color: rgba(0, 255, 0, 0.1); /* Add green tint */
}

.cardItem.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cardItem.disabled:hover {
  transform: none !important;
}

@keyframes wiggle {
  0% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg);
  }
  100% {
    transform: rotate(-3deg);
  }
}

a {
  text-decoration: none;
  color: #ff9900;
}

a:hover {
  color: #ff6600;
}

nav {
  background-color: #333;
  color: white;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  margin-top: 20px;
}

.rank-container {
  display: block;
  margin-top: 20px;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 30px;
}

.column {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.logo {
  max-height: 40px;
}

.navbar {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  margin-left: auto;
}

.nav-links li {
  margin-left: 10px;
}

.nav-links a {
  text-decoration: none;
  color: white;
}

.nav-links a:hover {
  color: #ff9900;
}

input[type="text"] {
  padding: 5px;
  margin: 5px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

input[type="text"]:focus {
  outline: none;
  border: 1px solid #ff9900;
}

input[type="text"]::placeholder {
  color: #ccc;
}

input[type="text"]::-webkit-input-placeholder {
  color: #ccc;
}

input[type="text"]::-moz-placeholder {
  color: #ccc;
}

input[type="text"]::-ms-input-placeholder {
  color: #ccc;
}

input[type="text"]::-moz-placeholder {
  color: #ccc;
}

input[type="text"]::-ms-input-placeholder {
  color: #ccc;
}

input[type="text"]::-o-input-placeholder {
  color: #ccc;
}

.cardItem:active {
  cursor: grabbing;
}

.cardItem:hover {
  animation: wiggle 0.5s infinite;
}

.mix-results-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 300px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  pointer-events: none;
  /* Ensure flexbox layout for stacking */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Mobile-specific styling for mix results */
@media (max-width: 768px) {
  .mix-results-container {
    top: 20px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    max-width: 90vw;
    max-height: none;
    align-items: center;
    text-align: center;
    overflow: visible;
  }

  .loading_item {
    font-size: 14px;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #28a745;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 85vw;
    width: auto;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .loading_item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
  }

  .loading_item.wiggling {
    animation: mobileZenWiggle 0.4s ease-in-out 2;
  }

  .mobile-zen-notification {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    animation: mobileZenSlideDown 0.3s ease-out;
    color: white;
    font-weight: 500;
  }

  .mobile-zen-notification::after {
    content: "Tap to dismiss";
    display: block;
    font-size: 10px;
    opacity: 0.9;
    margin-top: 5px;
    font-style: italic;
  }

  /* Counter notification for multiple results */
  .zen-counter-notification {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    cursor: pointer;
    position: relative;
    padding-right: 50px;
  }

  .zen-counter-badge {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
  }

  .zen-counter-notification::after {
    content: "Tap to view all";
  }
}

.loading_item {
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 1rem;
  width: 100%;
  /* Ensure block-level display */
  display: block;
}

.loading_item.wiggling {
  animation: wiggle 0.5s infinite;
}

/* Additional mobile animations */
@keyframes mobileZenWiggle {
  0%,
  100% {
    transform: translateY(-2px) rotate(0deg);
  }
  50% {
    transform: translateY(-2px) rotate(1deg);
  }
}

@keyframes mobileZenSlideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Favorites Sidebar Styles */
#favoritesSidebar {
  width: 250px;
  background-color: #343a40; /* Bootstrap dark background */
  color: #fff; /* White text */
  position: fixed;
  top: 56px; /* Adjust if your navbar height is different */
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  z-index: 1030; /* Above main content */
}

#favoritesSidebar.collapsed {
  transform: translateX(-250px);
}

#favoritesSidebar h5 {
  color: #fff; /* Ensure header text is white */
}

#favoriteCards .cardItem {
  background-color: #495057; /* Darker background for cards */
  border: none;
  color: #fff;
  margin: 5px;
  padding: 10px;
  border-radius: 5px;
}

#favoriteCards .cardItem .emoji-element,
#favoriteCards .cardItem .name-element {
  color: #fff;
}

/* Adjust remove button */
.remove-favorite-btn {
  top: 5px;
  right: 5px;
  background: transparent;
  border: none;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
}

.remove-favorite-btn:hover {
  color: #dc3545; /* Bootstrap danger color */
}

/* Adjust toggle button */
#favoritesToggle {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 1032; /* Above the sidebar */
  background-color: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 24px; /* Increase the size of the icon */
  cursor: pointer;
  padding: 10px;
}

#favoritesToggle.collapsed {
  left: 0;
}

#favoritesToggleIcon {
  display: inline-block;
  transition: transform 0.3s ease-in-out;
}

#favoritesToggleIcon.rotate {
  transform: rotate(180deg);
}

#favoriteCards .cardItem {
  background-color: #495057; /* Darker background for cards */
  border: none;
  color: #fff;
  margin: 5px;
  padding: 10px;
  border-radius: 5px;
}

#favoriteCards .cardItem:hover {
  background-color: #6c757d; /* Slightly lighter on hover */
}

#favoriteCards .cardItem .emoji-element,
#favoriteCards .cardItem .name-element {
  color: #fff;
}

#favoritesHoverZone {
  position: fixed;
  top: 0;
  left: 0;
  width: 50px; /* Adjust width as needed */
  height: 100%;
  z-index: 1029; /* Just below the toggle button */
  background-color: transparent;
}

#favoritesHoverZone.dragging {
  /* Optional: Visual indicator when dragging */
  background-color: rgba(255, 255, 255, 0.1);
}

/* Styles for selected cards */
.favorite-card.cardItem.selected {
  border: 2px solid #007bff !important; /* Bootstrap primary color */
  /* Add any other styles to indicate selection */
  background-color: rgba(
    0,
    123,
    255,
    0.1
  ) !important; /* Light blue background */
}

#clearFavoritesButton {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
}

#clearFavoritesButton:hover {
  color: #dc3545; /* Bootstrap danger color */
}

#mainContent {
  margin-left: 250px;
  transition: margin-left 0.3s ease-in-out;
}

#mainContent.collapsed {
  margin-left: 0;
}
