/* Share Modal Styles */

/* Modal overlay and container */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.share-modal.active {
  display: flex;
}

/* Backdrop overlay */
.share-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

/* Modal content container */
.share-modal-content {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
  border-radius: 20px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.25),
    0 10px 30px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.4s ease;
  border: 1px solid rgba(76, 175, 80, 0.1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Close button */
.share-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  line-height: 1;
}

.share-modal-close:hover {
  background: #e0e0e0;
  color: #333;
  transform: rotate(90deg);
}

/* Modal header */
.share-modal-content h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  text-align: center;
}

.share-modal-subtitle {
  text-align: center;
  color: var(--light-text);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Share preview area */
.share-preview {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ddd;
}

#share-preview-image {
  max-width: 100%;
  border-radius: 8px;
}

#share-preview-image img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-preview-loading {
  color: var(--light-text);
  font-size: 0.9rem;
}

/* Platform share buttons grid */
.share-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.share-platform-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f5f5f5;
  color: #333;
}

.share-platform-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-platform-btn:active {
  transform: translateY(0);
}

/* Platform-specific colors */
.share-platform-btn[data-platform="linkedin"] {
  background: linear-gradient(135deg, #0077B5 0%, #0088cc 100%);
  color: white;
}

.share-platform-btn[data-platform="linkedin"]:hover {
  background: linear-gradient(135deg, #006699 0%, #0077B5 100%);
}

.share-platform-btn[data-platform="twitter"] {
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: white;
}

.share-platform-btn[data-platform="twitter"]:hover {
  background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
}

.share-platform-btn[data-platform="instagram"] {
  background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCAF45 100%);
  color: white;
}

.share-platform-btn[data-platform="instagram"]:hover {
  opacity: 0.9;
}

.share-platform-btn[data-platform="email"] {
  background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
  color: white;
}

.share-platform-btn[data-platform="email"]:hover {
  background: linear-gradient(135deg, #43A047 0%, #7CB342 100%);
}

/* Share icon styling */
.share-icon {
  font-size: 1.1rem;
  font-weight: bold;
}

/* Divider */
.share-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.share-divider::before,
.share-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.share-divider span {
  padding: 0 1rem;
  color: var(--light-text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Share link section */
.share-link-section {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#share-link-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-color);
  background: #fafafa;
  transition: all 0.3s ease;
}

#share-link-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
}

/* Small button variant */
.btn-small {
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Download button */
.download-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* Success state for copy button */
.btn-success {
  background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%) !important;
}

/* Responsive styles */
@media (max-width: 480px) {
  .share-modal-content {
    padding: 1.5rem;
    border-radius: 16px;
    margin: 0.5rem;
  }

  .share-modal-content h3 {
    font-size: 1.25rem;
    padding-right: 2rem;
  }

  .share-buttons-grid {
    grid-template-columns: 1fr;
  }

  .share-platform-btn {
    padding: 1rem;
  }

  .share-link-section {
    flex-direction: column;
  }

  #share-link-input {
    width: 100%;
  }

  .btn-small {
    width: 100%;
  }

  .share-modal-close {
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
  }
}

/* Animation for modal exit */
.share-modal.closing .share-modal-content {
  animation: modalSlideOut 0.3s ease forwards;
}

.share-modal.closing .share-modal-overlay {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Loading state for buttons */
.share-platform-btn.loading {
  position: relative;
  pointer-events: none;
}

.share-platform-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Instagram instructions tooltip */
.instagram-tooltip {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--light-text);
  border-left: 3px solid #833AB4;
}

.instagram-tooltip strong {
  color: var(--text-color);
}

