/* Modern Social Media Floating Bar (Refined & Responsive) */

/* Base container styles (Desktop/Wide View) */
.csfb-container {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px; /* Slightly reduced gap */
  padding: 12px 0 12px 6px; /* Optimized padding */
  background: rgba(255, 255, 255, 0.88);
  border-radius: 0 10px 10px 0;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  /* Keeping blur for modern look, but be aware it is performance-intensive */
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Smoother, simpler transition */
  transition: all 0.3s ease-in-out;
}

.csfb-container:hover {
  padding-left: 10px;
  background: rgba(255, 255, 255, 0.98);
}

/* Icon base styles */
.csfb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; /* Slightly larger for better touch target */
  height: 48px;
  color: white;
  text-decoration: none;
  margin: 0 5px;
  font-size: 22px;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.0); /* Enhanced transition curve */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.csfb-icon i {
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

/* Gloss effect on icon */
.csfb-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Simplified gradient for lighter CSS */
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3));
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Individual icon colors with gradient enhancements (kept original logic) */
.csfb-icon.fb {
  background: linear-gradient(135deg, #3b5998, #4c70ba);
}
.csfb-icon.tw {
  background: linear-gradient(135deg, #1da1f2, #0096f2);
}
.csfb-icon.ig {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.csfb-icon.li {
  background: linear-gradient(135deg, #0077b5, #00a0dc);
}
.csfb-icon.yt {
  background: linear-gradient(135deg, #ff0000, #e62117);
}
.csfb-icon.pin {
  background: linear-gradient(135deg, #bd081c, #e60023);
}

/* Icon Hover effects (Proper/Enhanced) */
.csfb-icon:hover {
  /* Slightly more pronounced movement and scale */
  transform: translateX(10px) scale(1.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  filter: brightness(1.1); /* Subtle brightness boost */
}

.csfb-icon:hover::before {
  opacity: 1;
}

.csfb-icon:hover i {
  transform: scale(1.15); /* Slightly smaller inner scale */
}

/* Tooltip on hover */
.csfb-icon::after {
  content: attr(aria-label);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: #222; /* Darker tooltip for contrast */
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease-in-out;
  margin-left: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.csfb-icon:hover::after {
  opacity: 1;
  margin-left: 25px; /* Pushes tooltip further out */
}

/* --- Responsive Design --- */

/* Medium Screens (Laptops/Large Tablets: up to 1024px) */
@media (max-width: 1024px) {
  .csfb-container {
    gap: 8px;
    padding: 10px 0 10px 4px;
  }
  .csfb-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
    margin: 0 4px;
  }
}

/* Small Screens (Tablets/Mobile: up to 768px) */
@media (max-width: 768px) {
  .csfb-container {
    /* Aggressively hide the bar to save screen space */
    transform: translate(-90%, -50%);
    gap: 7px;
    padding: 8px 0 8px 3px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  }

  .csfb-container:hover {
    /* Pull back fully on hover/tap */
    transform: translate(0, -50%);
    padding-left: 8px;
  }

  .csfb-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin: 0 3px;
  }

  /* Reduce hover effect for touch devices, prevent excessive translation */
  .csfb-icon:hover {
    transform: translateX(0) scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  }

  /* Disable tooltips on small screens to prevent layout shifting */
  .csfb-icon::after {
    display: none;
  }
}
