/**
 * FWP Infographic - Frontend Styles
 */

.infographic-container {
  position: relative;
  margin: 20px 0;
}

.infographic-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.infographic-share {
  margin-top: 15px;
  text-align: center;
}

/* Inline share buttons row */
.infographic-share-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.infographic-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.infographic-share-icon:hover {
  transform: scale(1.1);
  border-color: transparent;
}

.infographic-share-icon svg {
  display: block;
}

/* Platform colors on hover */
.infographic-share-icon.share-pinterest {
  color: #888;
}
.infographic-share-icon.share-pinterest:hover {
  background: #e60023;
  color: #fff;
}

.infographic-share-icon.share-facebook {
  color: #888;
}
.infographic-share-icon.share-facebook:hover {
  background: #1877f2;
  color: #fff;
}

.infographic-share-icon.share-twitter {
  color: #888;
}
.infographic-share-icon.share-twitter:hover {
  background: #000;
  color: #fff;
}

.infographic-share-icon.share-linkedin {
  color: #888;
}
.infographic-share-icon.share-linkedin:hover {
  background: #0a66c2;
  color: #fff;
}

.infographic-share-icon.share-more {
  color: #888;
  background: #fff;
}
.infographic-share-icon.share-more.infographic-share-btn {
  padding: 0;
  border-radius: 50%;
  background: #fff;
}
.infographic-share-icon.share-more:hover {
  background: #333;
  color: #fff;
}

/* Legacy share button (kept for modal trigger) */
.infographic-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.infographic-share-btn:hover {
  background: #555;
}

.infographic-caption {
  margin-top: 10px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.infographic-caption-text {
  display: block;
  font-style: italic;
  margin-bottom: 4px;
}

.infographic-attribution {
  display: block;
  font-size: 12px;
  font-style: normal;
  color: #888;
}

/* Lightbox trigger */
.infographic-lightbox-trigger {
  display: block;
  position: relative;
  cursor: zoom-in;
  text-decoration: none;
}

.infographic-lightbox-trigger:hover .infographic-zoom-hint {
  opacity: 1;
}

.infographic-zoom-hint {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.infographic-zoom-hint svg {
  display: block;
}

/* Lightbox Modal */
.infographic-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  overflow: auto;
  padding: 20px;
}

.infographic-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: background 0.2s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-close svg {
  display: block;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
}

/* Full-size image - no constraints, allows natural size with scrolling */
.lightbox-image {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  border-radius: 4px;
  cursor: grab;
}

.lightbox-image:active {
  cursor: grabbing;
}

.lightbox-caption {
  color: #fff;
  margin-top: 15px;
  text-align: center;
  font-size: 14px;
  max-width: 600px;
  position: sticky;
  bottom: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 6px;
}

/* Share Modal */
.infographic-share-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.infographic-share-modal {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.infographic-share-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.infographic-share-modal-close:hover {
  color: #333;
}

.infographic-share-modal h3 {
  margin: 0 0 20px;
  font-size: 20px;
  text-align: center;
}

.infographic-share-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.share-btn:hover {
  background: #f5f5f5;
  border-color: #bbb;
}

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

.share-facebook { color: #1877f2; }
.share-twitter { color: #000; }
.share-pinterest { color: #e60023; }
.share-linkedin { color: #0a66c2; }

.infographic-share-link {
  display: flex;
  gap: 10px;
}

.infographic-share-link input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

.copy-link-btn {
  padding: 10px 15px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.copy-link-btn:hover {
  background: #555;
}

/* Toast notifications */
.infographic-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100000;
  animation: toast-in 0.3s ease;
}

.infographic-toast-success {
  background: #047857;
  color: #fff;
}

.infographic-toast-error {
  background: #dc2626;
  color: #fff;
}

.infographic-toast.fade-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}
