/* Projects Page Specific Styles */

/* Projects hero gradient override */
.projects-hero {
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-blue-light) 60%,
    var(--brown) 100%
  );
}

/* Erasmus Section */
.erasmus-section {
  padding: var(--space-xl) 0;
  background-color: var(--white);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-icon {
  width: 60px;
  height: 60px;
  background-color: var(--light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--secondary);
}

.section-header h2 {
  margin-bottom: 0;
  color: var(--primary);
}

.section-description {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--gray);
  margin-bottom: var(--space-lg);
  max-width: 800px;
}

/* Projects Grid - FIXED GAPS */
.projects-section {
  padding: var(--space-xl) 0;
  background-color: var(--light);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px; /* Consistent gap between cards */
  margin-top: 40px;
}

/* Project Card - FIXED PADDING */
.project-card {
  background-color: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--secondary);
  height: 100%; /* Make all cards same height */
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Card Image - FIXED */
/* Fix 2: project card image — remove background-attachment:fixed (breaks iOS) */
.project-card-image {
  height: 160px;
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px;
  border-bottom: 1px solid var(--light-gray);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.project-card-image.sf4sport {
  background-image: url("../images/projects/sf4sport.png");
}
.project-card-image.compath {
  background-image: url("../images/projects/compath.png");
}
.project-card-image.gasca {
  background-image: url("../images/projects/gasca.png");
}
.project-card-image.youthgen {
  background-image: url("../images/projects/youthgen.png");
}
.project-card-image.greentennis {
  background-image: url("../images/projects/greentennis.png");
}
.project-card-image.detam {
  background-image: url("../images/projects/detam.png");
}
.project-card-image.scorewomen {
  background-image: url("../images/projects/scorewomen.png");
}
.project-card-image.mimaria {
  background-image: url("../images/projects/mimaria.png");
}
.project-card-image.starhome {
  background-image: url("../images/projects/starhome.png");
}
.project-card-image.catsitter {
  background-image: url("../images/projects/catsitter.png");
}
.project-card-image.ecorelief {
  background-image: url("../images/projects/ecorelief.png");
}
.project-card-image.digitalsurvey {
  background-image: url("../images/projects/digitalsurvey.png");
}

.project-card-image img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.project-card-image.no-image {
  background: linear-gradient(135deg, var(--light), var(--light-gray));
  position: relative;
}

.project-card-image.no-image::after {
  content: "\f1b2";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 3rem;
  color: var(--secondary);
  opacity: 0.3;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Card Content - FIXED PADDING */
.project-card-content {
  padding: 24px; /* Consistent padding */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-header {
  margin-bottom: 16px; /* Consistent margin */
}

.project-tag {
  display: inline-block;
  background-color: var(--light);
  color: var(--secondary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card h3 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 1.4rem; /* Slightly smaller */
  line-height: 1.3;
}

.project-card p {
  color: var(--gray);
  margin-bottom: 16px; /* Reduced margin */
  line-height: 1.5;
  font-size: 0.95rem;
  flex: 1;
}

.project-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 20px; /* Reduced margin */
  flex-wrap: wrap;
}

.project-tags .tag {
  background-color: var(--light-gray);
  color: var(--gray);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-view-details {
  background-color: var(--secondary);
  color: var(--white);
  border: none;
  padding: 10px 16px; /* Smaller padding */
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: flex-start;
  margin-top: auto;
  width: 100%;
}

.btn-view-details:hover {
  background-color: var(--teal-dark);
}

/* Partnership CTA */
.partnership-cta {
  padding: var(--space-xl) 0;
  background-color: var(--primary);
  color: var(--white);
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  color: var(--white);
  margin-bottom: var(--space-md);
}

.cta-content p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-lg);
  font-size: 1.125rem;
  line-height: 1.8;
}

.cta-content .btn {
  background-color: var(--white);
  color: var(--primary);
}

.cta-content .btn:hover {
  background-color: var(--light);
}

/* Project Modal - (unchanged, keep as before) */
.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: var(--space-sm);
}

.project-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: var(--white);
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  z-index: 10001;
  animation: slideUp 0.3s ease;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--light-gray);
  border: none;
  font-size: 1.5rem;
  color: var(--gray);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10002;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background-color: var(--secondary);
  color: var(--white);
  transform: rotate(90deg);
}

.modal-body {
  padding: 32px; /* Increased padding */
}

/* Modal Content Styles */
.modal-project-header {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--light-gray);
  align-items: center;
}

.modal-project-image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  background-color: var(--light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-project-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-project-image.no-image {
  background: linear-gradient(135deg, var(--light), var(--light-gray));
  position: relative;
}

.modal-project-image.no-image::after {
  content: "\f1b2";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--secondary);
  opacity: 0.3;
}

.modal-project-title {
  flex: 1;
}

.modal-project-title h2 {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 1.8rem;
}

.modal-project-tag {
  display: inline-block;
  background-color: var(--light);
  color: var(--secondary);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-project-title > p {
  color: var(--gray);
  font-size: 1rem;
  line-height: 1.5;
}

.modal-project-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background-color: var(--light);
  border-radius: 8px;
  font-size: 0.9rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 500;
}

.detail-value {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.detail-value.website a {
  color: var(--secondary);
  text-decoration: underline;
  font-size: 0.9rem;
}

.detail-value.website a:hover {
  color: var(--primary);
}

.modal-project-description {
  margin-bottom: 0;
}

.modal-project-description h3,
.modal-project-description h4 {
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 1.25rem;
}

.modal-project-description h4 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 12px;
}

.modal-project-description p {
  line-height: 1.6;
  color: var(--gray);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.modal-project-description ul {
  list-style: none;
  padding-left: 20px;
  margin-bottom: 20px;
}

.modal-project-description li {
  padding: 6px 0;
  position: relative;
  color: var(--gray);
  line-height: 1.5;
  font-size: 0.95rem;
}

.modal-project-description li:before {
  content: "•";
  position: absolute;
  left: -15px;
  color: var(--secondary);
  font-size: 1rem;
}

.tech-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tech-tag {
  background-color: var(--light-gray);
  color: var(--gray);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

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

  .erasmus-section {
    padding: var(--space-lg) 0;
  }

  .projects-section {
    padding: var(--space-lg) 0;
  }

  .partnership-cta {
    padding: var(--space-lg) 0;
  }

  .cta-content {
    max-width: 100%;
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .section-description {
    font-size: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .project-card-content {
    padding: 20px;
  }

  .cta-content h2 {
    font-size: 1.8rem;
  }

  .cta-content p {
    font-size: 1rem;
  }

  .modal-content {
    max-width: 95%;
    max-height: 90vh;
  }

  .modal-body {
    padding: 24px;
  }

  .modal-project-header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .modal-project-image {
    width: 80px;
    height: 80px;
    margin: 0 auto;
  }

  .modal-project-details {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }
}

@media (max-width: 576px) {
  .erasmus-section,
  .projects-section,
  .partnership-cta {
    padding: var(--space-md) 0;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .section-description {
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-card-content {
    padding: 16px;
  }

  .project-card h3 {
    font-size: 1.3rem;
  }

  .project-tags .tag {
    font-size: 0.7rem;
  }

  .btn-view-details {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .cta-content h2 {
    font-size: 1.5rem;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-project-title h2 {
    font-size: 1.4rem;
    padding-right: 35px;
  }

  .project-card-image {
    height: 140px;
    padding: 16px;
  }

  .project-card-image img {
    max-height: 100px;
  }
}
