/* Profile Card Component */
:root {
  --pointer-x: 50%;
  --pointer-y: 50%;
  --pointer-from-center: 0;
  --pointer-from-top: 0.5;
  --pointer-from-left: 0.5;
  --card-opacity: 0;
  --rotate-x: 0deg;
  --rotate-y: 0deg;
  --background-x: 50%;
  --background-y: 50%;
}

.profile-card-container {
  position: relative;
  width: 320px;
  height: 480px;
  margin: 20px auto;
  perspective: 500px;
  transform: translate3d(0, 0, 0.1px);
  touch-action: none;
}

/* Universal neon blue glow - smoothly glows up on hover */
.profile-card-container::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: radial-gradient(ellipse at center, var(--glow-color) 0%, var(--shadow-light) 40%, transparent 70%);
  border-radius: 32px;
  transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  filter: blur(15px);
  transform: scale(1.0) translate3d(0, 2px, 0);
  opacity: 0.5;
  z-index: 0;
}

.profile-card-container:hover::before {
  transform: scale(1.08) translate3d(0, 6px, 0);
  filter: blur(30px);
  background: radial-gradient(ellipse at center, var(--glow-color) 0%, var(--shadow-strong) 30%, var(--shadow-color) 50%, transparent 80%);
  opacity: 1;
}

.profile-card {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x));
  transition: transform 0.1s linear, 
              box-shadow 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
              background 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);

  /* Balatro-style subtle oscillating animation */
  animation: balatro-float 8s ease-in-out infinite;
  animation-play-state: running;

  /* Universal background gradients - work for both themes */
  background: 
    linear-gradient(135deg, 
      var(--bg-tertiary) 0%, 
      var(--bg-secondary) 25%, 
      var(--bg-primary) 50%, 
      var(--bg-secondary) 75%, 
      var(--bg-tertiary) 100%);

  backdrop-filter: blur(8px) saturate(1.1);

  /* Enhanced shadow with depth */
  box-shadow: 
    0 25px 50px -12px var(--glow-color),
    0 8px 16px -4px var(--shadow-color),
    0 0 20px var(--glow-color),
    0 0 0 1px var(--border-color),
    inset 0 1px 0 var(--hover-overlay),
    inset 0 -1px 0 var(--shadow-light),
    var(--shadow-color) calc((var(--pointer-from-left) * 6px) - 3px) calc((var(--pointer-from-top) * 12px) - 6px) 20px -4px;
}

/* Universal RGB holographic effect - works on both light and dark themes */
.profile-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: 
    conic-gradient(from calc(var(--pointer-from-left) * 360deg + 90deg) at var(--pointer-x) var(--pointer-y), 
      var(--accent-primary) 0deg,
      var(--accent-secondary) 60deg,
      var(--accent-tertiary) 120deg,
      var(--accent-primary) 180deg,
      var(--accent-secondary) 240deg,
      var(--accent-tertiary) 300deg,
      var(--accent-primary) 360deg),
    linear-gradient(calc(var(--pointer-from-left) * 180deg + 45deg), 
      transparent 0%, 
      var(--hover-overlay) 45%, 
      var(--active-overlay) 50%, 
      var(--hover-overlay) 55%, 
      transparent 100%),
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), 
      var(--hover-overlay) 0%, 
      var(--shadow-light) 25%, 
      transparent 70%);
  background-size: 200% 200%, 300% 300%, 150% 150%;
  mix-blend-mode: var(--holo-blend-mode);
  opacity: calc(0.3 + var(--card-opacity) * 0.6);
  transition: opacity 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), 
              background 0.1s linear;
  z-index: 2;
  pointer-events: none;
}

/* Balatro-style floating animation */
@keyframes balatro-float {
  0% {
    transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x)) translateY(0px) rotate(0deg);
  }
  25% {
    transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x)) translateY(-2px) rotate(0.5deg);
  }
  50% {
    transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x)) translateY(-1px) rotate(0deg);
  }
  75% {
    transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x)) translateY(-3px) rotate(-0.5deg);
  }
  100% {
    transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x)) translateY(0px) rotate(0deg);
  }
}

/* Floating coding elements - universal */
.profile-card .floating-element {
  position: absolute;
  z-index: 3;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--text-secondary);
  text-shadow: 0 0 8px var(--shadow-light);
  pointer-events: none;
  user-select: none;
}

.profile-card .floating-element:nth-child(1) {
  top: 15%;
  left: 10%;
  animation-delay: 0s;
}

.profile-card .floating-element:nth-child(2) {
  top: 70%;
  right: 15%;
  animation-delay: 2s;
}

.profile-card .floating-element:nth-child(3) {
  top: 40%;
  right: 8%;
  animation-delay: 4s;
}

.profile-card .floating-element:nth-child(4) {
  bottom: 30%;
  left: 5%;
  animation-delay: 1s;
}

.profile-card:hover .floating-element {
  color: var(--text-primary);
  text-shadow: 
    0 0 12px var(--glow-color),
    0 0 4px var(--shadow-color);
  transform: scale(1.05);
}

.profile-card:hover {
  --card-opacity: 1;
  animation-play-state: paused;
  transition: transform 0.1s linear, 
              box-shadow 0.4s cubic-bezier(0.4, 0.0, 0.2, 1),
              background 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x));

  /* Enhanced hover shadows with brighter glow */
  box-shadow: 
    0 35px 70px -15px var(--shadow-strong),
    0 15px 30px -8px var(--shadow-color),
    0 0 60px var(--glow-color),
    0 0 120px var(--shadow-color),
    0 0 180px var(--shadow-light),
    0 0 0 1px var(--border-strong),
    inset 0 1px 0 var(--hover-overlay),
    inset 0 -1px 0 var(--shadow-color),
    var(--glow-color) calc((var(--pointer-from-left) * 10px) - 5px) calc((var(--pointer-from-top) * 20px) - 10px) 35px -8px;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
    opacity: 0.4;
  }
  25% {
    transform: translateY(-8px) translateX(3px);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-4px) translateX(-5px);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-12px) translateX(2px);
    opacity: 0.8;
  }
}

/* Card content */
.profile-card-content {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  width: 100%;
}

/* Profile header */
.profile-header {
  text-align: center;
  margin-bottom: 24px;
}

.profile-name {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  text-shadow: var(--text-shadow);
}

.profile-title {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
}

/* Avatar section */
.profile-avatar {
  width: 200px;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  margin: 24px 0;
  border: 2px solid var(--border-color);
  box-shadow: 0 8px 24px var(--shadow-color);
  position: relative;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.profile-card:hover .profile-avatar img {
  transform: scale(1.05);
}

/* Footer section */
.profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px 20px;
  margin-top: auto;
  border: 1px solid var(--border-color);
}

.profile-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.profile-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-handle {
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.profile-status {
  font-family: 'VT323', monospace;
  font-size: 0.8rem;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--glow-color);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.profile-instagram-btn {
  width: 48px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary), var(--accent-primary));
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.profile-instagram-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 6px 20px var(--glow-color),
    0 0 20px var(--shadow-color);
  border-color: var(--border-strong);
}

.profile-instagram-btn canvas {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}

/* Responsive design */
@media (max-width: 768px) {
  .profile-card-container {
    width: 280px;
    height: 420px;
  }

  .profile-card {
    padding: 24px 20px 20px;
  }

  .profile-avatar {
    width: 160px;
    height: 200px;
    margin: 20px 0;
  }

  .profile-name {
    font-size: 1.6rem;
  }

  .profile-title {
    font-size: 1rem;
  }
}
