/* 现代化图片上传区域样式 */

/* 覆盖原有样式 */
.upload-area-header {
    display: none !important;
}

.upload-btn {
    display: none !important;
}

.upload-label {
    display: none !important;
}

/* 上传区域容器 */
.image-upload-area {
    width: 100%;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    position: relative;
}

/* 隐藏原始文件输入 */
.image-upload-input {
    display: none;
}

/* 上传区域主体 */
.image-upload-zone {
    width: 100%;
    min-height: 240px;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    
    /* 渐变背景效果 */
    background: linear-gradient(135deg, 
        rgba(248, 250, 252, 1) 0%,
        rgba(241, 245, 249, 1) 100%);
}

/* 悬停效果 */
.image-upload-zone:hover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.05) 0%,
        rgba(167, 139, 250, 0.05) 100%);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

/* 拖拽高亮状态 */
.image-upload-zone.highlight,
.image-upload-zone.drag-over {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.1) 0%,
        rgba(167, 139, 250, 0.1) 100%);
    box-shadow: 
        0 0 0 4px rgba(139, 92, 246, 0.1),
        0 15px 35px rgba(139, 92, 246, 0.15);
    transform: translateY(-4px) scale(1.02);
}

/* 上传占位符容器 */
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 2rem;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* 上传图标 */
.upload-icon {
    margin-bottom: 1.5rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.upload-icon i {
    font-size: 3.5rem;
    color: #8b5cf6;
    display: block;
    text-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.image-upload-zone:hover .upload-icon {
    opacity: 1;
    transform: translateY(-4px) scale(1.1);
}

.image-upload-zone:hover .upload-icon i {
    color: #7c3aed;
}

/* 文字样式 */
.upload-placeholder-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.upload-placeholder-text p {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.format-info {
    display: block;
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.paste-info {
    display: block;
    font-size: 0.75rem;
    color: #d1d5db;
    font-style: italic;
    line-height: 1.3;
    max-width: 280px;
}

/* 预览图片样式 */
.reference-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.reference-preview.active {
    display: flex;
}

.reference-preview img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

/* 移除图片按钮 */
.remove-image {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    z-index: 20;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.remove-image:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* 活跃状态（有图片时） */
.image-upload-zone.has-image {
    border-color: #10b981;
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.05) 0%,
        rgba(5, 150, 105, 0.05) 100%);
}

.image-upload-zone.has-image .upload-placeholder {
    display: none;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .image-upload-zone {
        min-height: 200px;
        border-radius: 12px;
    }
    
    .upload-placeholder {
        padding: 1.5rem 1rem;
    }
    
    .upload-icon i {
        font-size: 2.5rem;
    }
    
    .upload-placeholder-text h3 {
        font-size: 1.1rem;
    }
    
    .upload-placeholder-text p {
        font-size: 0.9rem;
    }
    
    .format-info {
        font-size: 0.8rem;
    }
    
    .paste-info {
        font-size: 0.7rem;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05); 
    }
}

.image-upload-zone.uploading {
    animation: pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

.image-upload-zone.uploading .upload-placeholder-text h3::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* 成功状态动画 */
.image-upload-zone.success {
    border-color: #10b981;
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.1) 0%,
        rgba(5, 150, 105, 0.1) 100%);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .image-upload-zone {
        border-color: #000000;
        background: #ffffff;
    }
    
    .upload-placeholder-text h3,
    .upload-placeholder-text p {
        color: #000000;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .image-upload-zone {
        border-color: #4b5563;
        background: linear-gradient(135deg, 
            rgba(31, 41, 55, 1) 0%,
            rgba(55, 65, 81, 1) 100%);
    }
    
    .image-upload-zone:hover {
        border-color: #a78bfa;
        background: linear-gradient(135deg, 
            rgba(167, 139, 250, 0.1) 0%,
            rgba(139, 92, 246, 0.1) 100%);
    }
    
    .upload-placeholder-text h3 {
        color: #f9fafb;
    }
    
    .upload-placeholder-text p {
        color: #d1d5db;
    }
    
    .format-info {
        color: #9ca3af;
    }
    
    .paste-info {
        color: #6b7280;
    }
}
