/* AdminVideo.css */

/* Page Container */
.admin-video-page {
  min-height: 100vh;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* Main Container */
.admin-video-container {
  direction: rtl;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-icon {
  font-size: 1.8rem;
}

.video-count {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Search Container */
.search-container {
  position: relative;
  margin-bottom: 24px;
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.6;
}

.search-input {
  width: 100%;
  padding: 14px 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.12);
}

.search-clear {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Error Message */
.error-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 12px;
  color: #ff6b6b;
  margin-bottom: 20px;
}

.error-close {
  margin-right: auto;
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

/* Player Section */
.player-section {
  margin-bottom: 30px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(102, 126, 234, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-title {
  color: #fff;
  font-size: 1rem;
  margin: 0;
  font-weight: 500;
}

.close-player-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.close-player-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.player-wrapper {
  padding: 20px;
}

.player-wrapper video {
  width: 100%;
  max-height: 500px;
  border-radius: 12px;
}

/* Section Title */
.section-title {
  color: #fff;
  font-size: 1.1rem;
  margin: 0 0 20px 0;
  font-weight: 600;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Video Card */
.video-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.video-card-active {
  border-color: #667eea;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.video-thumbnail {
  height: 140px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.3),
    rgba(118, 75, 162, 0.3)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-thumbnail:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.5),
    rgba(118, 75, 162, 0.5)
  );
}

.play-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.video-thumbnail:hover .play-icon {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.video-info {
  padding: 16px;
}

.video-name {
  color: #fff;
  font-size: 0.95rem;
  margin: 0 0 14px 0;
  word-break: break-all;
}

.video-actions {
  display: flex;
  gap: 10px;
}

.play-btn,
.delete-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.play-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.play-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.delete-btn {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.delete-btn:hover {
  background: rgba(255, 107, 107, 0.3);
}

/* Loading Container */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.7);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.6);
}

.empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
}

.empty-state p {
  margin: 0 0 20px 0;
  font-size: 1.1rem;
}

.clear-search-btn {
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #667eea;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
}

.clear-search-btn:hover {
  background: rgba(102, 126, 234, 0.3);
}

/* Refresh Button */
.refresh-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  direction: rtl;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.modal-title {
  color: #fff;
  font-size: 1.3rem;
  margin: 0 0 12px 0;
}

.modal-text {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.modal-text strong {
  color: #ff6b6b;
  display: block;
  margin-top: 8px;
  word-break: break-all;
}

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

.modal-cancel-btn,
.modal-delete-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.modal-cancel-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.modal-delete-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  border: none;
  color: #fff;
}

.modal-delete-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.modal-delete-btn:disabled,
.modal-cancel-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-video-container {
    padding: 20px;
  }

  .admin-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .admin-title {
    font-size: 1.3rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .player-header {
    flex-direction: column;
    gap: 12px;
  }

  .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .admin-video-page {
    padding: 20px 10px;
  }

  .admin-video-container {
    padding: 16px;
    border-radius: 16px;
  }

  .video-actions {
    flex-direction: column;
  }
}
