/* Image Viewer Dialog Styles */
.image-viewer-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    user-select: none;
}

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

.image-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-image {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    transition: opacity 0.2s ease, transform 0.3s ease;
    border-radius: 4px;
    cursor: grab;
    will-change: transform;
}

.image-viewer-image.dragging {
    transition: none;
    cursor: grabbing;
}

.image-viewer-image.swipe-left {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(-100%);
    opacity: 0;
}

.image-viewer-image.swipe-right {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
}

.image-viewer-image.loading {
    opacity: 0.3;
}

/* Close button */
.image-viewer-close {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 20;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.image-viewer-close svg {
    width: 22px;
    height: 22px;
}

/* Navigation buttons (prev/next) */
.image-viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 20;
}

.image-viewer-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-viewer-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.image-viewer-nav svg {
    width: 24px;
    height: 24px;
}

.image-viewer-prev {
    left: 15px;
}

.image-viewer-next {
    right: 15px;
}

.image-viewer-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Image info bar (filename + counter) */
.image-viewer-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
    padding: 20px 30px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 15;
}

.image-viewer-filename {
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 60%;
    opacity: 0.9;
}

.image-viewer-counter {
    color: #fff;
    font-size: 13px;
    opacity: 0.7;
    white-space: nowrap;
}

/* Loading spinner */
.image-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.image-viewer-loading.active {
    display: flex;
}

.image-viewer-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: image-viewer-spin 1s linear infinite;
}

@keyframes image-viewer-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Zoom controls */
.image-viewer-zoom {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 4px 8px;
    z-index: 20;
}

.image-viewer-zoom-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 16px;
}

.image-viewer-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-viewer-zoom-level {
    color: #fff;
    font-size: 12px;
    min-width: 40px;
    text-align: center;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .image-viewer-nav {
        width: 40px;
        height: 40px;
    }

    .image-viewer-nav svg {
        width: 20px;
        height: 20px;
    }

    .image-viewer-prev {
        left: 8px;
    }

    .image-viewer-next {
        right: 8px;
    }

    .image-viewer-info {
        padding: 15px 15px 10px;
    }

    .image-viewer-filename {
        font-size: 13px;
    }

    .image-viewer-counter {
        font-size: 12px;
    }

    .image-viewer-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .image-viewer-image {
        max-width: 95%;
        max-height: 80%;
    }

    .image-viewer-zoom {
        top: 10px;
    }
}
