/* 
  ProfileCard CSS 
  Vanilla JS Port 
*/

.pc-card-wrapper {
  position: relative;
  width: 320px;
  height: 400px;
  max-width: 100%;
  border-radius: 24px;
  perspective: 1200px;
  transform-style: preserve-3d;
  
  --pointer-x: 50%;
  --pointer-y: 50%;
  --rotate-x: 0deg;
  --rotate-y: 0deg;
  --behind-glow-color: rgba(125, 190, 255, 0.67);
  --behind-glow-size: 50%;
  --inner-gradient: linear-gradient(145deg, #60496e8c 0%, #71C4FF44 100%);
}

/* Glow Behind */
.pc-behind {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--behind-glow-color) 0%, transparent 60%);
  opacity: 0.4;
  filter: blur(40px);
  transform: translateZ(-50px);
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.pc-card-wrapper.active .pc-behind {
  opacity: 0.8;
}

/* 3D Shell */
.pc-card-shell {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 24px;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  transform: rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
  will-change: transform;
}

/* Enter transition */
.pc-card-shell.entering {
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* The actual card */
.pc-card {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: var(--inner-gradient), rgba(30, 30, 35, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.05);
  transform-style: preserve-3d;
}

/* Shine effect */
.pc-shine {
  position: absolute;
  inset: -100%;
  background: radial-gradient(
    circle at var(--pointer-x) var(--pointer-y),
    rgba(255, 255, 255, 0.2) 0%,
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: overlay;
}

.pc-card-shell.active .pc-shine {
  opacity: 1;
}

.pc-inside {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Text to the bottom */
  z-index: 5;
  transform: translateZ(30px);
}

/* Avatar Background */
.pc-bg-avatar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Fill the whole card */
  object-fit: cover;
  object-position: center top; /* Center head at top */
  z-index: 1;
  /* Soft fade at the bottom to blend with text area */
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
  filter: contrast(1.1) brightness(0.9);
}

/* Effect Layer (Icon Pattern / Grain) */
.pc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.03) 75%, rgba(255,255,255,0.03)), 
    linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.03) 75%, rgba(255,255,255,0.03));
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  z-index: 0;
  pointer-events: none;
}

/* Bottom Text Details */
.pc-details {
  text-align: center;
  position: relative;
  z-index: 10;
  margin-bottom: 8px; /* Bottom margin */
}

.pc-details h3 {
  font-size: 1.6rem;
  color: #fff;
  margin: 0 0 4px 0;
  font-weight: 700;
  text-shadow: 0 2px 15px rgba(0,0,0,0.8); /* Stronger shadow for readability over image */
  letter-spacing: -0.5px;
}

.pc-details p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  margin: 0;
  font-weight: 500;
  text-shadow: 0 2px 15px rgba(0,0,0,0.8);
}

/* Play Overlay styling */
.pc-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10; /* Overlay above all card content layers */
  background: rgba(0, 0, 0, 0.35); /* Darken card slightly before playing */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
}

.pc-play-icon {
  width: 64px;
  height: 64px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(0.9);
}

.pc-play-icon svg {
  margin-left: 4px;
}

.pc-play-text {
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

/* Hover scales and brightens the play icon */
.pc-card-wrapper:hover .pc-play-icon {
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.85);
  border-color: #ffffff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.pc-card-wrapper:hover .pc-play-text {
  color: #ffffff;
  transform: translateY(1px);
}

/* Hide the overlay when the video is active and unmuted */
.pc-card-wrapper.is-playing .pc-play-overlay {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

