/* Project Detail Page Styles - Optimized & Shared */

/* Project Hero */
.project-hero {
  padding: 8rem 0 4rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 50%, var(--bg-alt) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.project-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: var(--gradient-primary);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
  animation: float 10s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.1); }
}

.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.project-hero__back:hover {
  color: var(--primary);
}

.project-hero__back svg {
  width: 20px;
  height: 20px;
}

.project-hero__title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  position: relative;
  animation: fadeInUp 0.6s ease-out;
}

.project-hero__subtitle {
  font-size: var(--font-size-xl);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-hero__tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-hero__tag {
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: 0.375rem 1rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-full);
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-hero__tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
}

/* Project Content */
.project-content {
  padding: var(--section-padding) 0;
  background: var(--bg);
}

.project-content__inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.project-content__description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.project-content__description:last-of-type {
  margin-bottom: 2rem;
}

.project-content__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.project-content__link:hover {
  background: var(--primary);
  color: white;
}

.project-content__link svg {
  width: 18px;
  height: 18px;
}

/* Tech Stack */
.project-tech {
  padding: 3rem 0;
  background: var(--bg-alt);
}

.project-tech__title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1.5rem;
}

.project-tech__grid {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-tech__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition-base);
}

.project-tech__item:hover {
  border-color: var(--primary);
  transform: translateY(-5px) scale(1.05);
  box-shadow: var(--shadow-md), 0 0 20px rgba(37, 99, 235, 0.15);
  background: linear-gradient(135deg, var(--bg) 0%, var(--primary-light) 100%);
}

/* Gallery */
.project-gallery {
  padding: var(--section-padding) 0;
  background: var(--bg);
}

.project-gallery__title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 3rem;
}

.project-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-alt);
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 1;
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(37, 99, 235, 0.15);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(2);
}

.gallery-item__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  color: white;
  font-weight: 500;
  transform: translateY(100%);
  transition: transform var(--transition-base);
  z-index: 2;
}

.gallery-item:hover .gallery-item__caption {
  transform: translateY(0);
}

.gallery-item__zoom {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-fast);
  z-index: 2;
}

.gallery-item:hover .gallery-item__zoom {
  opacity: 1;
  transform: scale(1);
}

.gallery-item__zoom svg {
  width: 20px;
  height: 20px;
  color: var(--text);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox__img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.lightbox__caption {
  text-align: center;
  color: white;
  margin-top: 1rem;
  font-size: var(--font-size-base);
}

.lightbox__close {
  position: absolute;
  top: -3rem;
  right: 0;
  width: 44px;
  height: 44px;
  background: white;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.lightbox__close:hover {
  transform: scale(1.1);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: white;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox__nav:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox__nav--prev {
  left: -4rem;
}

.lightbox__nav--next {
  right: -4rem;
}

/* Responsive */
@media (max-width: 768px) {
  .project-gallery__grid {
    grid-template-columns: 1fr;
  }

  .lightbox__nav {
    display: none;
  }

  .lightbox__close {
    top: 1rem;
    right: 1rem;
    position: fixed;
  }

  .project-hero {
    padding: 6rem 0 3rem;
  }

  .project-hero__title {
    font-size: var(--font-size-3xl);
  }
}
