/**
 * Share Components CSS
 * FEAT-002: Save/Share Feature Styling
 */

/* Share Button Container */
.share-container {
  display: flex;
  justify-content: center;
  margin-top: var(--space-md, 1rem);
  margin-bottom: var(--space-md, 1rem);
}

/* Share Button */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: transparent;
  color: var(--primary, #0d6efd);
  border: 2px solid var(--primary, #0d6efd);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.share-btn:hover {
  background-color: var(--primary, #0d6efd);
  color: white;
}

.share-btn:active {
  transform: scale(0.98);
}

.share-btn:focus-visible {
  outline: 3px solid var(--primary, #0d6efd);
  outline-offset: 2px;
}

/* Share Icon */
.share-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Share Confirmation Toast */
.share-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #198754;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9375rem;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: calc(100% - 40px);
  text-align: center;
}

.share-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Error toast variant */
.share-toast.error {
  background-color: #dc3545;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .share-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    min-height: 48px; /* Touch target */
  }

  .share-toast {
    width: calc(100% - 40px);
    bottom: 16px;
    padding: 14px 20px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .share-toast {
    transition: opacity 0.1s ease;
    transform: translateX(-50%) translateY(0);
  }

  .share-toast:not(.show) {
    opacity: 0;
  }

  .share-btn {
    transition: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .share-btn {
    border-width: 3px;
  }

  .share-toast {
    border: 2px solid white;
  }
}
