/* 视频管理页面样式 */
@import url('user-management.css');

/* 分页样式 - 视频列表专用 */
.pagination-container {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 50px 0;
  padding: 30px;
  min-height: 80px;
  background: linear-gradient(135deg, #fafafa, #f8f9fa);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.08);
  backdrop-filter: blur(10px);
}

/* 强制显示分页控件用于调试 */
.pagination-container.debug-visible {
  display: flex !important;
  border: 2px solid red;
}

.pagination-info {
  color: #5a3e2b;
  font-size: 16px;
  text-align: center;
  margin-bottom: 10px;
  font-weight: 600;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 12px 24px;
  border-radius: 25px;
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.1);
  border: 1px solid #e9ecef;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.pagination-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.15);
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  padding: 15px 25px;
  border-radius: 50px;
  box-shadow: 0 2px 10px rgba(44, 24, 16, 0.08);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(233, 236, 239, 0.5);
}

.page-item {
  display: inline-block;
}

.page-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid rgba(233, 236, 239, 0.8);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  color: #5a3e2b;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 44px;
  height: 44px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  box-shadow: 0 2px 4px rgba(44, 24, 16, 0.08);
}

.page-link:hover {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-color: #8b4513;
  color: #8b4513;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, #8b4513, #a0522d);
  border-color: #8b4513;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
  transform: translateY(-1px);
}

.page-item.disabled .page-link {
  color: #adb5bd;
  pointer-events: none;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-color: rgba(233, 236, 239, 0.6);
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.page-item.disabled .page-link:hover {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 加载状态样式 */
.pagination-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* 移动端分页样式优化 */
@media (max-width: 768px) {
  .pagination-container {
    margin: 30px 0;
    padding: 15px;
  }
  
  .pagination-info {
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .pagination {
    gap: 3px;
  }
  
  .page-link {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
    padding: 0 8px;
  }
}

@media (max-width: 480px) {
  .pagination-container {
    margin: 20px 0;
    padding: 10px;
  }
  
  .page-link {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* 调试样式 - 确保分页可见 */
.pagination-container.debug {
  border: 2px solid red !important;
  background: #ffeb3b !important;
}

.pagination-container[style*="display: none"] {
  display: none !important;
}

.pagination-container:not([style*="display: none"]) {
  display: flex !important;
}

/* 视频卡片样式 */
.video-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.video-card-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}

.video-title {
  margin: 0;
  color: #2c1810;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

.video-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.video-thumbnail {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
}

.video-thumbnail video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.video-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
}

.info-item {
  display: flex;
  margin-bottom: 8px;
  align-items: flex-start;
}

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

.info-label {
  font-weight: 600;
  color: #495057;
  min-width: 80px;
  flex-shrink: 0;
}

.info-value {
  color: #6c757d;
  flex: 1;
  margin-left: 10px;
}

/* 移动端卡片布局样式 */
.video-card.mobile-card {
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-card.mobile-card .video-card-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.video-card.mobile-card .video-title {
  font-size: 16px;
  flex: 1;
  margin-right: 10px;
  line-height: 1.3;
}

.video-card.mobile-card .video-actions {
  margin-top: 0;
  gap: 5px;
}

.video-card.mobile-card .video-actions .btn {
  padding: 6px 8px;
  font-size: 12px;
  min-width: auto;
}

.video-card.mobile-card .video-actions .btn i {
  margin-right: 0;
}

.video-card.mobile-card .video-thumbnail {
  margin-bottom: 12px;
}

.video-card.mobile-card .video-thumbnail video {
  height: 180px;
  border-radius: 8px;
}

.video-card.mobile-card .video-info {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.video-card.mobile-card .info-item {
  flex-direction: column;
  margin-bottom: 8px;
  align-items: flex-start;
}

.video-card.mobile-card .info-label {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 2px;
  min-width: auto;
}

.video-card.mobile-card .info-value {
    font-size: 14px;
    color: #2c1810;
    margin-left: 0;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 3em;
}

/* 小窗播放器样式 */
.mini-player {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.video-thumbnail {
  position: relative;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
}

.video-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-thumbnail:hover .video-overlay {
  opacity: 1;
}

.fullscreen-btn {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.fullscreen-btn i {
  font-size: 16px;
}

/* 移除旧的播放覆盖层样式 */
.play-overlay {
  display: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .video-card {
    padding: 15px;
  }
  
  .video-card-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .video-actions {
    margin-top: 10px;
    justify-content: flex-end;
  }
  
  .video-title {
    font-size: 16px;
  }
  
  .mini-player {
    height: 150px;
  }
  
  .fullscreen-btn {
    width: 36px;
    height: 36px;
  }
  
  .fullscreen-btn i {
    font-size: 14px;
  }
  
  /* 移动端网格布局优化 */
  .video-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 576px) {
  .video-actions {
    flex-direction: column;
    gap: 5px;
  }
  
  .video-actions .btn {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .video-actions .btn:last-child {
    margin-bottom: 0;
  }
  
  .mini-player {
    height: 120px;
  }
}

/* 小窗播放器控制样式 */
.mini-controls {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-thumbnail:hover .mini-controls {
  opacity: 1;
}

.mini-play-btn {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.mini-play-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.mini-play-btn i {
  font-size: 14px;
}

/* 防止视频控制条干扰 */
.mini-player::-webkit-media-controls {
  display: none !important;
}

.mini-player::-webkit-media-controls-panel {
  display: none !important;
}

.mini-player::-webkit-media-controls-overlay-play-button {
  display: none !important;
}

.mini-player::-webkit-media-controls-play-button {
  display: none !important;
}

.mini-player::-webkit-media-controls-timeline {
  display: none !important;
}

.mini-player::-webkit-media-controls-current-time-display {
  display: none !important;
}

.mini-player::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

.mini-player::-webkit-media-controls-volume-slider {
  display: none !important;
}

.mini-player::-webkit-media-controls-mute-button {
  display: none !important;
}

.mini-player::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* 桌面端卡片样式 */
.video-card.desktop-card {
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.video-card.desktop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.video-card.desktop-card .video-card-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.video-card.desktop-card .video-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c1810;
  margin: 0;
  flex: 1;
  margin-right: 16px;
}

.video-card.desktop-card .video-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.video-card.desktop-card .video-thumbnail {
  margin-bottom: 16px;
}

.video-card.desktop-card .video-thumbnail video {
  height: 200px;
  border-radius: 8px;
  object-fit: cover;
}

.video-card.desktop-card .video-info {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
}

.video-card.desktop-card .info-item {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
}

.video-card.desktop-card .info-item:last-child {
  margin-bottom: 0;
}

.video-card.desktop-card .info-label {
  font-weight: 600;
  color: #495057;
  min-width: 100px;
  flex-shrink: 0;
  font-size: 14px;
}

.video-card.desktop-card .info-value {
  color: #6c757d;
  flex: 1;
  margin-left: 12px;
  font-size: 14px;
  word-break: break-word;
}

/* 视频卡片网格布局 - 优化最后一页显示 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 450px));
  gap: 24px;
  margin-top: 24px;
  justify-content: center;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* 当只有一个视频时的特殊处理 */
.video-grid:has(> .video-card:only-child) {
  grid-template-columns: minmax(380px, 450px);
}

/* 视频卡片最大宽度限制 */
.video-card {
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
}

.video-card.desktop-card {
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 0 15px;
  }
  
  .video-card,
  .video-card.desktop-card {
    max-width: 100%;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .video-grid {
    padding: 0 10px;
    gap: 15px;
  }
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 20px;
  color: #dee2e6;
}

.empty-state h3 {
  margin-bottom: 10px;
  color: #495057;
}

.empty-state p {
  margin-bottom: 20px;
}

/* 上传区域样式 */
.upload-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  transition: all 0.3s ease-out;
  opacity: 1;
  transform: scale(1);
}

.upload-section.closing {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.upload-section.hidden {
  display: none;
}

.upload-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  margin-left: 35%;
  margin-top: 5%;
  overflow-y: auto;
}

.upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.upload-header h3 {
  margin: 0;
  color: #2c1810;
  font-size: 20px;
  font-weight: 600;
}

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

.close-upload:hover {
  background: #f8f9fa;
  color: #dc3545;
}

.upload-content {
  padding: 20px;
}

.file-upload-area {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.file-upload-area:hover {
  border-color: #8b4513;
  background: #fafafa;
}

.upload-icon {
  font-size: 48px;
  color: #8b4513;
  margin-bottom: 15px;
  opacity: 0.8;
}

.file-upload-area h4 {
  margin: 0 0 10px 0;
  color: #2c1810;
  font-size: 18px;
  font-weight: 500;
}

.file-upload-area p {
  margin: 0 0 20px 0;
  color: #6c757d;
}

.files-list {
  max-height: 300px;
  overflow-y: auto;
}

.file-item {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
  background: #f8f9fa;
}

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

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-header h4 {
  margin: 0;
  color: #2c1810;
  font-size: 16px;
}

.progress-list {
  max-height: 200px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .upload-container {
    width: 95%;
    margin: 10px;
  }
  
  .upload-header {
    padding: 15px;
  }
  
  .upload-content {
    padding: 15px;
  }
  
  .file-upload-area {
    padding: 30px 15px;
  }
}

/* 全屏视频模态框样式 */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.fullscreen-modal.show {
  display: flex;
}

.fullscreen-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-modal video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  outline: none;
}

.fullscreen-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.fullscreen-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

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

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

@media (max-width: 768px) {
  .fullscreen-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
    width: 40px;
    height: 40px;
  }
  
  .fullscreen-modal video {
    max-width: 100vw;
    max-height: 100vh;
  }
}