/* Videos Gallery Styles */

.videos-page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

/* Header Section */
.videos-header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInDown 0.6s ease-out;
}

.videos-header h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.videos-header p {
  font-size: 1.2rem;
  color: #999;
  margin-bottom: 30px;
  line-height: 1.6;
}

.video-count {
  display: inline-block;
  padding: 10px 30px;
  background: rgba(99, 102, 241, 0.1);
  border: 2px solid #6366f1;
  border-radius: 50px;
  color: #6366f1;
  font-weight: 600;
  font-size: 1.1rem;
}

.video-count span {
  color: #8b5cf6;
  font-weight: 700;
  font-size: 1.4rem;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top: 4px solid #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  color: #999;
  font-size: 1.1rem;
}

/* Video Gallery Grid */
.video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  animation: fadeIn 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Video Item Card */
.video-item {
  background: rgba(30, 30, 46, 0.5);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  backdrop-filter: blur(10px);
}

.video-item:hover {
  transform: translateY(-10px);
  border-color: #6366f1;
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
  background: rgba(30, 30, 46, 0.8);
}

/* Video Player Container */
.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 8px;
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-player-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Video Overlay on Hover */
.video-player-wrapper::after {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(99, 102, 241, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  z-index: 10;
  pointer-events: none;
}

.video-item:hover .video-player-wrapper::after {
  opacity: 0.9;
}

/* Video Info */
.video-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
}

.video-description {
  font-size: 0.95rem;
  color: #aaa;
  margin-bottom: 15px;
  flex-grow: 1;
}

/* Video Meta */
.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.video-duration {
  font-size: 0.85rem;
  color: #6366f1;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.video-duration::before {
  content: '⏱';
  font-size: 1rem;
}

.watch-button {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.watch-button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.watch-button:active {
  transform: scale(0.98);
}

/* Full Screen Player Modal */
.video-player-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.video-player-modal.open {
  display: flex;
}

.video-player-modal-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
}

.video-player-modal video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.close-player-modal {
  position: absolute;
  top: -40px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-player-modal:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .videos-header h1 {
    font-size: 2.5rem;
  }

  .video-gallery {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .videos-page-container {
    padding: 30px 15px;
  }

  .videos-header h1 {
    font-size: 2rem;
  }

  .videos-header p {
    font-size: 1rem;
  }

  .video-gallery {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }

  .close-player-modal {
    top: 10px;
  }
}

@media (max-width: 480px) {
  .videos-page-container {
    padding: 20px 10px;
  }

  .videos-header h1 {
    font-size: 1.5rem;
  }

  .videos-header p {
    font-size: 0.9rem;
  }

  .video-gallery {
    grid-template-columns: 1fr;
  }

  .video-player-modal-content {
    aspect-ratio: auto;
  }

  .video-info {
    padding: 15px;
  }

  .video-title {
    font-size: 1rem;
  }
}

/* Dark Theme Integration */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --bg-dark: #0f172a;
  --bg-darker: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --border-color: rgba(99, 102, 241, 0.2);
}

body.dark-mode .video-item {
  background: rgba(30, 30, 46, 0.5);
  border-color: var(--border-color);
}

body.dark-mode .video-title {
  color: var(--text-primary);
}

body.dark-mode .video-description {
  color: var(--text-secondary);
}
