/**
 * 视频上传和播放样式
 */

/* 媒体上传区域 */
#mediaUpload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #mediaUpload {
        padding: 30px 15px;
    }
    
    #mediaUpload i {
        font-size: 36px;
        margin-bottom: 12px;
    }
    
    #mediaUpload p {
        font-size: 13px;
    }
    
    .media-item {
        width: 100px;
        height: 70px;
    }
    
    .video-modal-content {
        width: 95%;
        max-width: 90vw;
    }
    
    .video-modal-header {
        padding: 12px;
    }
    
    .video-modal-title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #mediaUpload {
        padding: 20px 10px;
    }
    
    #mediaUpload i {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    #mediaUpload p {
        font-size: 12px;
    }
    
    #uploadedMedia {
        gap: 8px;
    }
    
    .media-item {
        width: 80px;
        height: 60px;
    }
    
    .media-item .remove {
        width: 16px;
        height: 16px;
        font-size: 12px;
    }
    
    .media-badge,
    .media-type-indicator {
        font-size: 8px;
        padding: 2px 6px;
    }
    
    .video-modal-content {
        width: 98%;
        max-width: 95vw;
    }
    
    .video-modal-header {
        padding: 10px;
    }
    
    .video-modal-title {
        font-size: 12px;
    }
    
    .video-modal-close {
        width: 24px;
        height: 24px;
        font-size: 20px;
    }
}

#mediaUpload:hover {
    border-color: var(--primary-color);
    background-color: rgba(255, 36, 66, 0.05);
}

#mediaUpload i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

#mediaUpload p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 已上传媒体列表 */
#uploadedMedia {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.media-item {
    position: relative;
    width: 120px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.media-preview {
    width: 100%;
    height: 100%;
    position: relative;
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.media-badge,
.media-type-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.cover-container:hover .media-type-indicator,
.media-item:hover .media-badge {
    background-color: rgba(255, 36, 66, 0.9);
    transform: scale(1.05);
}

.media-item .remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.media-item .remove:hover {
    background-color: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* 视频播放模态框 */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-modal.show {
    opacity: 1;
}

.video-modal-content {
    width: 90%;
    max-width: 800px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.video-modal.show .video-modal-content {
    transform: scale(1);
}

.video-player-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background-color: #000;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-modal-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

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

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

/* 主页视频缩略图 */
.note-card .video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.note-card .video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-card .video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 5;
}

.note-card:hover .video-play-btn {
    opacity: 1;
}

.note-card .media-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
}

/* 标签选择器样式 */
.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tag-item {
    padding: 6px 12px;
    background-color: #f0f0f0;
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background-color: #e0e0e0;
}

.tag-item.selected {
    background-color: #e74c3c;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .video-modal-header {
        padding: 12px;
    }
    
    .video-modal-title {
        font-size: 14px;
    }
    
    .video-modal-close {
        font-size: 20px;
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 480px) {
    .video-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .video-player-container {
        padding-top: 75%; /* 4:3 aspect ratio for mobile */
    }
    
    .note-card .video-play-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .note-card .media-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
}

/* 上传队列容器 */
.upload-progress-container {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* 上传项目 */
.upload-item {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

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

/* 上传项目信息 */
.upload-item-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.upload-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 12px;
}

.upload-item-status {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upload-item-status.pending {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.upload-item-status.processing {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.upload-item-status.uploading {
  background: rgba(0, 123, 255, 0.1);
  color: #007bff;
}

.upload-item-status.completed {
  background: rgba(25, 135, 84, 0.1);
  color: #198754;
}

.upload-item-status.failed {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* 上传进度条 */
.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.upload-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.upload-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
}

/* 视频质量控制 */
.quality-control {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
}

.quality-btn {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quality-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.quality-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 5px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  padding: 5px 0;
  display: none;
  min-width: 80px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.quality-menu.show {
  display: block;
}

.quality-option {
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quality-option:hover {
  background: rgba(255, 255, 255, 0.2);
}

.quality-option.active {
  background: rgba(255, 36, 66, 0.6);
  font-weight: 600;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .quality-control {
    top: 5px;
    right: 5px;
  }

  .quality-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .quality-menu {
    min-width: 60px;
  }

  .quality-option {
    padding: 6px 12px;
    font-size: 10px;
  }

  /* 移动端视频播放器适配 */
  .video-player-container {
    padding-top: 75%; /* 4:3 比例，更适合移动设备 */
  }

  /* 上传队列移动端适配 */
  .upload-progress-container {
    padding: 12px;
    margin-top: 16px;
  }

  .upload-item {
    padding: 10px;
    margin-bottom: 8px;
  }

  .upload-item-name {
    font-size: 12px;
  }

  .upload-item-status {
    font-size: 10px;
    padding: 2px 8px;
  }

  .upload-progress-bar {
    height: 4px;
  }

  .upload-progress-text {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .quality-control {
    top: 3px;
    right: 3px;
  }

  .quality-btn {
    padding: 3px 6px;
    font-size: 9px;
  }

  .quality-menu {
    min-width: 50px;
  }

  .quality-option {
    padding: 5px 10px;
    font-size: 9px;
  }

  /* 上传队列移动端适配 */
  .upload-progress-container {
    padding: 10px;
    margin-top: 12px;
  }

  .upload-item {
    padding: 8px;
    margin-bottom: 6px;
  }

  .upload-item-name {
    font-size: 11px;
  }

  .upload-item-status {
    font-size: 9px;
    padding: 2px 6px;
  }
}
