/* Enhanced Projects Section Styles */

/* Main container styles */
.projects {
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem;
}

/* Background gradient effect */
.projects::before {
  content: '';
  position: absolute;
  left: -10%;
  bottom: -10%;
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 50%, #d946ef 100%);
  opacity: 0.05;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  animation: pulse-bg 10s infinite alternate;
}

.projects::after {
  content: '';
  position: absolute;
  right: -10%;
  top: -10%;
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 50%, #2563eb 100%);
  opacity: 0.05;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  animation: pulse-bg 12s infinite alternate-reverse;
}

@keyframes pulse-bg {
  0% {
    opacity: 0.03;
    transform: scale(1) translate(0, 0);
  }
  100% {
    opacity: 0.08;
    transform: scale(1.1) translate(5%, 5%);
  }
}

/* Section header */
.projects h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 1.5rem;
  font-size: 2.5rem;
  text-align: center;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6, #d946ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 0.5rem;
}

/* Introduction text */
.projects-intro {
  max-width: 800px;
  text-align: center;
  margin: 0 auto 5rem;
  position: relative;
  z-index: 1;
}

.projects-intro p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards 0.3s;
}

/* Projects grid layout */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2.5rem;
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  perspective: 1000px;
}

/* Project card */
.project-card {
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 100%;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
}

/* Staggered animation for cards */
.project-card:nth-child(1) { animation: fadeInProject 0.8s forwards 0.1s; }
.project-card:nth-child(2) { animation: fadeInProject 0.8s forwards 0.3s; }
.project-card:nth-child(3) { animation: fadeInProject 0.8s forwards 0.5s; }
.project-card:nth-child(4) { animation: fadeInProject 0.8s forwards 0.7s; }
.project-card:nth-child(5) { animation: fadeInProject 0.8s forwards 0.9s; }
.project-card:nth-child(6) { animation: fadeInProject 0.8s forwards 1.1s; }
.project-card:nth-child(7) { animation: fadeInProject 0.8s forwards 1.3s; }
.project-card:nth-child(8) { animation: fadeInProject 0.8s forwards 1.5s; }

@keyframes fadeInProject {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card hover effects */
.project-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
              0 0 20px rgba(79, 70, 229, 0.2);
  border-color: rgba(79, 70, 229, 0.3);
}

/* Glow effect on hover */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, 
                              rgba(79, 70, 229, 0.1), 
                              transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-card:hover::before {
  opacity: 1;
}

/* Project content */
.project-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

/* Project title */
.project-content h3 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease;
}

.project-content h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #8b5cf6);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.project-card:hover .project-content h3 {
  transform: translateX(5px);
}

.project-card:hover .project-content h3::after {
  width: 100%;
}

/* Project description */
.project-content p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
  line-height: 1.7;
  flex-grow: 1;
  font-size: 1rem;
}

/* Tech stack tags */
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.project-tech span {
  background: rgba(79, 70, 229, 0.1);
  color: #a5b4fc;
  padding: 0.6rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  border: 1px solid rgba(79, 70, 229, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(5px);
}

.project-tech span i {
  font-size: 1rem;
  color: #818cf8;
}

.project-tech span:hover {
  background: rgba(79, 70, 229, 0.2);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: rgba(79, 70, 229, 0.4);
}

/* Project links */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-width: 140px;
  border: none;
  outline: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

.btn::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: 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
  background: linear-gradient(135deg, #6366f1, #a855f7);
}

.btn i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.btn:hover i {
  transform: translateX(3px);
}

.btn.disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: linear-gradient(135deg, #4b5563, #6b7280);
  box-shadow: 0 5px 15px rgba(75, 85, 99, 0.3);
}

.btn.disabled:hover {
  transform: none;
  box-shadow: 0 5px 15px rgba(75, 85, 99, 0.3);
}

.btn.disabled::before {
  display: none;
}

/* Call to action section */
.projects-cta {
  text-align: center;
  margin-top: 6rem;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s forwards 1.5s;
}

.projects-cta p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.1rem 2.2rem;
  background: linear-gradient(135deg, #4f46e5, #8b5cf6, #d946ef);
  color: #fff;
  text-decoration: none;
  border-radius: 40px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.cta-btn:hover::before {
  left: 100%;
}

.cta-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 35px rgba(79, 70, 229, 0.6);
}

.cta-btn i {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.cta-btn:hover i {
  transform: rotate(360deg);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  .projects {
    padding: 5rem 1.5rem;
  }
  
  .projects h2 {
    font-size: 2.2rem;
  }
  
  .projects-intro {
    margin-bottom: 3rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .project-content {
    padding: 2rem;
  }
  
  .project-content h3 {
    font-size: 1.4rem;
  }
  
  .project-tech {
    gap: 0.6rem;
  }
  
  .project-tech span {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
  }
  
  .project-links {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .projects-cta {
    margin-top: 4rem;
  }
  
  .cta-btn {
    padding: 1rem 1.8rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .projects {
    padding: 4rem 1rem;
  }
  
  .project-content {
    padding: 1.5rem;
  }
  
  .project-content h3 {
    font-size: 1.3rem;
  }
  
  .project-content p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  
  .project-tech span {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
  
  .btn {
    padding: 0.8rem 1.4rem;
    font-size: 0.9rem;
  }
}

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