/* Shared with admin catalog image preview (Create Subject / Diploma) */
.diploma-preview-card__surface {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(160deg, #f8fafc 0%, #eef2f6 50%, #e8ecf1 100%);
    border: 1px dashed rgba(15, 23, 42, 0.18);
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.diploma-preview-card__surface.has-image {
    cursor: zoom-in;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 10px 28px -8px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.diploma-preview-card__surface.has-image:hover {
    box-shadow:
        0 8px 12px -2px rgba(15, 23, 42, 0.08),
        0 18px 40px -12px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.diploma-preview-card__surface:focus {
    outline: 2px solid var(--bs-primary, #0d6efd);
    outline-offset: 3px;
}

.diploma-preview-card__surface:focus:not(:focus-visible) {
    outline: none;
}

.diploma-preview-card__hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.52);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

.diploma-preview-card__surface.has-image:hover .diploma-preview-card__hover,
.diploma-preview-card__surface.has-image:focus .diploma-preview-card__hover {
    opacity: 1;
}

.diploma-preview-card--hero .diploma-preview-card__surface {
    min-height: 168px;
}

.diploma-preview-card--hero .diploma-preview-img {
    display: none;
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    object-position: center;
    vertical-align: middle;
    background: #fff;
}

.diploma-preview-card--hero .diploma-preview-img[src]:not([src=""]) {
    display: block;
}

.diploma-image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.diploma-image-lightbox.is-open {
    display: flex;
}

.diploma-image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 12, 20, 0.82);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.diploma-image-lightbox-panel {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: min(92vw, 960px);
    max-height: 88vh;
    animation: diploma-lightbox-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes diploma-lightbox-in {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.diploma-image-lightbox-img {
    display: block;
    max-width: min(92vw, 960px);
    max-height: 82vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.12);
}

.diploma-image-lightbox-close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    transform: translate(20%, -20%);
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
    z-index: 2;
}

.diploma-image-lightbox-close:hover {
    background: #fff;
    color: #0f172a;
    transform: translate(20%, -20%) scale(1.05);
}

@media (max-width: 576px) {
    .diploma-image-lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        transform: none;
    }

    .diploma-image-lightbox-close:hover {
        transform: scale(1.05);
    }
}
