/* /css/components/project-detail.css */

/* Project Detail Modal - Now with centered positioning */
.project-detail {
  position: fixed; /* Changed from absolute to fixed */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9); /* Center positioning with scale for animation */
  width: 90vw; /* Use viewport width to ensure proper sizing */
  max-width: 1200px; /* Maximum width to maintain readability */
  height: 85vh; /* Set a percentage of viewport height */
  max-height: 700px; /* Maximum height to maintain readability */
  border-radius: 16px;
  background-color: var(--color-bg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 9999; /* Higher z-index to ensure it's above everything */
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  overflow: hidden;
}

.project-detail.active {
  transform: translate(-50%, -50%) scale(1); /* Maintain center position when active */
  opacity: 1;
  pointer-events: all;
}

/* Optional overlay background */
.detail-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998; /* Just below the panel */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.detail-panel-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.project-slideshow {
  width: 50%;
  height: 100%;
  position: relative;
  overflow: hidden;
  perspective: 1000px; /* For 3D effect */
}

.slideshow-container {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.slide {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%) scale(0.9);
  transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0%) scale(1);
  z-index: 2;
}

.slide.prev {
  opacity: 0;
  transform: translateY(-100%) scale(0.9);
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  transform: scale(1.05);
  will-change: transform;
}

.slide.active img {
  transform: scale(1);
}

.slideshow-nav {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  z-index: 5;
}

.slide-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.slide-dot.active {
  background-color: var(--color-accent);
  transform: scale(1.2);
}

.slide-nav {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(var(--color-bg-rgb), 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  border: 1px solid rgba(var(--color-accent-rgb), 0.2);
  transition: all var(--transition-normal);
}

.slide-nav:hover {
  background-color: rgba(var(--color-accent-rgb), 0.2);
  transform: scale(1.1);
}

.slide-prev {
  left: 10px;
  bottom: 20px;
}

.slide-next {
  left: 10px;
  top: 20px;
}

.slide-instruction {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: rgba(var(--color-bg-rgb), 0.7);
  color: var(--color-text-light);
  padding: 5px 10px;
  font-size: var(--font-size-xs);
  border-radius: 15px;
  backdrop-filter: blur(4px);
  opacity: 0.8;
  transition: opacity 0.3s ease;
  z-index: 10;
}

/* Update instruction text for scroll navigation */
.slide-instruction::before {
  content: "Scroll to navigate images";
}

.project-slideshow:hover .slide-instruction {
  opacity: 0.9; /* Make it more visible on hover */
}

/* Hide original text if you're using the ::before content */
.slide-instruction span {
  display: none;
}

.slide-nav svg {
  width: 20px;
  height: 20px;
  color: var(--color-text);
}

.project-content {
  width: 50%;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto; /* Allow scrolling for content if needed */
}

.project-content h3 {
  font-family: var(--font-display);
  margin-bottom: var(--space-3);
  color: var(--color-accent);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.project-tags span {
  background-color: rgba(var(--color-accent-rgb), 0.1);
  color: var(--color-accent);
  padding: var(--space-1) var(--space-3);
  border-radius: 30px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.project-description {
  margin-bottom: var(--space-4);
  color: var(--color-text-light);
}

.project-highlights {
  list-style-type: none;
  padding-left: 0;
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
}

.project-highlights li {
  position: relative;
  padding-left: var(--space-4);
  margin-bottom: var(--space-2);
}

.project-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 2px;
  background-color: var(--color-accent);
}

.project-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* IMPROVED BUTTON STYLES */
.project-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: 8px;
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-normal);
  background-color: var(--color-accent);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.2);
}

.project-actions .btn svg {
  width: 16px;
  height: 16px;
}

.project-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.25);
}

.project-actions .btn.btn-outline {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: none;
}

.project-actions .btn.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: rgba(var(--color-accent-rgb), 0.05);
}

.close-detail {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(var(--color-bg-rgb), 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  border: 1px solid var(--color-border);
  transition: transform var(--transition-normal), background-color var(--transition-normal);
}

.close-detail:hover {
  background-color: var(--color-bg);
  transform: rotate(90deg);
}

.close-detail svg {
  width: 18px;
  height: 18px;
  color: var(--color-text);
}

/* Add scrolling lock for body when detail panel is open */
body.detail-panel-open {
  overflow: hidden;
}

/* Fix for cursor in detail panel */
.project-detail,
.project-detail * {
  cursor: none !important; /* Ensure browser cursor is hidden */
}

.detail-panel-overlay {
  cursor: none !important;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .project-detail {
    flex-direction: column;
    height: 90vh; /* Slightly taller on mobile */
    width: 95vw;
  }
  
  .project-slideshow,
  .project-content {
    width: 100%;
  }
  
  .project-slideshow {
    height: 40%;
  }
  
  .project-content {
    height: 60%;
    overflow-y: auto;
  }
  
  .project-actions .btn {
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-3);
  }
  
  .project-actions .btn svg {
    width: 14px;
    height: 14px;
  }
}