/* ============================================
   SPYDEY OFFICIAL — Work Section
   work.css | YouTube / Portfolio Grid
   ============================================ */

/* === WORK SECTION === */
.work {
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

/* === WORK GRID === */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* === VIDEO CARD === */
.video-card {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-smooth);
  will-change: transform;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(230, 57, 70, 0.2);
}

/* === THUMBNAIL === */
.video-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  will-change: transform;
}

.video-card:hover .video-thumbnail {
  transform: scale(1.05);
}

/* === DARK OVERLAY === */
.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(0, 0, 0, 0.4) 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
  transition: background var(--transition-smooth);
  z-index: 1;
}

.video-card:hover .video-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.5) 70%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

/* === PLAY BUTTON === */
.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-red);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--transition-smooth);
  box-shadow: 0 0 30px var(--accent-red-glow);
}

.video-play-btn::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 3px;
}

/* Ripple ring */
.video-play-btn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-red);
  opacity: 0;
  animation: playRipple 2s ease-out infinite;
}

@keyframes playRipple {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.video-card:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--accent-red-hover);
  box-shadow: 0 0 50px var(--accent-red-glow);
}

/* === VIDEO INFO === */
.video-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  z-index: 2;
  transform: translateY(8px);
  opacity: 0;
  transition: all var(--transition-smooth);
}

.video-card:hover .video-info {
  transform: translateY(0);
  opacity: 1;
}

.video-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffffff;
  margin-bottom: 4px;
}

.video-views {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

/* === DURATION BADGE === */
.video-duration {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  z-index: 2;
  letter-spacing: 0.5px;
}

/* === VIDEO MODAL === */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1;
}

.video-modal-wrapper {
  position: relative;
  width: 90vw;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  z-index: 2;
  transform: scale(0.92);
  transition: transform var(--transition-smooth);
}

.video-modal.active .video-modal-wrapper {
  transform: scale(1);
}

.video-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(230, 57, 70, 0.15);
  background: #000;
}

.video-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-smooth);
  z-index: 3;
}

.video-modal-close:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  transform: rotate(90deg);
}

/* === LOAD MORE BUTTON === */
.work-load-more {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .video-play-btn {
    width: 56px;
    height: 56px;
  }

  .video-play-btn::before {
    border-width: 8px 0 8px 14px;
    margin-left: 2px;
  }
}

@media (max-width: 768px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .video-play-btn {
    width: 48px;
    height: 48px;
  }

  .video-play-btn::before {
    border-width: 7px 0 7px 12px;
  }

  .video-info {
    padding: 12px 16px;
    transform: translateY(0);
    opacity: 1;
  }

  .video-title {
    font-size: 0.85rem;
  }

  .video-modal-content {
    width: 95vw;
    border-radius: var(--radius-sm);
  }

  .video-modal-close {
    top: -44px;
    right: 4px;
  }
}

@media (max-width: 480px) {
  .work-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .video-play-btn {
    width: 44px;
    height: 44px;
  }

  .video-play-btn::before {
    border-width: 6px 0 6px 10px;
  }

  .video-duration {
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 0.7rem;
  }

  .work-load-more {
    margin-top: 32px;
  }
}
