/**
 * Gildrive Share Button — CSS-only hover reveal
 * Mirrors the React component behavior: button hides on hover, social links slide in
 * Uses Gildrive brand colors: dark navy primary, high contrast for readability
 */

.gildrive-share-wrapper {
  position: relative;
  display: inline-flex;
  font-family: inherit;
}

/* Main button — hides on wrapper hover, larger size for readability */
.gildrive-share-btn {
  position: relative;
  z-index: 1;
  min-width: 200px;        /* increased from 160px */
  padding: 0.75rem 2rem;  /* larger padding */
  border-radius: 9999px;
  background: #0f172a;     /* Gildrive title color: dark slate-950, used for headings */
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 300ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.gildrive-share-btn:hover,
.gildrive-share-btn:focus {
  background: #2563eb;     /* lighter navy on hover */
  outline: none;
}

/* Dark mode support via class on html/body */
.dark .gildrive-share-btn,
.gildrive-share-wrapper.dark .gildrive-share-btn {
  background: #0f172a;
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}

.dark .gildrive-share-btn:hover,
.gildrive-share-wrapper.dark .gildrive-share-btn:hover {
  background: #1e293b;     /* brighter slate-800 in dark mode */
}

.gildrive-share-btn__content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Links container — absolutely positioned, slides in on wrapper hover */
.gildrive-share-links {
  position: absolute;
  left: 0;
  top: 0;
  height: 50px;            /* increased from 40px (h-12) */
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 300ms ease, transform 300ms ease;
  z-index: 0;
  overflow: hidden;
  border-radius: 9999px;
  padding: 0 0.5rem;
}

/* Reveal on wrapper hover */
.gildrive-share-wrapper:hover .gildrive-share-links,
.gildrive-share-wrapper:focus-within .gildrive-share-links {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Hide main button when links are visible */
.gildrive-share-wrapper:hover .gildrive-share-btn,
.gildrive-share-wrapper:focus-within .gildrive-share-btn {
  opacity: 0;
}

/* Individual link buttons */
.gildrive-share-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;             /* increased from 40px */
  height: 50px;
  background: #fff;
  color: #1e3a8a;
  border: 0;
  border-right: 1px solid rgba(0,0,0,0.1);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 300ms ease;
  text-decoration: none;
  flex-shrink: 0;
}

.gildrive-share-link:last-child {
  border-right: 0;
  margin-left: 0.25rem;
}

.gildrive-share-link:hover {
  background: #e2e8f0;    /* light gray hover */
}

/* Dark mode links */
.dark .gildrive-share-link,
.gildrive-share-wrapper.dark .gildrive-share-link {
  background: #fff;
  color: #1e3a8a;
  border-right-color: rgba(0,0,0,0.1);
}

.dark .gildrive-share-link:hover,
.gildrive-share-wrapper.dark .gildrive-share-link:hover {
  background: #f3f4f6;
}

/* Rounded corners on first/last */
.gildrive-share-link--first {
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
}

.gildrive-share-link--last {
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
}

/* Staggered entrance animation */
.gildrive-share-link:nth-child(1) { transition-delay: 0ms; transition-duration: 200ms; }
.gildrive-share-link:nth-child(2) { transition-delay: 50ms; transition-duration: 200ms; }
.gildrive-share-link:nth-child(3) { transition-delay: 100ms; transition-duration: 200ms; }
.gildrive-share-link:nth-child(4) { transition-delay: 150ms; transition-duration: 200ms; }

/* Icon sizing */
.gildrive-share-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Focus states for accessibility */
.gildrive-share-btn:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #1e3a8a;
}

.dark .gildrive-share-btn:focus-visible,
.gildrive-share-wrapper.dark .gildrive-share-btn:focus-visible {
  box-shadow: 0 0 0 3px #000, 0 0 0 5px #fff;
}

.gildrive-share-link:focus-visible {
  outline: 2px solid #1e3a8a;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gildrive-share-links,
  .gildrive-share-btn,
  .gildrive-share-link {
    transition: none;
  }
}
