/* Project Preview Popup Styles - Enhanced */
#project-preview-popup {
  position: fixed;
  z-index: 9999;
  width: 800px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

#project-preview-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Neon Purple Tech Mode */
body.neon-purple-tech #project-preview-popup {
  background: rgba(26, 16, 43, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow:
    0 30px 80px rgba(10, 6, 18, 0.4),
    0 15px 35px rgba(139, 92, 246, 0.2),
    0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* Slider Section - Enhanced */
.preview-slider {
  width: 100%;
  aspect-ratio: 16 / 10;
  position: relative;
  background: linear-gradient(135deg, #0A0612 0%, #1A102B 100%);
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.preview-slides-container {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.preview-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
}

.preview-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0A0612;
  transition: transform 0.3s ease;
}

.preview-slide:hover img {
  transform: scale(1.05);
}

/* Slider Navigation - Enhanced */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
  font-weight: bold;
}

.slider-btn:hover {
  background: rgba(139, 92, 246, 0.8);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

/* Neon Purple Tech Mode slider buttons */
body.neon-purple-tech .slider-btn {
  background: rgba(26, 16, 43, 0.8);
  border-color: rgba(139, 92, 246, 0.3);
}

body.neon-purple-tech .slider-btn:hover {
  background: rgba(139, 92, 246, 0.9);
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
}

.prev-btn {
  left: 12px;
}

.next-btn {
  right: 12px;
}

/* Content Section - Enhanced */
.preview-content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 0 0 16px 16px;
}

.preview-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
  color: var(--p-950);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.preview-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--n-600);
  margin: 0;
  font-weight: 400;
}

/* Neon Purple Tech Mode content */
body.neon-purple-tech .preview-content {
  background: rgba(26, 16, 43, 0.8);
  border-top: 1px solid rgba(139, 92, 246, 0.2);
}

body.neon-purple-tech .preview-title {
  color: #EDE9FE;
  text-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

body.neon-purple-tech .preview-description {
  color: #A78BFA;
  text-shadow: 0 1px 4px rgba(139, 92, 246, 0.2);
}

/* Tech Badges - Enhanced */
.preview-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.tech-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tech-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.tech-badge:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
}

.tech-badge:hover::before {
  left: 100%;
}

/* Neon Purple Tech Mode badges */
body.neon-purple-tech .tech-badge {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.1));
  color: #EDE9FE;
  border-color: rgba(139, 92, 246, 0.4);
}

body.neon-purple-tech .tech-badge:hover {
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  border-color: rgba(236, 72, 153, 0.6);
}

/* Responsive Design - Enhanced */
@media (max-width: 768px) {
  #project-preview-popup {
    width: calc(100vw - 32px);
    max-width: 400px;
  }
  
  .preview-slider {
    aspect-ratio: 4 / 3;
  }
  
  .preview-content {
    padding: 20px;
    gap: 16px;
  }
  
  .preview-title {
    font-size: 1.4rem;
  }
  
  .preview-description {
    font-size: 0.95rem;
  }
  
  .tech-badge {
    font-size: 0.75rem;
    padding: 5px 12px;
  }
  
  .slider-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .prev-btn {
    left: 8px;
  }
  
  .next-btn {
    right: 8px;
  }
}

@media (max-width: 480px) {
  #project-preview-popup {
    width: calc(100vw - 20px);
  }
  
  .preview-content {
    padding: 16px;
    gap: 14px;
  }
  
  .preview-title {
    font-size: 1.2rem;
  }
  
  .preview-description {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  .tech-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    gap: 8px;
  }
  
  .slider-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .prev-btn {
    left: 6px;
  }
  
  .next-btn {
    right: 6px;
  }
}

/* Loading state for images */
.preview-slide img {
  transition: opacity 0.3s ease;
}

.preview-slide img.loading {
  opacity: 0.5;
}

/* Smooth scroll indicator */
.preview-slider::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  z-index: 5;
}

body.neon-purple-tech .preview-slider::after {
  background: rgba(139, 92, 246, 0.4);
}

/* --- Added for Modal functionality --- */

/* Close Button */
.preview-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  font-size: 24px;
  line-height: 1;
  transition: all 0.3s ease;
  padding: 0;
  border: none;
}

.preview-close-btn:hover {
  background: rgba(220, 38, 38, 0.8);
  transform: scale(1.1) rotate(90deg);
}

/* Backdrop */
#project-preview-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 9998; /* Just below popup */
  cursor: pointer;
}

#project-preview-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Action Button */
.preview-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.preview-visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: white !important;
  border-radius: 30px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.preview-visit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

body.neon-purple-tech .preview-visit-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

body.neon-purple-tech .preview-visit-btn:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}
