.project-section {
  padding: 5rem 0;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.project-section::before {
  display: none;
}

.project-section h1 {
  text-align: center;
  margin-bottom: 4rem;
  color: var(--text-primary);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 900;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, var(--text-primary), #667eea, #764ba2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.project-section h1::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
  border-radius: 2px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.8;
    transform: translateX(-50%) scaleX(1);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1.1);
  }
}

.project-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

/* Clean project cards */
.project {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 25px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  min-height: 450px;
  backdrop-filter: blur(20px);
}

/* Individual project gradients */
#project1 {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
  border-color: rgba(59, 130, 246, 0.3);
}

#project2 {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
  border-color: rgba(16, 185, 129, 0.3);
}

#project3 {
  background: linear-gradient(135deg, rgba(245, 101, 101, 0.15), rgba(190, 24, 93, 0.1));
  border-color: rgba(245, 101, 101, 0.3);
}

#project4 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
  border-color: rgba(251, 191, 36, 0.3);
}

/* Shine effect on hover */
.project::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(45deg);
  transition: all 0.8s ease;
  opacity: 0;
}

.project:hover::after {
  opacity: 1;
  animation: shine 1.5s ease-in-out;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

.project:hover {
  transform: translateY(-15px) scale(1.02);
}

.project h2 {
  color: var(--text-primary);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, var(--text-primary), #667eea);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-image-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  height: 220px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s ease;
  filter: brightness(0.95) contrast(1.1) saturate(1.1);
}

.project:hover img {
  transform: scale(1.15) rotate(2deg);
  filter: brightness(1.1) contrast(1.25) saturate(1.2);
}

.project p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: clamp(0.9rem, 2vw, 1rem);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.9;
}

.project-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.8rem;
}

.tech-tag {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-tag:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  transform: translateY(-3px) scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
}

.project-actions {
  display: flex;
  gap: 1.2rem;
  margin-top: auto;
}

.site-btn {
  flex: 1;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 15px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.site-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: left 0.6s ease;
}

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

.site-btn:hover {
  transform: translateY(-3px) scale(1.05);
  background: linear-gradient(135deg, #764ba2, #f093fb);
}

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

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

/* Light theme */
[data-theme="light"] .project {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #project1 {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
  border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="light"] #project2 {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
  border-color: rgba(16, 185, 129, 0.2);
}

[data-theme="light"] #project3 {
  background: linear-gradient(135deg, rgba(245, 101, 101, 0.1), rgba(190, 24, 93, 0.05));
  border-color: rgba(245, 101, 101, 0.2);
}

[data-theme="light"] #project4 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
  border-color: rgba(251, 191, 36, 0.2);
}

[data-theme="light"] .tech-tag {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tech-tag:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
  border-color: rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .project-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 0 1.5rem;
  }

  .project {
    min-height: 400px;
    padding: 2rem;
  }

  .project-image-wrapper {
    height: 200px;
  }
}

@media (max-width: 768px) {
  .project-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }

  .project {
    min-height: 380px;
    padding: 1.8rem;
    text-align: center;
    /* Center align all content on mobile */
  }

  .project-image-wrapper {
    height: 200px;
    margin-bottom: 1.2rem;
    /* Reduced gap */
  }

  .project h2 {
    margin-bottom: 1rem;
    /* Reduced gap */
  }

  .project p {
    margin-bottom: 1.2rem;
    /* Reduced gap */
    -webkit-line-clamp: 4;
  }

  .project-tech-stack {
    justify-content: center;
    /* Center tech tags on mobile */
    margin-bottom: 1.5rem;
    /* Reduced gap */
  }

  .project-section {
    padding: 3rem 0;
  }

  /* Center buttons on mobile */
  .project-actions {
    margin: -1rem 0 1rem 0;
    flex-direction: column;
    align-items: center;
  }

  .site-btn {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .project-container {
    padding: 0 0.5rem;
    gap: 1.5rem;
  }

  .project {
    padding: 1.5rem;
    min-height: 350px;
    text-align: center;
    /* Ensure center alignment on small mobile */
  }

  .project h2 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    /* Further reduced gap */
  }

  .project p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    /* Further reduced gap */
    -webkit-line-clamp: 3;
  }

  .project-image-wrapper {
    height: 160px;
    margin-bottom: 1rem;
    /* Further reduced gap */
  }

  .project-tech-stack {
    margin-bottom: 1.2rem;
    /* Further reduced gap */
    gap: 0.6rem;
    /* Reduced gap between tags */
  }

  .tech-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .project-section h1 {
    font-size: 2rem;
  }

  .site-btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    max-width: 250px;
  }
}

/* Entrance animations */
.project {
  opacity: 0;
  transform: translateY(60px);
  animation: slideInUp 1s ease forwards;
}

.project:nth-child(1) {
  animation-delay: 0.1s;
}

.project:nth-child(2) {
  animation-delay: 0.2s;
}

.project:nth-child(3) {
  animation-delay: 0.3s;
}

.project:nth-child(4) {
  animation-delay: 0.4s;
}

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

/* Button ripple effect */
.site-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.site-btn:active::after {
  width: 300px;
  height: 300px;
}
