/* 商品图片上传组件样式 */
.image-upload-wrapper {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.image-upload-wrapper:hover {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.upload-area {
    text-align: center;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area.drag-over {
    border-color: #0d6efd;
    background-color: #e7f1ff;
    transform: scale(1.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #6c757d;
}

.upload-placeholder p {
    margin-bottom: 0.5rem;
}

.upload-placeholder .btn {
    margin-top: 1rem;
}

/* 图片预览样式 */
.image-preview-container {
    margin-top: 20px;
}

.image-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: move;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-item:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

.image-actions {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

.image-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.image-actions .btn:hover {
    transform: scale(1.1);
}

.image-info {
    text-align: left;
}

.image-info small {
    display: block;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.main-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(45deg, #ffc107, #ff8c00);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.main-badge i {
    margin-right: 4px;
}

/* 上传进度样式 */
.upload-progress {
    margin-top: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.upload-progress .progress {
    height: 8px;
    margin-bottom: 8px;
}

.upload-progress .progress-bar {
    background: linear-gradient(90deg, #0d6efd, #6610f2);
    animation: progress-animation 2s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 拖拽排序样式 */
.image-item[draggable="true"] {
    cursor: move;
}

.image-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.image-item.drag-over {
    border: 2px dashed #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .upload-area {
        padding: 20px 10px;
    }
    
    .upload-placeholder i {
        font-size: 2rem;
    }
    
    .image-item img {
        height: 150px;
    }
    
    .image-actions .btn {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 576px) {
    .image-upload-wrapper {
        padding: 15px;
    }
    
    .upload-area {
        padding: 15px 5px;
    }
    
    .image-item img {
        height: 120px;
    }
    
    .image-actions {
        gap: 3px;
    }
    
    .image-actions .btn {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
}

/* 动画效果 */
.image-item {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 错误和成功消息样式 */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

/* 加载状态 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 商品图片画廊样式 */
.image-gallery {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.image-gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.main-image-container {
    position: relative;
    margin-bottom: 1rem;
}

.main-image-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.main-image:hover {
    transform: scale(1.02);
}

.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.main-image-wrapper:hover .fullscreen-btn {
    opacity: 1;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.main-image-wrapper:hover .nav-btn {
    opacity: 1;
}

.nav-prev {
    left: 10px;
}

.nav-next {
    right: 10px;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.image-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

.thumbnails-container {
    margin-top: 1rem;
}

.thumbnails-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
}

.thumbnails-wrapper::-webkit-scrollbar {
    height: 4px;
}

.thumbnails-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.thumbnails-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    border-color: #0d6efd;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 全屏模态框样式 */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.fullscreen-content {
    position: relative;
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.fullscreen-image-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.fullscreen-prev {
    left: 20px;
}

.fullscreen-next {
    right: 20px;
}

.fullscreen-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.fullscreen-thumbnails {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    overflow-x: auto;
    padding: 10px;
    max-width: 100%;
}

.fullscreen-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.fullscreen-thumbnail:hover {
    border-color: white;
    transform: scale(1.05);
}

.fullscreen-thumbnail.active {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.fullscreen-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-image-wrapper {
        height: 300px;
    }

    .nav-btn,
    .fullscreen-btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    .thumbnail {
        width: 50px;
        height: 50px;
    }

    .fullscreen-nav {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .fullscreen-close {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        top: 10px;
        right: 10px;
    }

    .fullscreen-thumbnail {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .main-image-wrapper {
        height: 250px;
    }

    .thumbnails-wrapper {
        gap: 6px;
    }

    .thumbnail {
        width: 45px;
        height: 45px;
    }

    .fullscreen-nav {
        left: 10px;
        right: 10px;
    }

    .fullscreen-thumbnails {
        gap: 6px;
        padding: 5px;
    }

    .fullscreen-thumbnail {
        width: 50px;
        height: 50px;
    }
}
