/* Portfolio Project Page Styles */

/* Navigation */
.project-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.nav-back:hover {
  color: var(--accent-primary);
  transform: translateX(-5px);
}

.nav-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  flex: 1;
}

.nav-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(135deg, var(--accent-primary), #9f7aea);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: var(--font-size-sm);
  transition: all 0.3s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Project Hero */
.project-hero {
  position: relative;
  height: 70vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(139, 92, 246, 0.8));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  color: white;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.project-category {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
}

.project-date {
  opacity: 0.9;
}

.project-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  margin: 0 0 var(--spacing-md) 0;
  line-height: 1.2;
}

/* Photography-style Back Navigation - Global Styles */
.back-nav {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.back-nav:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-2px);
  color: #ffffff;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

/* Hide any existing nav-back elements when using photography style */
.nav-back {
  display: none !important;
}

/* Add proper spacing from portfolio title - Override existing margin */
.project-title {
  margin-top: 4rem !important;
}

/* Mobile responsive for photography navigation */
@media (max-width: 768px) {
  .back-nav {
    top: 1rem;
    left: 1rem;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .project-title {
    margin-top: 3.5rem !important;
  }
}

/* Main Content */
.project-content {
  padding: var(--spacing-3xl) 0;
  background: #f8fafc;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: var(--spacing-3xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.main-content {
  background: white;
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-3xl);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.content-section {
  margin-bottom: var(--spacing-3xl);
}

.content-section:last-child {
  margin-bottom: 0;
}

.content-section h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 var(--spacing-lg) 0;
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid #e2e8f0;
}

.content-text {
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: #374151;
}

.content-text p {
  margin-bottom: var(--spacing-lg);
}

.content-text h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: #1e293b;
  margin: var(--spacing-xl) 0 var(--spacing-md) 0;
}

.content-text ul, .content-text ol {
  margin: var(--spacing-lg) 0;
  padding-left: var(--spacing-xl);
}

.content-text li {
  margin-bottom: var(--spacing-sm);
}

.content-text code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
}

.content-text pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  overflow-x: auto;
  margin: var(--spacing-lg) 0;
}

/* Image Gallery */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

/* Video Wrapper for YouTube embeds */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: var(--spacing-lg) 0;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-caption {
  font-style: italic;
  color: #64748b;
  text-align: center;
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.gallery-item {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay i {
  color: white;
  font-size: 2rem;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.sidebar-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 var(--spacing-lg) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid #e2e8f0;
}

.project-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item strong {
  color: #64748b;
  font-weight: 600;
}

.tech-stack {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.tech-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: #f8fafc;
  border-radius: var(--border-radius);
  font-weight: 500;
}

.tech-item i {
  color: var(--accent-primary);
  width: 20px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  padding-left: var(--spacing-lg);
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
}

/* Related Projects */
.project-navigation {
  padding: var(--spacing-3xl) 0;
  background: white;
}

.project-navigation h2 {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 var(--spacing-xl) 0;
}

.related-projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.related-card {
  display: block;
  background: white;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.related-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.related-image {
  height: 200px;
  overflow: hidden;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-card:hover .related-image img {
  transform: scale(1.05);
}

.related-content {
  padding: var(--spacing-lg);
}

.related-content h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 var(--spacing-sm) 0;
}

.related-content p {
  color: #64748b;
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
}

.image-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.image-modal .modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  max-width: 90vw;
  max-height: 90vh;
  transition: all 0.3s ease;
}

.image-modal.active .modal-content {
  transform: translate(-50%, -50%) scale(1);
}

.image-modal .modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.image-modal .modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.image-modal img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  width: auto;
  height: auto;
}

.modal-caption {
  text-align: center;
  color: white;
  margin-top: var(--spacing-md);
  font-size: var(--font-size-lg);
  font-weight: 500;
}

/* Mobile optimizations for image modal */
@media (max-width: 768px) {
  .image-modal .modal-content {
    max-width: 95vw !important;
    max-height: 95vh !important;
    padding: var(--spacing-sm);
  }
  
  .image-modal img {
    max-width: 100% !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
    min-width: 300px;
    object-fit: contain;
  }
  
  .image-modal .modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .modal-caption {
    font-size: var(--font-size-md);
    margin-top: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
  }
}

/* iPhone specific optimizations */
@media (max-width: 480px) {
  .image-modal .modal-content {
    max-width: 98vw !important;
    max-height: 98vh !important;
    padding: var(--spacing-xs);
  }
  
  .image-modal img {
    max-height: 90vh !important;
    max-width: 98vw !important;
    width: auto !important;
    height: auto !important;
    min-width: 280px;
    border-radius: var(--border-radius-md);
    object-fit: contain;
  }
  
  .modal-caption {
    font-size: var(--font-size-sm);
    line-height: 1.4;
    margin-top: var(--spacing-xs);
  }
}

/* Navigation */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 var(--spacing-sm);
    height: 60px;
  }

  .nav-title {
    display: none;
  }

  .nav-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .nav-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
  }

  /* Hide original back link on mobile since we have floating button */
  .nav-back {
    display: none !important;
  }

  .project-hero {
    height: 50vh;
    min-height: 400px;
  }

  .project-title {
    font-size: var(--font-size-2xl);
  }

  .project-subtitle {
    font-size: var(--font-size-lg);
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    padding: 0 var(--spacing-sm);
  }

  .main-content {
    padding: var(--spacing-xl);
  }

  .image-gallery {
    grid-template-columns: 1fr;
  }

  .related-projects {
    grid-template-columns: 1fr;
    padding: 0 var(--spacing-sm);
  }

  .project-video {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
  }
  
  .project-video h3 {
    font-size: var(--font-size-md);
  }
}

@media (max-width: 480px) {
  .nav-container {
    flex-direction: column;
    height: auto;
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
  }

  .nav-back {
    align-self: flex-start;
  }

  .nav-actions {
    justify-content: center;
    width: 100%;
  }

  .project-hero {
    height: 40vh;
    min-height: 350px;
  }

  .main-content {
    padding: var(--spacing-lg);
  }

  .sidebar-card {
    padding: var(--spacing-lg);
  }

  .project-tags {
    justify-content: center;
  }
}
