/* =============================================================================
   static/css/upload.css 上传页面样式 - 统一完整版本
   合并了 upload.html 内联样式 + upload.css + upload-enhanced.css
   ============================================================================= */

/* ===== 来自 upload.html 的内联样式 ===== */

/* 隐私保护通知样式 */
.privacy-notice {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.zero-storage-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.3);
}

/* 隐私保护特性说明 */
.privacy-features {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.privacy-feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.privacy-feature-item:last-child {
    margin-bottom: 0;
}

.security-reminder {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    color: #0c5460;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

/* 增强的处理模态框样式 */
.processing-modal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.processing-animation {
    position: relative;
    margin-bottom: 2rem;
}

.processing-animation .spinner-border {
    width: 4rem;
    height: 4rem;
    border-width: 4px;
}

.progress-container {
    background: rgba(0,0,0,0.05);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.progress {
    height: 25px;
    border-radius: 12px;
    background-color: rgba(0,0,0,0.1);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.progress-bar {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.time-display {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #666;
    background: rgba(0,0,0,0.05);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin: 10px 0;
}

.tip-text {
    min-height: 24px;
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1.4;
}

.upload-subtitle {
    color: #12d316;
}

.cancel-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    transform: scale(1.1);
}

.processing-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px 15px 0 0;
    text-align: center;
    position: relative;
}

.fun-facts {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid #007bff;
}

.fun-facts h6 {
    color: #007bff;
    margin-bottom: 10px;
}

/* 零存储提醒样式 */
.zero-storage-reminder {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

/* ===== 来自 upload.css 的样式 ===== */

/* 上传区域样式 */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    background-color: var(--light-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.upload-area:hover::before {
    left: 100%;
}

/* 上传内容样式 */
.upload-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    margin-bottom: 1.5rem;
}

.upload-icon i {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.7;
    transition: var(--transition);
}

.upload-area:hover .upload-icon i {
    opacity: 1;
    transform: scale(1.1);
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

/* 隐藏的文件输入 */
.file-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* 文件预览样式 */
.file-preview {
    margin-top: 2rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-file {
    border: 2px solid var(--success-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    background-color: rgba(5, 150, 105, 0.05);
}

.file-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--info-color), #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.file-icon i {
    font-size: 1.5rem;
}

.file-info h6 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size {
    font-size: 0.875rem;
}

.file-actions .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 上传进度样式 */
.upload-progress {
    animation: fadeIn 0.3s ease-out;
}

.progress-text {
    font-size: 0.875rem;
}

/* 案件信息卡片 */
.case-info-card .case-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.case-info-card .case-icon i {
    font-size: 1.5rem;
}

/* 帮助区域样式 */
.help-section {
    background-color: var(--light-color);
    border-radius: 1rem;
    padding: 2rem;
}

.help-item .help-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.help-item .help-icon i {
    font-size: 1.5rem;
}

.help-item h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

/* 处理动画 */
.processing-animation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* 文件类型图标样式 */
.file-type-doc .file-icon {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
}

.file-type-pdf .file-icon {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.file-type-txt .file-icon {
    background: linear-gradient(135deg, #059669, #10b981);
}

.file-type-rtf .file-icon {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

/* 拖拽状态动画 */
.upload-area.dragover .upload-icon i {
    animation: bounce 0.6s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 上传成功动画 */
.upload-success {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 错误状态样式 */
.upload-error {
    border-color: var(--danger-color) !important;
    background-color: rgba(220, 38, 38, 0.05) !important;
}

.upload-error .upload-icon i {
    color: var(--danger-color) !important;
}

/* 按钮悬停效果 */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* 加载状态样式 */
.loading .upload-area {
    pointer-events: none;
    opacity: 0.7;
}

.loading .upload-icon i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 文件大小限制提示 */
.size-warning {
    color: var(--warning-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.size-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 上传队列 */
.upload-queue {
    margin-top: 2rem;
}

.upload-queue-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: white;
    transition: var(--transition);
}

.upload-queue-item:hover {
    box-shadow: var(--shadow-sm);
}

.upload-queue-item.completed {
    border-color: var(--success-color);
    background-color: rgba(5, 150, 105, 0.05);
}

.upload-queue-item.error {
    border-color: var(--danger-color);
    background-color: rgba(220, 38, 38, 0.05);
}

/* ===== 来自 upload-enhanced.css 的样式 ===== */

/* 处理模态框动画增强 */
.processing-modal .modal-content {
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 时间显示动画 */
.time-display {
    transition: all 0.3s ease;
    position: relative;
}

.time-display::before {
    content: '⏱️';
    margin-right: 5px;
}

.time-display.pulsing {
    animation: timePulse 2s infinite;
}

@keyframes timePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 提示文字切换动画 */
.tip-text {
    animation: tipFadeIn 0.5s ease-in-out;
}

@keyframes tipFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 取消按钮悬停效果增强 */
.cancel-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cancel-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.cancel-btn:hover::before {
    width: 100px;
    height: 100px;
}

.cancel-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

/* 处理动画增强 */
.processing-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 趣味小贴士动画 */
.fun-facts {
    animation: slideInUp 0.6s ease-out 0.5s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功状态动画 */
.conversion-complete {
    animation: successBounce 0.8s ease-out;
}

@keyframes successBounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* 错误状态动画 */
.conversion-error {
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 上传区域增强动画 */
.upload-area.uploading {
    animation: uploadPulse 1.5s ease-in-out infinite;
}

@keyframes uploadPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(37, 99, 235, 0.4);
    }
}

/* 文件预览增强 */
.file-preview.file-selected {
    animation: fileSlideIn 0.4s ease-out;
}

@keyframes fileSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 按钮状态增强 */
.btn.processing {
    position: relative;
    color: transparent !important;
}

.btn.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: buttonSpin 1s linear infinite;
}

@keyframes buttonSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 通用动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 响应式设计 ===== */

@media (max-width: 768px) {
    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon i {
        font-size: 3rem;
    }

    .upload-title {
        font-size: 1.25rem;
    }

    .upload-subtitle {
        font-size: 0.875rem;
    }

    .selected-file {
        padding: 1rem;
    }

    .help-section {
        padding: 1.5rem;
    }

    .processing-modal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .processing-header {
        padding: 20px 15px;
    }

    .progress-container {
        padding: 15px;
    }

    .time-display {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .cancel-btn {
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 576px) {
    .upload-area {
        padding: 1.5rem 1rem;
    }

    .upload-icon i {
        font-size: 2.5rem;
    }

    .upload-title {
        font-size: 1.125rem;
    }

    .file-info h6 {
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 0.625rem 1.5rem;
        font-size: 1rem;
    }
}

/* ===== 深色模式适配 ===== */

@media (prefers-color-scheme: dark) {
    .upload-area {
        background-color: #1e293b;
        border-color: #334155;
    }

    .upload-area:hover {
        background-color: rgba(37, 99, 235, 0.1);
    }

    .selected-file {
        background-color: rgba(5, 150, 105, 0.1);
        border-color: var(--success-color);
    }

    .help-section {
        background-color: #1e293b;
    }

    .case-info-card .card {
        background-color: #1e293b;
        border-color: #334155;
    }

    .processing-header {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .progress-container {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .fun-facts {
        background: rgba(255, 255, 255, 0.05);
        border-left-color: #007bff;
    }

    .time-display {
        background: rgba(255, 255, 255, 0.1);
        color: #e9ecef;
    }
}

/* ===== 可访问性增强 ===== */

.cancel-btn:focus,
.btn:focus {
    outline: 2px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .progress-bar {
        background: #000;
    }

    .time-display {
        border: 2px solid currentColor;
    }

    .cancel-btn {
        border: 2px solid currentColor;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .processing-animation::after,
    .progress-bar::before {
        animation: none;
    }
}

/* 图片预览卡片样式 */
.image-preview-card {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.image-preview-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.image-preview-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-info {
    padding: 8px;
    background: #f8f9fa;
}

.btn-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-remove-image:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

.file-type-selector {
    margin-bottom: 1.5rem;
}

.file-type-selector .btn-check:checked + label {
    background-color: #007bff;
    color: white;
}

.image-list {
    max-height: 400px;
    overflow-y: auto;
}

/* 文件类型选择器样式增强 */
.file-type-selector {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.file-type-label {
    padding: 15px 20px;
    transition: all 0.3s ease;
    position: relative;
}

.file-type-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.btn-check:checked + .file-type-label {
    background-color: #007bff;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-check:checked + .file-type-label small {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 格式提示框 */
.format-hint-box {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.format-hint {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.format-hint.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .file-type-label {
        padding: 12px 15px;
        font-size: 14px;
    }

    .file-type-selector {
        padding: 15px;
    }
}