/* COMPLETELY REWRITTEN PROJECTS CSS */

/* Override SPA fade system for projects */
#projects-content {
  position: relative !important;
  z-index: 1000 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 20%, #0f3460 40%, #533483 60%, #7209b7 80%, #2d1b69 100%) !important;
  background-size: 300% 300% !important;
  animation: gradientShift 8s ease infinite !important;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Projects container - simplified */
.projects-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding: 2rem !important;
  box-sizing: border-box !important;
  z-index: 1001 !important;
  pointer-events: auto !important;
}

/* Grid overlay */
.projects-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 1;
}

/* Section titles */
.section-title {
  position: absolute;
  top: 0;
  left: 1rem;
  z-index: 1010;
  opacity: 1;
}

.title-featured, .title-projects {
  font-size: min(8rem, 15vw, 13vh);
  font-weight: 400;
  font-family: 'Anton', Arial, sans-serif;
  background: linear-gradient(90deg, #ff00ff, #00ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: left;
  letter-spacing: 0.05em;
  text-transform: none;
  margin: 0;
  line-height: 0.9;
}

.title-subtitle {
  font-size: 1.2rem;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  margin-top: 1rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Projects wheel - responsive sizing like Projects.html */
.projects-wheel {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(500px, 70vw) !important;
  height: min(500px, 50vh) !important;
  perspective: 1000px !important;
  z-index: 1020 !important;
  pointer-events: auto !important;
}

.wheel-container {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(-22deg);
  cursor: grab;
  transition: transform 0.1s ease-out;
  pointer-events: auto !important;
  z-index: 1021;
}

.wheel-container:active {
  cursor: grabbing;
}

/* Project cards - responsive sizing like Projects.html */
.project-card {
  position: absolute !important;
  width: clamp(250px, 28vw, 440px) !important;
  height: clamp(200px, 25vh, 350px) !important;
  background: linear-gradient(145deg, #1a0d2e, #16213e) !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 0 !important;
  left: 50% !important;
  top: 50% !important;
  margin-left: calc(clamp(250px, 28vw, 440px) / -2) !important;
  margin-top: calc(clamp(200px, 25vh, 350px) / -2) !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  backface-visibility: visible !important;
  box-shadow:
    0 0 10px rgba(255, 0, 255, 0.15),
    0 0 20px rgba(0, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 0, 255, 0.2) !important;
  transform-style: preserve-3d !important;
  pointer-events: auto !important;
  z-index: 1022 !important;
}

.project-card:hover {
  box-shadow:
    0 0 25px rgba(255, 0, 255, 0.6),
    0 0 50px rgba(0, 255, 255, 0.4),
    0 0 75px rgba(255, 0, 255, 0.3),
    inset 0 2px 0 rgba(255, 0, 255, 0.6) !important;
  background: linear-gradient(145deg, #16213e, #0f3460) !important;
  border-color: #00ffff !important;
}

/* Position cards in 3D circle - responsive radius like Projects.html */
.project-card:nth-child(1) { transform: rotateY(0deg) translateZ(clamp(250px, 33vw, 460px)); }
.project-card:nth-child(2) { transform: rotateY(60deg) translateZ(clamp(250px, 33vw, 460px)); }
.project-card:nth-child(3) { transform: rotateY(120deg) translateZ(clamp(250px, 33vw, 460px)); }
.project-card:nth-child(4) { transform: rotateY(180deg) translateZ(clamp(250px, 33vw, 460px)); }
.project-card:nth-child(5) { transform: rotateY(240deg) translateZ(clamp(250px, 33vw, 460px)); }
.project-card:nth-child(6) { transform: rotateY(300deg) translateZ(clamp(250px, 33vw, 460px)); }

/* Project card content */
.project-image {
  width: 100%;
  height: calc(100% - 50px);
  background-size: cover;
  background-position: center;
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}

.project-header {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 13, 46, 0.9);
  border-radius: 0 0 8px 8px;
  border-top: 2px solid #ff44ff;
  pointer-events: none;
}

.project-header h3 {
  margin: 0;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  text-align: center;
  padding: 0 0.5rem;
  pointer-events: none;
}

/* Modal - completely rewritten */
.modal {
  display: none;
  position: fixed;
  z-index: 2000 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  pointer-events: auto !important;
}

.modal-content {
  background: linear-gradient(145deg, #1a0d2e, #16213e);
  margin: 5% auto;
  padding: 2rem;
  border-radius: 12px;
  width: 80%;
  max-width: 800px;
  position: relative;
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: auto !important;
}

.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

.close {
  color: #ff44ff;
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.close:hover {
  color: #44ffff;
}

/* Force interaction on all elements */
.projects-only * {
  pointer-events: auto !important;
}

.project-card * {
  pointer-events: none !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .projects-wheel {
    width: 300px !important;
    height: 300px !important;
  }
  
  .project-card {
    width: 200px !important;
    height: 150px !important;
    margin-left: -100px !important;
    margin-top: -75px !important;
  }
  
  .project-card:nth-child(1) { transform: rotateY(0deg) translateZ(200px); }
  .project-card:nth-child(2) { transform: rotateY(60deg) translateZ(200px); }
  .project-card:nth-child(3) { transform: rotateY(120deg) translateZ(200px); }
  .project-card:nth-child(4) { transform: rotateY(180deg) translateZ(200px); }
  .project-card:nth-child(5) { transform: rotateY(240deg) translateZ(200px); }
  .project-card:nth-child(6) { transform: rotateY(300deg) translateZ(200px); }
}

/* Full-screen modal styles */
.project-fullscreen-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 20%, #0f3460 40%, #533483 60%, #7209b7 80%, #2d1b69 100%);
  z-index: 3000;
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-fullscreen-modal.show {
  display: block;
  opacity: 1;
  transform: scale(1);
}

/* Hide navigation when modal is open */
.project-fullscreen-modal.show ~ .bottom-nav {
  display: none !important;
}

.fullscreen-modal-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 3001;
  border-bottom: 1px solid rgba(255, 0, 255, 0.3);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 0, 255, 0.1);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.close-btn {
  color: #ff00ff;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  color: #00ffff;
  background: rgba(255, 255, 255, 0.1);
}

.fullscreen-modal-content {
  padding-top: 80px;
  padding-bottom: 2rem;
  min-height: 100vh;
  opacity: 0;
  animation: fadeInContent 0.6s ease 0.2s forwards;
}

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

.project-hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: center;
}

.project-hero-image {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.project-hero-info {
  padding: 1rem 0;
}

.project-title {
  font-family: 'Anton', Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  margin: 0 0 1.5rem 0;
  color: #ffffff !important;
  line-height: 1.1;
}

.project-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tech-badge {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.project-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.project-details-grid > div {
  background: rgba(26, 13, 46, 0.4);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 0, 255, 0.2);
  backdrop-filter: blur(10px);
}

.project-details-grid h2 {
  font-family: 'Anton', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #00ffff;
  margin: 0 0 1rem 0;
  letter-spacing: 0.02em;
}

.project-description, .project-technical-details, .project-challenges {
  color: #ffffff !important;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  font-size: 1rem;
}

.project-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-features-list li {
  color: #ffffff !important;
  font-family: 'Inter', sans-serif;
  padding: 0.5rem 0;
  position: relative;
  padding-left: 1.5rem;
}

.project-features-list li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: #ff00ff;
  font-size: 0.8rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(145deg, rgba(255, 0, 255, 0.1), rgba(0, 255, 255, 0.1));
  border: 2px solid rgba(255, 0, 255, 0.3);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  transition: all 0.3s ease;
}

.project-link:hover {
  background: linear-gradient(145deg, rgba(255, 0, 255, 0.2), rgba(0, 255, 255, 0.2));
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  transform: translateY(-2px);
}

.project-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(145deg, rgba(128, 128, 128, 0.1), rgba(128, 128, 128, 0.1));
  border-color: rgba(128, 128, 128, 0.3);
  color: #cccccc;
}

.project-link.disabled:hover {
  background: linear-gradient(145deg, rgba(128, 128, 128, 0.1), rgba(128, 128, 128, 0.1));
  border-color: rgba(128, 128, 128, 0.3);
  box-shadow: none;
  transform: none;
}

.error-indicator {
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

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

.gallery-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.gallery-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-image:hover img {
  transform: scale(1.05);
}

/* Mobile responsiveness for full-screen modal */
@media (max-width: 768px) {
  .project-hero-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .project-details-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1rem;
  }
  
  .project-details-grid > div {
    padding: 1.5rem;
  }
  
  .fullscreen-modal-header {
    padding: 0 1rem;
  }
  
  .back-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  
  .project-title {
    font-size: 2rem;
  }
  
  .project-links {
    flex-direction: column;
  }
}