.cr-dock {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.cr-dock-container {
    position: relative;
    display: inline-flex;
}

.cr-dock-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.cr-dock-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.cr-dock-item {
    position: relative;
}

.cr-dock-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.cr-dock-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: transform 0.18s ease-out, background-color 0.18s ease-out;
}

.cr-dock-icon-wrapper img {
    max-width: 70%;
    max-height: 70%;
    display: block;
}

.cr-dock-icon-wrapper i,
.cr-dock-icon-wrapper svg {
    font-size: 20px; /* Default size relative to wrapper, scalable via font-size */
    width: auto;
    height: auto;
    max-width: 70%;
    max-height: 70%;
    color: #ffffff; /* Default color */
    fill: #ffffff; /* Default fill for SVGs */
    transition: color 0.18s ease-out, fill 0.18s ease-out;
}

/* Smart Contrast Mode */
.cr-dock-smart-contrast .cr-dock-content {
    mix-blend-mode: difference;
}

/* When Smart Contrast is active, icons MUST be white to properly invert against the background */
.cr-dock-smart-contrast .cr-dock-icon-wrapper i,
.cr-dock-smart-contrast .cr-dock-icon-wrapper svg,
.cr-dock-smart-contrast .cr-dock-icon-wrapper img {
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* Ensure images are treated as white for difference blending if they are monochrome pngs/svgs */
.cr-dock-smart-contrast .cr-dock-icon-wrapper img {
    filter: brightness(0) invert(1);
}

.cr-dock-item:hover .cr-dock-icon-wrapper {
    transform: scale(1.4);
    background: rgba(255, 255, 255, 0.15);
}

.cr-dock-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.cr-dock-item:hover .cr-dock-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
