/**
 * 云信IM - 图片查看器样式
 * 全屏查看，支持缩放和切换
 */

/* 容器 */
.yunxin-image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s;
}

.yunxin-image-viewer.active {
    opacity: 1;
}

/* 背景遮罩 */
.yunxin-image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

/* 顶部工具栏 */
.yunxin-image-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
    z-index: 3;
}

.yunxin-image-viewer-counter {
    color: #FFFFFF;
    font-size: 16px;
}

.yunxin-image-viewer-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* 内容区域 */
.yunxin-image-viewer-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.yunxin-image-viewer-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.yunxin-image-viewer-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: default;
    transition: transform 0.3s ease;
    user-select: none;
}

/* 左右切换按钮 */
.yunxin-image-viewer-prev,
.yunxin-image-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    font-size: 36px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yunxin-image-viewer-prev {
    left: 20px;
}

.yunxin-image-viewer-next {
    right: 20px;
}

.yunxin-image-viewer-prev:hover,
.yunxin-image-viewer-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

/* 底部工具栏 */
.yunxin-image-viewer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    z-index: 3;
}

.yunxin-image-viewer-tool {
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yunxin-image-viewer-tool:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .yunxin-image-viewer-header {
        height: 50px;
        padding: 0 15px;
    }

    .yunxin-image-viewer-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .yunxin-image-viewer-prev,
    .yunxin-image-viewer-next {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }

    .yunxin-image-viewer-prev {
        left: 10px;
    }

    .yunxin-image-viewer-next {
        right: 10px;
    }

    .yunxin-image-viewer-footer {
        height: 70px;
        gap: 15px;
    }

    .yunxin-image-viewer-tool {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

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

/* 加载状态 */
.yunxin-image-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: yunxin-viewer-spin 0.8s linear infinite;
}

@keyframes yunxin-viewer-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

