/* Projects Page Styles */
.projects-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Projects Intro Section */
.projects-intro {
  text-align: center;
  margin-bottom: 3rem;
}

.projects-intro h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.projects-intro p {
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  color: var(--text-color);
}

/* Filter Buttons */
.project-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  background-color: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-color);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  background-color: var(--border-color);
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 4 equal columns */
  grid-template-rows: repeat(1, auto);   /* 4 rows that adjust to content */
  gap: 2rem;
}

/* Project Card */
.project-card {
  background: transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.project-image {
  height: 240px;
  overflow: hidden;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
}

.project-card:hover .project-image {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transform: translateY(-4px);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.03);
}

.project-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.project-card:hover .project-image::after {
  opacity: 1;
}

.project-content {
  padding: 1.2rem 0.5rem 0 0.5rem;
  background: transparent;
}

.project-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--color-primary-text);
}

.project-content p {
  font-size: 0.9rem;
  color: var(--color-secondary-text);
  margin-bottom: 0;
  line-height: 1.5;
}

.project-card:hover .project-content h3 {
  color: var(--color-primary-text);
}

.project-card:hover .project-content p {
  color: var(--color-secondary-text);
}

/* Tech Stack Tags */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.project-heading {
  font-weight: 500;
}

.tech-stack span {
  background-color: var(--light-bg);
  color: var(--accent-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}



/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--bg-color);
  margin: 5% auto;
  padding: 2rem;
  width: 90%;
  max-width: 800px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--color-accent);
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--color-primary-text);
}

#modal-body {
  margin-top: 0.5rem;
}

/* Project Details Styles (inside modal) */
.project-details-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

.project-details-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.project-details-subtitle {
  font-size: 1.1rem;
  color: var(--color-secondary-text);
  margin-bottom: 1.5rem;
}

.project-details-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.project-details-content {
  line-height: 1.8;
}

.project-details-section {
  margin-bottom: 1.5rem;
}

.project-details-section h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--primary-color);
}

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

.project-details-tech span {
  background-color: var(--light-bg);
  color: var(--accent-color);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.project-details-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.project-details-link {
  padding: 0.7rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.project-details-link:hover {
  background-color: var(--accent-color);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

  /* Responsive Styles */
@media (max-width: 992px) {
  .research-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .research-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .modal-content {
    width: 95%;
    padding: 1.5rem;
    margin: 10% auto;
  }
  
  .project-details-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 576px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .project-image {
    height: 180px;
  }
}