.floating-portfolio-container {
  position: fixed;
  z-index: 9999;
  display: flex;
  align-items: center;
  /* Initial position will be set by JavaScript */
  top: 20%;
  left: 10%;
  /* Smooth movement transition */
  transition: all 25s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  transform: translateZ(0);
  will-change: transform;
}

.floating-portfolio-btn {
  background: linear-gradient(135deg, #ff6a00, #ee0979);
  color: #fff;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Segoe UI', sans-serif;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  /* Continuous subtle pulse */
  animation: pulse 2s infinite ease-in-out;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: none;
  cursor: pointer;
  z-index: 1;
}

.btn-hover-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

/* Shine effect */
.floating-portfolio-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.3) 45%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 4s infinite;
  z-index: -1;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(30deg); }
  20% { transform: translateX(100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}

.floating-portfolio-btn:hover {
  background: linear-gradient(135deg, #8f94fb, #4e54c8);
  transform: translateY(-2px) scale(1.05);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.floating-portfolio-btn:hover::before {
  animation: shine 1.5s infinite;
}

.floating-portfolio-btn:hover .btn-hover-effect {
  opacity: 1;
}

.close-portfolio-btn {
  background: #ff4757;
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 12px;
  opacity: 1;
  transform: scale(1);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.close-hover-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.close-portfolio-btn .close-text {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  transition: all 0.3s ease;
  font-family: 'Segoe UI', sans-serif;
  font-weight: bold;
}

.close-portfolio-btn:hover {
  background: #ff6b81;
  transform: scale(1.1) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.close-portfolio-btn:hover .close-hover-effect {
  opacity: 1;
}

.close-portfolio-btn.closing {
  width: 120px;
  border-radius: 50px;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
}

.close-portfolio-btn.closing .fa-times {
  opacity: 0;
  transform: scale(0);
}

.close-portfolio-btn.closing .close-text {
  font-size: 14px;
  animation: textFade 1.5s infinite;
}

@keyframes textFade {
  0% { opacity: 0.5; transform: translateY(0); }
  25% { transform: translateY(-3px); }
  50% { opacity: 1; }
  75% { transform: translateY(0); }
  100% { opacity: 0.5; }
}

.sad-emoji {
  position: absolute;
  right: 8px;
  animation: emojiFade 1.5s infinite;
}

@keyframes emojiFade {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.5); }
}

/* Pulse animation */
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(142, 68, 173, 0.7); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(142, 68, 173, 0); }
}

/* Hidden state */
.floating-portfolio-container.hidden {
  opacity: 0;
  transform: scale(0);
  transition: all 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  pointer-events: none;
}

.btn-text {
  transition: all 0.3s ease;
  position: relative;
}

/* Prevent movement on hover */
.floating-portfolio-container:hover {
  transition-duration: 100s !important;
}

/* Confetti effect */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f00;
  opacity: 0;
  z-index: 10;
}

/* Bounce animation for the button */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.floating-portfolio-btn.bounce {
  animation: bounce 0.8s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .floating-portfolio-btn {
    padding: 12px 18px;
    font-size: 14px;
  }
  
  .close-portfolio-btn {
    width: 32px;
    height: 32px;
  }
}