/* Projects Page Specific Styles */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
  width: 100%;
  padding-top: 100px;
  /* Space for navbar */
  padding-bottom: 50px;
  z-index: 2;
}

.projects-grid-container {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  /* 1 col mobile */
  gap: 2rem;
  padding: 1rem 1rem 10rem 1rem;
  max-width: 1300px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .projects-grid-container {
    grid-template-columns: repeat(2, 1fr);
    /* 2 cols tablet */
  }
}

@media (min-width: 1200px) {
  .projects-grid-container {
    grid-template-columns: repeat(3, 1fr);
    padding: 2rem 2rem 10rem 2rem;
    gap: 3rem;
    /* 3 cols small desktop */
  }
}

/* --- COPIED STYLES FROM HOME PAGE TO ENSURE MATCHING AESTHETICS --- */

/* Card Styles */
article.project-card-details {
  width: 100%;
  /* Adapts to grid cell */
  height: fit-content;
  background: linear-gradient(155deg, rgb(85, 2, 78), rgb(17, 5, 19) 40%);
  color: var(--text-color);
  box-shadow: 0 4px 30px rgba(146, 179, 255, 0.2);
  overflow: hidden;
  z-index: 102;
  margin-top: 0;
  /* Override home page margin */
  border: 2px solid rgba(146, 179, 255, 0.3);
  transition: all 0.3s ease-in-out;
}

article.project-card-details:hover {
  box-shadow: 0px 0px 40px rgba(146, 179, 255, 0.4);
  border-color: var(--primary-color);
  transform: translateY(-5px);
}

article.project-card-details:hover img {
  transform: scale(1.15) translateY(-5px);
  opacity: 1;
}

article.project-card-details img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: all 0.6s ease-in-out;
  opacity: 0.9;
}

article.project-card-details h3 {
  font-family: var(--font-family-secondary);
  font-size: var(--h4-size);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  color: var(--tertiary-color);
}

article.project-card-details h4 {
  font-family: var(--font-family-tertiary);
  font-size: 0.8rem;
  line-height: 1.5;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  color: var(--text-color);
}

article.project-card-details p {
  font-family: var(--font-family-primary);
  font-size: 0.8rem;
  letter-spacing: 1px;
  font-weight: 400;
  color: var(--text-light-color);
}

/* Button "View details" */
.view-details-btn {
  width: 100%;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--primary-color);
  font-family: var(--font-family-secondary);
  letter-spacing: 1px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.view-details-btn:hover {
  color: var(--tertiary-color);
}

/* Modal Styles - Copied to ensure functionality on projects page */
.project-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.project-modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(
    155deg,
    rgba(85, 2, 78),
    var(--background-color) 40%
  );
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  max-width: 1400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  animation: slideUp 0.4s ease;
  box-shadow: 0 0 50px rgba(146, 179, 255, 0.6);
}

@media (min-width: 992px) {
  .modal-content {
    width: 85%;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

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

.modal-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.modal-close {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  z-index: 3;
  background: rgba(17, 5, 19, 0.3);
  backdrop-filter: blur(5px);
  padding-bottom: 8px;
  border: none;
  color: var(--primary-color);
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.4s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: var(--tertiary-color);
  transform: rotate(180deg);
}

.modal-body {
  /* padding: 3rem; */
}

.modal-image {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-family: var(--font-family-secondary);
  font-size: 2rem;
  color: var(--tertiary-color);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  text-align: start;
}

.modal-subtitle {
  font-family: var(--font-family-tertiary);
  font-size: var(--paragraf-size);
  color: var(--text-color);
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
}

.modal-description {
  font-family: var(--font-family-primary);
  font-size: var(--paragraf-size);
  color: var(--text-light-color);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tech-badge {
  background: rgba(146, 179, 255, 0.1);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-family: var(--font-family-secondary);
  letter-spacing: 1px;
}

.modal-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-link-btn {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(146, 179, 255, 0.2),
    rgba(85, 2, 78, 0.3)
  );
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  color: var(--primary-color);
  font-family: var(--font-family-secondary);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-link-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(146, 179, 255, 0.5);
  background: linear-gradient(
    135deg,
    rgba(146, 179, 255, 0.3),
    rgba(85, 2, 78, 0.4)
  );
  color: var(--tertiary-color);
}

.modal-link-btn.github {
  border-color: var(--tertiary-color);
  color: var(--tertiary-color);
}

.modal-link-btn.github:hover {
  box-shadow: 0 5px 20px rgba(255, 167, 95, 0.5);
}
