/**
 * SIAMAQ · Social Share Widget Styles
 * Super animated, beautiful social sharing cards for Articles & Projects
 */

.siamaq-share-card {
  position: relative;
  margin: 36px 0;
  padding: 28px 30px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.siamaq-share-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ea580c 0%, #25d366 25%, #0a66c2 50%, #e1306c 75%, #1877f2 100%);
  opacity: 0.9;
}

.siamaq-share-card:hover {
  box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
  border-color: rgba(203, 213, 225, 0.9);
}

.siamaq-share-card.is-compact {
  padding: 20px 22px;
  margin: 24px 0;
}

/* Header */
.share-card-header {
  margin-bottom: 18px;
}

.share-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px;
  border-radius: 9999px;
  background: rgba(234, 88, 12, 0.1);
  border: 1px solid rgba(234, 88, 12, 0.22);
  margin-bottom: 10px;
}

.share-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ea580c;
  box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
  animation: shareDotPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes shareDotPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(234, 88, 12, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
  }
}

.share-badge-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c2410c;
}

.share-card-title {
  font-size: 19px;
  font-weight: 750;
  color: var(--text-primary, #0f172a);
  margin: 0 0 4px;
  line-height: 1.3;
}

.share-card-sub {
  font-size: 13.5px;
  color: var(--text-muted, #64748b);
  margin: 0;
  line-height: 1.45;
}

/* 50-word Snippet Preview */
.share-preview-snippet {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(241, 245, 249, 0.8);
  border-left: 3px solid #ea580c;
}

.share-snippet-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.share-snippet-label svg {
  width: 13px;
  height: 13px;
  color: #ea580c;
}

.share-snippet-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: #334155;
  margin: 0;
  font-style: italic;
}

/* Grid of Buttons */
.share-buttons-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

/* Base button */
.social-share-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, filter 0.22s ease;
  user-select: none;
  font-family: inherit;
  text-align: left;
}

.social-share-btn:hover {
  transform: translateY(-3px) scale(1.02);
}

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

.share-btn-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-share-btn:hover .share-btn-icon {
  transform: scale(1.15) rotate(-6deg);
}

.share-btn-icon svg {
  width: 18px;
  height: 18px;
}

.share-btn-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.share-btn-label strong {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-btn-label small {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Glow reflection sweep */
.share-btn-glow {
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.social-share-btn:hover .share-btn-glow {
  opacity: 1;
  animation: shareGlowSweep 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes shareGlowSweep {
  0% {
    left: -60%;
  }
  100% {
    left: 130%;
  }
}

/* Individual Platform Themes */

/* 1. WhatsApp */
.social-share-btn.is-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px -3px rgba(37, 211, 102, 0.4);
}

.social-share-btn.is-whatsapp:hover {
  box-shadow: 0 10px 24px -4px rgba(37, 211, 102, 0.55);
}

/* 2. LinkedIn */
.social-share-btn.is-linkedin {
  background: linear-gradient(135deg, #0a66c2 0%, #004182 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px -3px rgba(10, 102, 194, 0.4);
}

.social-share-btn.is-linkedin:hover {
  box-shadow: 0 10px 24px -4px rgba(10, 102, 194, 0.55);
}

/* 3. Facebook */
.social-share-btn.is-facebook {
  background: linear-gradient(135deg, #1877f2 0%, #0c56b8 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 14px -3px rgba(24, 119, 242, 0.4);
}

.social-share-btn.is-facebook:hover {
  box-shadow: 0 10px 24px -4px rgba(24, 119, 242, 0.55);
}

/* 4. Instagram */
.social-share-btn.is-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  background-size: 200% 200%;
  color: #ffffff !important;
  box-shadow: 0 4px 14px -3px rgba(220, 39, 67, 0.45);
  animation: instaGradientSlow 6s ease infinite;
}

@keyframes instaGradientSlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.social-share-btn.is-instagram:hover {
  box-shadow: 0 10px 24px -4px rgba(204, 35, 102, 0.6);
  animation: instaGradientFast 1.5s ease infinite;
}

@keyframes instaGradientFast {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 5. Copiar Enlace */
.social-share-btn.is-copy {
  background: #ffffff;
  color: #0f172a !important;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.08);
}

.social-share-btn.is-copy .share-btn-icon {
  background: #f1f5f9;
  color: #ea580c;
}

.social-share-btn.is-copy .icon-check {
  display: none;
}

.social-share-btn.is-copy:hover {
  border-color: #ea580c;
  box-shadow: 0 8px 20px -3px rgba(234, 88, 12, 0.25);
}

.social-share-btn.is-copy.is-copied {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46 !important;
}

.social-share-btn.is-copy.is-copied .icon-clipboard {
  display: none;
}

.social-share-btn.is-copy.is-copied .icon-check {
  display: inline-block;
  color: #10b981;
}

.social-share-btn.is-copy.is-copied .copy-text-default {
  display: none;
}

.social-share-btn.is-copy.is-copied .copy-text-success {
  display: inline !important;
}

/* Floating Toast Notification */
.share-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(80px) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease;
}

.share-toast.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.share-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  flex-shrink: 0;
}

.share-toast-icon svg {
  width: 16px;
  height: 16px;
}

/* Dark Mode Overrides */
[data-theme="dark"] .siamaq-share-card {
  background: linear-gradient(135deg, rgba(28, 33, 40, 0.95) 0%, rgba(22, 27, 34, 0.95) 100%);
  border-color: rgba(52, 60, 71, 0.9);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .siamaq-share-card:hover {
  border-color: rgba(92, 103, 118, 0.9);
}

[data-theme="dark"] .share-card-badge {
  background: rgba(234, 88, 12, 0.18);
  border-color: rgba(234, 88, 12, 0.35);
}

[data-theme="dark"] .share-badge-text {
  color: #fb923c;
}

[data-theme="dark"] .share-card-title {
  color: #f0f6fc;
}

[data-theme="dark"] .share-card-sub {
  color: #8b949e;
}

[data-theme="dark"] .share-preview-snippet {
  background: rgba(15, 23, 42, 0.6);
  border-left-color: #fb923c;
}

[data-theme="dark"] .share-snippet-label {
  color: #94a3b8;
}

[data-theme="dark"] .share-snippet-text {
  color: #cbd5e1;
}

[data-theme="dark"] .social-share-btn.is-copy {
  background: #1f242c;
  color: #f0f6fc !important;
  border-color: #343c47;
}

[data-theme="dark"] .social-share-btn.is-copy .share-btn-icon {
  background: #2a313c;
  color: #fb923c;
}

[data-theme="dark"] .social-share-btn.is-copy.is-copied {
  background: #064e3b;
  border-color: #10b981;
  color: #a7f3d0 !important;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .share-buttons-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .siamaq-share-card {
    padding: 22px 20px;
    margin: 28px 0;
  }
  .share-buttons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .social-share-btn {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .share-buttons-grid {
    grid-template-columns: 1fr;
  }
  .share-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-pulse-dot,
  .social-share-btn,
  .share-btn-glow,
  .share-btn-icon,
  .social-share-btn.is-instagram,
  .share-toast {
    animation: none !important;
    transition: none !important;
  }
}

