body {
  font-family: 'Poppins', sans-serif;
  background: #f2f2f2;
  display: flex;
  justify-content: center;
  padding: 30px;
}

.card-container {
  position: relative; 
  width: 380px;
  background: #ffffff;
  border-radius: 20px;
  overflow: visible; 
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  animation: fade 1s ease-in-out;
}

.banner {
  position: relative;
  z-index: 1;
  overflow: hidden; 
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.banner img {
  width: 100%;
  height: 150px;       
  object-fit: cover;
  object-position: center; 
  display: block;
}


.profile-section {
  text-align: center;
  padding: 20px 20px 20px;
  margin-top: -60px; 
  position: relative;
  z-index: 10;
}

.profile-img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid #ff0000;
  margin-top: 5px;
  object-fit: cover;
  position: relative;
  z-index: 11;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.logo-circle {
  position: absolute;
  /* moved closer to the profile image and above it */
  top: 36px;
  right: 90px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ff0000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 12; /* sit above the profile image */
}

/* force logo to fill the circle cleanly */
.logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.role {
  font-weight: 600;
  margin: 5px 0;
}

.department {
  color: #ff0000;
  font-size: 14px;
  margin-bottom: 10px;
}
.department span {
  font-weight: 600;
}

.bio {
  font-size: 15px;
  opacity: 0.8;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.contact-actions {
  display: flex;
  justify-content: space-around;
  padding: 20px;
}

.contact-btn {
  padding: 12px 18px;
  background: #ff0000;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  transition: transform .2s;
}

.contact-btn:hover {
  transform: scale(1.05);
}

.save-contact {
  display: inline-block;
  width: calc(100% - 40px);
  margin: 18px 20px;
  padding: 12px 18px;
  background: #555555;
  color: #fff;
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255,122,0,0.18);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  -webkit-tap-highlight-color: transparent;
  animation: pulse 2.4s infinite;
  will-change: transform, box-shadow;
  transform: translateZ(0);
  -webkit-appearance: none;
}

.save-contact:hover {
  transform: scale(1.03);
  background: #ff0000;
  box-shadow: 0 12px 34px rgba(230,106,0,0.18);
}

.save-contact:active {
  transform: scale(1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.socials {
  position: static;
  margin: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  pointer-events: auto;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #ff0000;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-transition: -webkit-transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
  width: 100%;              
  box-sizing: border-box;
  justify-content: flex-start;
  -webkit-transform: translateZ(0);
}

.social-link:hover,
.social-link:focus {
  transform: scale(1.03);
  -webkit-transform: scale(1.03);
  box-shadow: 0 12px 34px rgba(0,0,0,0.12);
  background: #4d0202;
  outline: none;
}

.social-link:focus {
  box-shadow: 0 0 0 3px rgba(230,106,0,0.12);
}

/* ensure social-text can shrink inside flex buttons (important for iOS) */
.social-link .social-text {
  flex: 1 1 auto;
  min-width: 0;              /* allows text to shrink instead of overflowing */
  line-height: 1;
  font-size: 14px;
  word-break: break-word;
}

/* make the Location label responsive and truncate if too long */
.social-link[aria-label="Location"] .social-text {
  font-size: clamp(12px, 1.8vw, 14px); /* scales across small→large phones */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

/* slight override for common large iPhone widths to ensure legibility */
@media (min-width: 390px) and (max-width: 844px) {
  .social-link[aria-label="Location"] .social-text {
    font-size: clamp(12px, 1.6vw, 13px);
  }
}

/* keep flex items behaving correctly on iOS Safari */
.socials, .social-link {
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translateZ(0); /* helps with rendering/overflow bugs on some iPhones */
}

/* responsive tweaks: keep socials visible on phones, make them stacked line-by-line */
@media (max-width: 420px) {
  body { padding: 12px; }

  .card-container {
    width: calc(100% - 24px);
    max-width: 380px;
    margin: 0 auto;
  }

  /* banner smaller on phones but fully visible */
  .banner img {
    height: 120px;
    object-position: center;
  }

  /* reduce profile size and overlap for mobile */
  .profile-section {
    margin-top: -48px;
    padding-top: 8px;
  }

  .profile-img {
    width: 90px;
    height: 90px;
    margin-top: -48px;
  }

  .logo-circle {
    top: 18px;
    right: 16px;
    width: 46px;
    height: 46px;
    border-width: 2px;
    z-index: 12;
  }

  /* contact actions: stack vertically, full width (fixed flex-direction) */
  .contact-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    align-items: stretch;
  }

  .contact-btn {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    padding: 12px 14px;
    box-sizing: border-box;
  }

  /* socials: stacked line-by-line under contact actions, full width with labels */
  .socials {
    margin: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    justify-content: flex-start;
  }

  .social-link {
    width: 100%;
    padding: 12px 14px;
    justify-content: flex-start;
    gap: 12px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .social-link i {
    font-size: 18px;
    width: 22px;
    text-align: center;
  }

  .social-text {
    display: inline-block;
    font-size: 14px;
  }

  /* keep save button visible and comfortable on mobile */
  .save-contact {
    display: inline-block;
    width: calc(100% - 40px);
    margin: 18px 20px;
    padding: 12px 18px;
    background: #555555; /* mobile override color */
    color: #fff;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255,122,0,0.18);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    -webkit-tap-highlight-color: transparent;
    animation: pulse 2.4s infinite;
    will-change: transform, box-shadow;
    transform: translateZ(0);
    -webkit-appearance: none;
  }

  .save-contact:hover {
    transform: scale(1.03);
    background: #e66a00;
    box-shadow: 0 12px 34px rgba(230,106,0,0.18);
  }

  .save-contact:active {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  }

  @keyframes pulse {
    0% { box-shadow: 0 8px 24px rgba(255,122,0,0.12); transform: scale(1); }
    50% { box-shadow: 0 18px 42px rgba(255,122,0,0.18); transform: scale(1.02); }
    100% { box-shadow: 0 8px 24px rgba(255,122,0,0.12); transform: scale(1); }
  }
  @-webkit-keyframes pulse {
    0% { -webkit-transform: scale(1); box-shadow: 0 8px 24px rgba(255,122,0,0.12); }
    50% { -webkit-transform: scale(1.02); box-shadow: 0 18px 42px rgba(255,122,0,0.18); }
    100% { -webkit-transform: scale(1); box-shadow: 0 8px 24px rgba(255,122,0,0.12); }
  }
}

/* 🔥 Animations */
.fade-in {
  animation: fade 1s ease-in-out;
  -webkit-animation: fade 1s ease-in-out;
}

.fade-in-delayed {
  animation: fade 1.5s ease-in-out;
  -webkit-animation: fade 1.5s ease-in-out;
}

.slide-up {
  animation: slideUp 0.9s ease;
  -webkit-animation: slideUp 0.9s ease;
}

.pulse {
  animation: pulse 2s infinite;
  -webkit-animation: pulse 2s infinite;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@-webkit-keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@-webkit-keyframes pulse {
  0% { -webkit-transform: scale(1); }
  50% { -webkit-transform: scale(1.03); }
  100% { -webkit-transform: scale(1); }
}