/* SPECTRA Share Block Styles */
.spectra-share-block {
  position: relative;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Common styles for all share items */
.spectra-share-block .share-icon {
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.spectra-share-block .share-text {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  margin-left: 6px;
  vertical-align: middle;
}

/* Share item base styles */
.spectra-share-block .share-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.spectra-share-block .share-item:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* Button style */
.spectra-share-block[data-share-style="buttons"] .share-item {
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #495057;
  margin-right: 8px;
  margin-bottom: 4px;
}

.spectra-share-block[data-share-style="buttons"] .share-item:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
}

/* Button sizes */
.spectra-share-block[data-button-size="small"] .share-item {
  padding: 4px 8px;
  font-size: 12px;
}

.spectra-share-block[data-button-size="small"] .share-icon {
  width: 14px;
  height: 14px;
}

.spectra-share-block[data-button-size="medium"] .share-item {
  padding: 8px 12px;
  font-size: 14px;
}

.spectra-share-block[data-button-size="medium"] .share-icon {
  width: 16px;
  height: 16px;
}

.spectra-share-block[data-button-size="large"] .share-item {
  padding: 12px 16px;
  font-size: 16px;
}

.spectra-share-block[data-button-size="large"] .share-icon {
  width: 20px;
  height: 20px;
}

/* Links style */
.spectra-share-block[data-share-style="links"] .share-item {
  padding: 4px 8px;
  color: #6b7280;
  margin-right: 12px;
}

.spectra-share-block[data-share-style="links"] .share-item:hover {
  color: #374151;
  background-color: #f3f4f6;
}

/* Icons only style */
.spectra-share-block[data-share-style="icons"] .share-item {
  padding: 8px;
  color: #6b7280;
  margin-right: 4px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

.spectra-share-block[data-share-style="icons"] .share-item:hover {
  color: #374151;
  background-color: #f3f4f6;
}

.spectra-share-block[data-share-style="icons"] .share-text {
  display: none;
}

/* Platform-specific colors */
.spectra-share-block .share-facebook:hover {
  background-color: #1877f2;
  color: white;
  border-color: #1877f2;
}

.spectra-share-block .share-twitter:hover {
  background-color: #1da1f2;
  color: white;
  border-color: #1da1f2;
}

.spectra-share-block .share-linkedin:hover {
  background-color: #0077b5;
  color: white;
  border-color: #0077b5;
}

.spectra-share-block .share-pinterest:hover {
  background-color: #BD081C;
  color: white;
  border-color: #BD081C;
}

.spectra-share-block .share-copy-link:hover {
  background-color: #6b7280;
  color: white;
  border-color: #6b7280;
}

.spectra-share-block .share-embed-code:hover {
  background-color: #8b5cf6;
  color: white;
  border-color: #8b5cf6;
}

.spectra-share-block .share-spectra-page:hover {
  background-color: #10b981;
  color: white;
  border-color: #10b981;
}

/* Dropdown style */
.spectra-share-block[data-share-style="dropdown"] .share-dropdown {
  position: relative;
}

.spectra-share-block[data-share-style="dropdown"] .share-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: all 0.2s ease;
  min-width: 100px;
}

.spectra-share-block[data-share-style="dropdown"] .share-toggle:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.spectra-share-block[data-share-style="dropdown"] .share-toggle:focus {
  outline: none;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.spectra-share-block[data-share-style="dropdown"] .dropdown-arrow {
  transition: transform 0.2s ease;
  margin-left: auto;
}

.spectra-share-block[data-share-style="dropdown"] .share-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 4px;
  min-width: 200px;
}

.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-link,
.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #374151;
  text-decoration: none;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f3f4f6;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-link:last-child,
.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-action:last-child {
  border-bottom: none;
}

.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-link:hover,
.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-action:hover {
  background-color: #f9fafb;
}

.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-link:focus,
.spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu .share-action:focus {
  outline: none;
  background-color: #eff6ff;
}

/* Share items layout */
.spectra-share-block .share-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.spectra-share-block .share-social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.spectra-share-block .share-additional-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid #e5e7eb;
}

/* Modal styles */
.spectra-share-block .share-embed-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.spectra-share-block .modal-content {
  background: white;
  border-radius: 8px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
}

.spectra-share-block .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.spectra-share-block .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.spectra-share-block .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.spectra-share-block .modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.spectra-share-block .modal-body {
  padding: 20px;
}

.spectra-share-block .embed-code-textarea {
  width: 100%;
  height: 120px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  background: #f8f9fa;
  resize: vertical;
  margin: 12px 0;
}

.spectra-share-block .modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.spectra-share-block .button {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f8f9fa;
  color: #374151;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.spectra-share-block .button--primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.spectra-share-block .button--primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.spectra-share-block .button--secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

/* Success/Error states for copy buttons */
.spectra-share-block .share-copy-success {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  color: white !important;
}

.spectra-share-block .share-copy-error {
  background-color: #ef4444 !important;
  border-color: #ef4444 !important;
  color: white !important;
}

/* Error message */
.spectra-share-block-error {
  color: #ef4444;
  font-style: italic;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Keep horizontal layout on mobile - icons stay in a single row like desktop */
  .spectra-share-block .share-items {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px; /* Slightly smaller gap for mobile */
  }

  .spectra-share-block .share-social-links,
  .spectra-share-block .share-additional-options {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-left: 6px; /* Smaller margin for mobile */
    padding-left: 6px;
    border-left: 1px solid #e5e7eb;
    padding-top: 0;
    margin-top: 0;
  }

  /* Adjust button and link sizes for mobile but keep horizontal layout */
  .spectra-share-block[data-share-style="buttons"] .share-item,
  .spectra-share-block[data-share-style="links"] .share-item {
    margin-right: 6px; /* Smaller margin for mobile */
    margin-bottom: 4px;
    flex-shrink: 1; /* Allow items to shrink if needed */
  }

  .spectra-share-block[data-share-style="dropdown"] .share-dropdown-menu {
    left: -50px;
    right: -50px;
  }

  .spectra-share-block .modal-content {
    width: 95%;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  .spectra-share-block[data-share-style="icons"] .share-item {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .spectra-share-block[data-share-style="icons"] .share-icon {
    width: 14px;
    height: 14px;
  }
}

/* Animation for smooth transitions */
.spectra-share-block * {
  box-sizing: border-box;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .spectra-share-block * {
    transition: none !important;
    animation: none !important;
  }
}

/* High contrast mode support - Enhanced borders and focus */
.spectra-share-block .share-item {
  border-width: 1px;
}

.spectra-share-block .share-item:focus {
  outline-width: 2px;
}
