/**
 * Social Share Widget Styles
 * Version: 1.0.0
 */

/* ====================================
   Side Widget (Floating Square)
   ==================================== */

.social-share-widget-side {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  transition: all 0.3s ease;
  display: block;
}

.social-share-widget-side .share-toggle {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.social-share-widget-side .share-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.social-share-widget-side .share-toggle:active {
  transform: scale(0.95);
}

.social-share-widget-side .share-menu {
  position: absolute;
  right: 70px;
  top: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.3s ease;
  min-width: 160px;
}

.social-share-widget-side.open .share-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.social-share-widget-side .share-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #333;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.social-share-widget-side .share-button:hover {
  background: var(--platform-color);
  color: white;
  transform: translateX(-4px);
}

.social-share-widget-side .share-button svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* Dark theme for side widget */
.social-share-widget-side.theme-dark .share-menu {
  background: #1a1a2e;
  color: white;
}

.social-share-widget-side.theme-dark .share-button {
  color: #e0e0e0;
}

.social-share-widget-side.theme-dark .share-button:hover {
  color: white;
}

/* ====================================
   Center Widget (Inline)
   ==================================== */

.social-share-widget-center {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  max-width: 600px;
  margin: 0 auto;
}

.social-share-widget-center .share-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.social-share-widget-center .share-header svg {
  color: #667eea;
}

.social-share-widget-center .share-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.social-share-widget-center .share-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border: 2px solid #e0e0e0;
  background: white;
  color: #333;
  cursor: pointer;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  text-align: center;
}

.social-share-widget-center .share-button:hover {
  border-color: var(--platform-color);
  background: var(--platform-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-share-widget-center .share-button svg {
  width: 24px;
  height: 24px;
}

/* Dark theme for center widget */
.social-share-widget-center.theme-dark {
  background: #1a1a2e;
  color: white;
}

.social-share-widget-center.theme-dark .share-header {
  color: white;
}

.social-share-widget-center.theme-dark .share-button {
  background: #16213e;
  border-color: #2a3f5f;
  color: #e0e0e0;
}

.social-share-widget-center.theme-dark .share-button:hover {
  color: white;
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 768px) {
  .social-share-widget-side {
    right: 10px;
  }

  .social-share-widget-side .share-toggle {
    width: 48px;
    height: 48px;
  }

  .social-share-widget-side .share-menu {
    right: 60px;
    min-width: 140px;
  }

  .social-share-widget-center {
    padding: 16px;
    border-radius: 12px;
  }

  .social-share-widget-center .share-buttons {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
  }

  .social-share-widget-center .share-button {
    padding: 12px 8px;
    font-size: 12px;
  }

  .social-share-widget-center .share-button svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .social-share-widget-center .share-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ====================================
   Animations
   ==================================== */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.social-share-widget-side.open .share-menu .share-button {
  animation: slideIn 0.3s ease forwards;
}

.social-share-widget-side.open .share-menu .share-button:nth-child(1) {
  animation-delay: 0.05s;
}

.social-share-widget-side.open .share-menu .share-button:nth-child(2) {
  animation-delay: 0.1s;
}

.social-share-widget-side.open .share-menu .share-button:nth-child(3) {
  animation-delay: 0.15s;
}

.social-share-widget-side.open .share-menu .share-button:nth-child(4) {
  animation-delay: 0.2s;
}

.social-share-widget-side.open .share-menu .share-button:nth-child(5) {
  animation-delay: 0.25s;
}

.social-share-widget-side.open .share-menu .share-button:nth-child(6) {
  animation-delay: 0.3s;
}

/* ====================================
   Accessibility
   ==================================== */

.share-button:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.share-toggle:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .social-share-widget-side .share-menu,
  .social-share-widget-center {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .social-share-widget-side,
  .social-share-widget-side .share-menu,
  .social-share-widget-side .share-toggle,
  .share-button {
    transition: none;
    animation: none;
  }
}
