/**
 * 影片上傳 Modal 樣式 - Petoko 設計風格
 */

/* Modal 主容器 */
.video-upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: block;
}

.video-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-upload-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    height: auto;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

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

/* 頂部工具欄 */
.video-upload-modal .video-upload-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-upload-modal .header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.video-upload-modal .btn-close-uploader {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-upload-modal .btn-close-uploader:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.video-upload-modal .header-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-upload-modal .header-subtitle {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
    color: white;
    justify-content: flex-start;
}

/* 主內容區域 */
.video-upload-modal .video-upload-content {
    padding: 24px;
    overflow-y: auto;
}

/* 檔案選擇區域 */
.video-file-selector {
    margin-bottom: 24px;
}

.file-drop-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.file-drop-zone:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-drop-zone.dragover {
    border-color: #667eea;
    background: #e3f2fd;
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.drop-zone-icon {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 8px;
}

.drop-zone-text h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.drop-zone-text p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.drop-zone-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #888;
}

/* 影片預覽區域 */
.video-preview-section {
    margin-bottom: 24px;
}

.video-preview-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.video-preview-wrapper {
    position: relative;
    background: #000;
}

.video-preview {
    width: 100%;
    height: 300px;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 16px 20px;
    color: white;
    border-radius: 0 0 12px 12px;
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.video-filename {
    font-weight: 600;
    font-size: 16px;
}

.video-filesize,
.video-duration {
    font-size: 14px;
    opacity: 0.9;
}

/* 上傳進度區域 */
.video-upload-progress {
    margin-bottom: 24px;
}

.upload-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.upload-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
}

.upload-speed {
    font-size: 14px;
    color: #666;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-weight: 600;
    color: #333;
    min-width: 40px;
    text-align: right;
}

.upload-details {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.chunk-info,
.time-remaining {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 上傳狀態區域 */
.video-upload-status {
    margin-bottom: 24px;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.status-icon {
    font-size: 20px;
    color: #667eea;
}

.status-text {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.status-actions {
    display: flex;
    gap: 8px;
}

/* 底部操作區 */
.video-upload-footer {
    background: #f8f9fa;
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    flex: 1;
}

.upload-tips {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.upload-tips i {
    color: #ffc107;
}

.footer-actions {
    display: flex;
    gap: 12px;
}

/* 按鈕樣式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-outline-danger {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* 載入狀態 */
.video-upload-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-overlay {
    text-align: center;
    color: white;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.spinner-text i {
    font-size: 24px;
    color: #667eea;
}

.spinner-text p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.loading-subtitle {
    font-size: 14px;
    opacity: 0.8;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .video-upload-container {
        margin: 10px;
        max-height: 85vh;
    }
    
    .video-upload-content {
        padding: 16px;
    }
    
    .video-upload-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .footer-actions {
        justify-content: center;
    }
    
    .video-preview {
        height: 200px;
    }
    
    .upload-details {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* 動畫效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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