/* SZ61 U-Features Viewer styles */
.ufeat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.ufeat-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ufeat-back {
    margin-left: 16px;
    padding: 7px 18px;
    background: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    color: #0A84FF !important;
    -webkit-text-fill-color: #0A84FF !important;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.1;
    border: 1px solid #0A84FF !important;
    box-shadow: inset 0 0 0 1px #0A84FF;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ufeat-back:visited {
    color: #0A84FF !important;
    -webkit-text-fill-color: #0A84FF !important;
}

.ufeat-back:hover {
    background: #e6f0ff !important;
    color: #0a6cd4 !important;
    -webkit-text-fill-color: #0a6cd4 !important;
    border-color: #0a6cd4 !important;
    box-shadow: inset 0 0 0 1px #0a6cd4;
}

/* Extra specificity to beat any inherited white links */
.ufeat-title .ufeat-back,
.ufeat-title .ufeat-back:visited,
.ufeat-title .ufeat-back:hover {
    color: #0A84FF !important;
    -webkit-text-fill-color: #0A84FF !important;
    text-decoration: none !important;
    visibility: visible !important;
}

/* Anti-Flicker: Nur Grid empfängt Pointer-Events */
.ufeat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    pointer-events: auto;
}

/* Do NOT block all events on the card body; only disable when modal is open */
/* Previously used :has() caused unintended global click blocking */
/* body.ufeat-modal-open toggled by JS when modal is active */
body.ufeat-modal-open .scp-card-body {
    pointer-events: none;
}

/* Ensure the actual interactive grid remains clickable by default */
.ufeat-grid {
    pointer-events: auto;
}

.ufeat-imgbox {
    display: block;
    width: 100%;
    border: 2px solid #e8eaf6;
    padding: 0;
    cursor: zoom-in;
    border-radius: 12px;
    overflow: hidden;
    background: none;
    transition: border-color 0.2s ease;
}

.ufeat-imgbox:hover {
    border-color: #5c6bc0;
}

.ufeat-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

/* Disable grid pointer events when modal open */
body.ufeat-modal-open .ufeat-grid {
    pointer-events: none;
}

.ufeat-zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #fff;
    border-radius: 50%;
    border: 1px solid #ccc;
    padding: 6px;
    cursor: pointer;
}

.ufeat-empty {
    margin-top: 16px;
    color: #b91c1c;
}

.ufeat-modal {
    display: none;
    /* default hidden until JS sets flex */
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.82);
    align-items: center;
    justify-content: center;
    padding: 32px 48px;
    box-sizing: border-box;
}

.ufeat-modal-btn {
    position: absolute;
    font-size: 2em;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

.ufeat-close {
    top: 16px;
    right: 16px;
    font-size: 3em;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.ufeat-prev {
    left: 32px;
    top: 50%;
    margin-top: -50%;
}

.ufeat-next {
    right: 32px;
    top: 50%;
    margin-top: -50%;
}

.ufeat-modal-img {
    max-width: 70vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    border-radius: 14px;
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.6);
    background: #111;
}

/* Navigation & close buttons: ensure always visible above image */
.ufeat-modal-btn {
    z-index: 9999;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.ufeat-close {
    top: 18px;
    right: 24px;
    font-size: 2.4em;
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.ufeat-prev,
.ufeat-next {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 1.6em;
}

.ufeat-prev:hover,
.ufeat-next:hover,
.ufeat-close:hover {
    background: rgba(0, 0, 0, 0.65);
}