.preview-item {
  position: relative;
  text-align: center;
  width: 75px;
  height: 75px;
  margin: 2px;
  padding: 2px;
  border: 1px solid #E0E0E0;
  background-color: var(--background-color);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: inline-block;
  box-sizing: border-box;
  overflow: visible;
  z-index: 1;
}

.preview-item:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.preview-item:hover .tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(5px);
}


/* Image for the preview */
.preview-image {
    width: 100%; /* Scale dynamically within the box */
    height: 100%; /* Maintain aspect ratio */
    margin-bottom: 2px; /* Space between image and text */
    object-fit: contain; /* Prevents image distortion */

}

/* Truncated name under the image */
.icon-name {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px; /* Balanced text size */
    color: #966c24; /* Dark color for contrast */
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap; /* Prevent text wrapping */
    width: 100%; /* Align text width with container */
    line-height: 12px; /* Vertical alignment for text */
    height: 18px; /* Fixed height for consistent alignment */
}

/* Tooltip for full name */
.tooltip {
    position: absolute;
    bottom: 0%; /* Position below the box */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8); /* Dark background for contrast */
    color: #FFFFFF; /* White text for readability */
    font-size: 8px;
    padding: 6px 10px; /* Compact padding for better appearance */
    border-radius: 4px; /* Rounded corners for consistency */
    visibility: hidden;
    opacity: 0;
    z-index: 1000; /* Ensures tooltip appears above all elements */
    white-space:nowrap; /* Prevent text wrapping */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Tooltip shadow */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Smooth transition */
}

