/* hoverPreview.css
 *
 * Styles for HoverPreview.razor
 * Import in your app's main CSS, or add a @import in your app.css / site.css
 *
 * If you're using a Razor Class Library, include this in the <head> via:
 *   <link rel="stylesheet" href="_content/<YourLibrary>/hoverPreview.css" />
 */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.hover-preview-wrapper {
    position: relative;
    display: inline-block;
    /* Overflow visible so the absolutely-positioned popup escapes the wrapper */
    overflow: visible;
}

/* ── Overlay (blocks thumbnail interaction) ───────────────────────────────── */
.hover-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1; /* above thumbnail content */
    cursor: pointer;
    background: transparent;
    /* Capture all pointer events, preventing clicks/touches on thumbnail */
    pointer-events: auto;
}

/* ── Popup ────────────────────────────────────────────────────────────────── */
.hover-preview-popup {
    position: absolute;
    z-index: 9999;
    overflow: hidden; /* clip content to rounded corners */
    /* MudBlazor surface colours — automatically adapts to light / dark theme */
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--mud-palette-divider);
    border-radius: var(--mud-default-borderradius, 4px);
    /* Smooth entrance */
    animation: hoverPreviewFadeIn 0.15s ease-out forwards;
    /* Prevent the popup from eating pointer events on the thumbnail row */
    pointer-events: auto;
}

/* Inner scrollable area */
.hover-preview-popup-inner {
    overflow: hidden;
    /* Thin scrollbar on supported browsers */
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-divider) transparent;
}

    .hover-preview-popup-inner::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .hover-preview-popup-inner::-webkit-scrollbar-track {
        background: transparent;
    }

    .hover-preview-popup-inner::-webkit-scrollbar-thumb {
        background-color: var(--mud-palette-divider);
        border-radius: 3px;
    }

/* ── Animation ────────────────────────────────────────────────────────────── */
@keyframes hoverPreviewFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Touch – disable tap highlight on the wrapper ────────────────────────── */
.hover-preview-wrapper {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
