/* Demo Section - Video Gallery Styles */

#demo {
  padding: 80px 0;
  background: var(--color-dark);
}

/* Header */
.demo-header {
  text-align: center;
  margin-bottom: 60px;
}

.demo-header .section-title {
  color: var(--color-light) !important;
  margin-bottom: 16px;
}

.demo-header .section-subtitle {
  font-size: 1.125rem;
  color: var(--color-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Main Video Player */
.video-player {
  margin-bottom: 50px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.15);
  background: var(--color-dark);
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-wrapper iframe {
  transition: opacity 0.3s ease;
}

/* Video Gallery Grid */
.video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

/* Gallery Item */
.gallery-item {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.gallery-item.active {
  box-shadow: 0 8px 20px rgba(45, 90, 61, 0.3);
  border: 3px solid var(--color-primary);
}

.gallery-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 2;
}

/* Thumbnail Wrapper */
.thumbnail-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: var(--color-dark);
}

.thumbnail-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-item:hover .thumbnail-wrapper img {
  transform: scale(1.05);
}

/* Play Overlay */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .play-overlay {
  opacity: 1;
}

.gallery-item.active .play-overlay {
  opacity: 0;
}

.play-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, background 0.3s ease;
}

.gallery-item:hover .play-icon {
  transform: scale(1.1);
  background: white;
}

/* Video Info */
.video-info {
  padding: 20px;
}

.video-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.gallery-item:hover .video-title {
  color: var(--color-primary-hover);
}

.gallery-item.active .video-title {
  color: var(--color-primary);
  font-weight: 700;
}

.video-description {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  #demo {
    padding: 60px 0;
  }

  .demo-header .section-title {
    font-size: 2rem;
  }

  .demo-header .section-subtitle {
    font-size: 1rem;
  }

  .video-gallery {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .gallery-item {
    max-width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .video-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .video-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Dark Theme Support */
.dark-theme #demo {
  background: var(--color-light);
}

.dark-theme .gallery-item {
  background: var(--color-bg-alt);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .gallery-item:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.dark-theme .video-title {
  color: var(--color-text);
}

.dark-theme .video-description {
  color: var(--color-muted);
}
