.projects-section {
  padding: 80px 0;
  position: relative;
  background-color: var(--bg);
  transition: background-color 0.3s ease;
}

.projects-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--primary);
  border-radius: 30px;
  background-color: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn.active,
.filter-btn:hover {
  background-color: var(--primary);
  color: var(--light);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 300px;
  background-color: var(--card-bg);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.project-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 25px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.project-card:hover .project-overlay {
  transform: translateY(0);
}

.project-title {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: white;
}

.project-category {
  display: block;
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 15px;
  font-weight: 600;
}

.view-details {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-details:hover {
  background-color: white;
  color: var(--primary);
}

/* Project Modal */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.project-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 15px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 40px;
  border: 1px solid var(--border);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background-color: var(--primary);
  color: white;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.modal-left {
  display: flex;
  align-items: center;
}

.modal-image {
  width: 100%;
  height: 300px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
}

.modal-right h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--text-color);
}

.modal-category {
  display: inline-block;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.modal-description {
  color: var(--text-secondary);
  margin-bottom: 25px;
  line-height: 1.6;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.modal-tags span {
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.modal-btn:hover {
  background-color: rgba(var(--primary-rgb), 0.9);
}

@media (max-width: 992px) {
  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-image {
    height: 250px;
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  .projects-section {
    padding: 60px 0;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }

  .modal-content {
    padding: 30px 20px;
  }
}

@media (max-width: 576px) {
  .filter-btn {
    font-size: 0.8rem;
    padding: 8px 16px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    height: 250px;
  }

  .modal-content {
    width: 95%;
    padding: 25px 15px;
  }

  .modal-right h2 {
    font-size: 1.5rem;
  }
}