/* ==============================================================================
   UNRELIABLECODE DEDICATED IMAGE VIEWER - REFRACTIVE FLUID GLASS DESIGN
   ============================================================================== */

.uc-image-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(3, 7, 18, 0.94);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    touch-action: none;
}

.uc-image-viewer-modal.active {
    opacity: 1;
    visibility: visible;
}

/* --- Top Header Bar --- */
.uc-iv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.88) 0%, rgba(3, 7, 18, 0) 100%);
    z-index: 100002;
    pointer-events: auto;
    gap: 12px;
}

.uc-iv-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.uc-iv-counter {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.uc-iv-title {
    color: #f8fafc;
    font-size: 13.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50vw;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.uc-iv-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.uc-iv-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.uc-iv-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.uc-iv-btn:active {
    transform: translateY(0) scale(0.95);
}

.uc-iv-btn.close-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    margin-left: 6px;
}

.uc-iv-btn.close-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* --- Main Canvas Stage --- */
.uc-iv-stage {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.uc-iv-stage.dragging {
    cursor: grabbing;
}

.uc-iv-img-container {
    position: absolute;
    transform-origin: center center;
    transition: transform 0.05s linear;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uc-iv-img-container.smooth {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.uc-iv-image {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.uc-iv-image.loaded {
    opacity: 1;
    transform: scale(1);
}

/* --- Navigation Arrows --- */
.uc-iv-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 100001;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    outline: none;
}

.uc-iv-nav-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.uc-iv-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.uc-iv-nav-prev { left: 24px; }
.uc-iv-nav-next { right: 24px; }

/* --- Loading Spinner --- */
.uc-iv-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: uc-iv-spin 0.8s linear infinite;
    z-index: 100000;
    pointer-events: none;
    display: none;
}

@keyframes uc-iv-spin {
    to { transform: rotate(360deg); }
}

/* --- Bottom Status Bar & Pill --- */
.uc-iv-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: linear-gradient(0deg, rgba(3, 7, 18, 0.88) 0%, rgba(3, 7, 18, 0) 100%);
    z-index: 100002;
    pointer-events: auto;
    gap: 10px;
}

.uc-iv-pill {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    padding: 5px 14px;
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.uc-iv-pill strong {
    color: #38bdf8;
}

/* --- Responsive Adjustments --- */
@media (max-width: 640px) {
    .uc-iv-header {
        padding: 10px 14px;
    }
    .uc-iv-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    .uc-iv-nav-btn {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
    .uc-iv-nav-prev { left: 10px; }
    .uc-iv-nav-next { right: 10px; }
    .uc-iv-title {
        max-width: 35vw;
        font-size: 12px;
    }
    .uc-iv-btn.btn-rotate,
    .uc-iv-btn.btn-fullscreen {
        display: none;
    }
}
