/* ====== 上传模块样式 ====== */
/* 文件: /var/www/naoneng/app/static/css/uploads.css */
/* 来源: uploads.js 提取 + 模态框基础样式 */

/* 模态框基本样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #eee;
    color: #333;
}

.modal-body {
    padding: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    position: relative;
}

.file-upload-area:hover {
    border-color: #4CAF50;
    background: #f5f9f5;
}

.file-upload-area.dragover {
    border-color: #4CAF50;
    background: #f0f7f0;
    border-style: solid;
}

.upload-placeholder {
    color: #666;
    pointer-events: none;
}

.upload-placeholder div:first-child {
    font-size: 24px;
    margin-bottom: 8px;
}

.upload-placeholder div:nth-child(2) {
    font-size: 16px;
    font-weight: 500;
    margin-top: 8px;
}

.upload-placeholder div:nth-child(3) {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* 文件信息显示 */
#file-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

#file-info > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#file-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 10px;
}

#file-size {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}

/* 错误信息样式 */
.error-message {
    background: #ffebee;
    color: #d32f2f;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 3px solid #f44336;
    font-size: 14px;
    display: none;
}

/* 视频预览区域 */
.video-preview {
    margin-top: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    display: none;
}

#preview-video {
    width: 100%;
    max-height: 200px;
    background: #000;
    border-radius: 4px;
}

/* 视频预览失败样式（从uploads.js提取） */
.video-preview-error {
    padding: 20px;
    text-align: center;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    margin: 10px;
}

.video-preview-error > div:first-child {
    font-size: 24px;
    margin-bottom: 8px;
}

.video-preview-error > div:nth-child(2) {
    font-size: 14px;
    font-weight: 500;
}

.video-preview-error > div:nth-child(3) {
    font-size: 12px;
    margin-top: 4px;
    color: #aaa;
}

/* 上传进度样式 */
#upload-progress {
    margin: 15px 0;
    display: none;
}

.progress-container {
    background: #eee;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

#progress-bar {
    background: #4CAF50;
    height: 100%;
    width: 0%;
    transition: width 0.3s;
    border-radius: 3px;
}

.progress-text {
    text-align: center;
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-text #progress-percent {
    font-weight: 600;
    color: #4CAF50;
    margin-left: 4px;
}

/* 上传按钮样式 */
#upload-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#upload-submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#upload-submit-btn:not(:disabled):hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

#upload-submit-btn:not(:disabled):active {
    transform: translateY(0);
}

/* 上传按钮加载状态 */
#upload-submit-btn.loading {
    position: relative;
    pointer-events: none;
}

#upload-submit-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: buttonSpin 0.8s linear infinite;
    display: inline-block;
}

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

/* 移动端适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .file-upload-area {
        padding: 30px 15px;
    }
    
    .upload-placeholder div:first-child {
        font-size: 20px;
    }
    
    .upload-placeholder div:nth-child(2) {
        font-size: 14px;
    }
    
    .upload-placeholder div:nth-child(3) {
        font-size: 11px;
    }
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header {
        border-radius: 0;
    }
}