:root {
  --primary: #0070f3;
  --bg-light: #f5f7fa;
  --text-color: #1f2937;
  --card-radius: 12px;
  --shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  --transition-fast: 0.3s ease;
  --transition-smooth: 0.5s ease-in-out;
  --accent-green: #28a745;
  --accent-red: #dc3545;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f9f9f9;
  color: #333;
  line-height: 1.6;
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 30px;
  color: #1658bc;
}

#contacted-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.8rem;
}

.loading {
  font-size: 1rem;
  color: #555;
  text-align: center;
}

.result-card {
  background: white;
  border-radius: var(--card-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: fadeInUp 0.5s ease;
  position: relative;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.result-card h3 {
  margin: 0.5rem 0;
  color: var(--primary);
}

.result-card p {
  font-size: 0.95rem;
  margin: 6px 0;
}

.profile-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 112, 243, 0.15);
}

button {
  padding: 8px 14px;
  margin-top: 10px;
  margin-right: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.save-btn {
  background-color: var(--primary);
  color: white;
}

.save-btn:hover {
  background-color: #042f68;
}

.contact-btn {
  background-color: rgb(46, 124, 233);
  color: white;
}

.contact-btn:hover {
  background-color: #184d53;
}

.message-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  background-color: #066fbf;
  color: white;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.message-btn:hover {
  background-color: #05a588;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
  animation: slideUp 0.4s ease-in-out;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0px);
    opacity: 1;
  }
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 18px;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #000;
}

.profile-photo-modal {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 2px solid var(--primary);
  box-shadow: 0 3px 10px rgba(0, 112, 243, 0.2);
}

.contact-actions {
  margin: 20px 0;
}

.show-contact-btn {
  background-color: rgb(5, 119, 132);
  color: white;
  padding: 10px 16px;
  font-weight: bold;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.show-contact-btn:hover {
  background-color: #0898c8;
}

.contact-info p {
  font-size: 0.95rem;
  margin: 10px 0;
}


@media (max-width: 768px) {

  main {
    padding: 1rem;
  }

  h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
  }

  #contacted-container {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .result-card {
    padding: 1rem;
  }

  .profile-photo {
    width: 70px;
    height: 70px;
  }

  .result-card h3 {
    font-size: 1.1rem;
  }

  .result-card p {
    font-size: 0.85rem;
  }

  button,
  .save-btn,
  .contact-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    margin-top: 8px;
    margin-right: 6px;
  }

  .message-btn {
    font-size: 13px;
    padding: 8px 10px;
    margin-top: 12px;
  }

  /* Modal */
  .modal-content {
    padding: 1rem;
    width: 95%;
    max-width: none;
  }

  .profile-photo-modal {
    width: 70px;
    height: 70px;
  }

  .show-contact-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .contact-info p {
    font-size: 0.85rem;
  }
}
