/* Highlight Sharing Styles */

.highlight-share-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--share-backdrop-color, rgba(0, 0, 0, 0.75));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.highlight-share-modal.active {
  opacity: 1;
  visibility: visible;
}

.highlight-share-card-container {
  width: min(92vw, 560px);
  max-height: min(94vh, 920px);
  background: var(--share-ui-bg, #fffdf9);
  border: 1px solid var(--share-ui-border, rgba(139, 92, 246, 0.12));
  color: var(--share-ui-text, #333333);
  border-radius: 18px;
  box-shadow: var(--share-ui-shadow, 0 18px 48px rgba(0, 0, 0, 0.28));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.highlight-share-preview {
  height: clamp(280px, 56vh, 520px);
  flex: 0 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.highlight-share-capture-shell {
  border-radius: 10px;
  border: 1px solid rgba(180, 150, 100, 0.18);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-share-card-canvas {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  position: relative;
  width: 360px;
  height: 360px;
  color: var(--share-text-color, #333);
  box-sizing: border-box;
  overflow: hidden;
  padding: 40px;
}

.highlight-share-card-canvas.highlight-share-card-story {
  width: 360px;
  height: 640px;
  padding: 44px 36px;
}

.highlight-share-card-canvas.highlight-share-card-capture {
  border-radius: 0;
  box-shadow: none;
}

.highlight-share-card-header {
  align-items: center;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.highlight-share-card-story .highlight-share-card-header {
  margin-top: 4px;
  margin-bottom: 12px;
}

.highlight-share-wisdom-title {
  font-family: 'Palatino', 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 14px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--share-header-color, #555);
  text-align: center;
}

.highlight-share-header-line {
  width: 60px;
  height: 1px;
  background-color: var(--share-header-line-color, rgba(85, 85, 85, 0.2));
}

.highlight-share-quote-mark {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 0;
}

.highlight-share-card-story .highlight-share-quote-mark {
  top: 16px;
  left: 16px;
}

.highlight-share-quote-mark svg path {
  stroke: var(--share-quote-mark-color, rgba(0, 0, 0, 0.08));
}

.highlight-share-quote-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-share-card-story .highlight-share-quote-container {
  padding-bottom: 8px;
}

.highlight-share-quote-text {
  font-family: 'Palatino', 'Palatino Linotype', 'Book Antiqua', serif;
  color: var(--share-text-color, #333);
  text-align: center;
  width: 100%;
  padding: 0 4px;
  margin: 0;
  z-index: 1;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  display: block;
  overflow: visible;
  text-overflow: clip;
}

.highlight-share-attribution {
  align-items: center;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}

.highlight-share-card-story .highlight-share-attribution {
  margin-top: 10px;
}

.highlight-share-attribution-line {
  width: 40px;
  height: 1px;
  margin-bottom: 10px;
  background-color: var(--share-attribution-line-color, rgba(85, 85, 85, 0.2));
}

.highlight-share-mentor {
  font-family: 'Palatino', 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  text-align: center;
  letter-spacing: 0.3px;
  margin: 0;
  color: var(--share-attribution-text-color, #555);
}

.highlight-share-footer-brand {
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.highlight-share-card-story .highlight-share-footer-brand {
  bottom: 14px;
  right: 14px;
}

.highlight-share-logo {
  width: 25px;
  height: 25px;
  opacity: 0.7;
  object-fit: contain;
}

.highlight-share-style-picker {
  padding: 8px 0 14px;
  display: flex;
  justify-content: center;
}

.highlight-share-style-picker-content {
  display: flex;
  align-items: center;
  gap: 18px;
}

.highlight-share-style-dot-outer {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.highlight-share-style-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
}

.highlight-share-aspect-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding-bottom: 10px;
}

.highlight-share-aspect-button {
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--share-ui-muted, #6b7280);
}

.highlight-share-aspect-button.active {
  border-color: var(--share-ui-primary-border, rgba(139, 92, 246, 0.3));
  background: var(--share-ui-primary-soft, rgba(139, 92, 246, 0.06));
  color: var(--share-ui-primary-bg, #8b5cf6);
}

.highlight-share-aspect-icon {
  border: 1.5px solid rgba(150, 150, 150, 0.4);
  border-radius: 2px;
  display: inline-block;
}

.highlight-share-aspect-button.active .highlight-share-aspect-icon {
  border-color: var(--share-ui-primary-bg, #8b5cf6);
}

.highlight-share-aspect-icon-square {
  width: 14px;
  height: 14px;
}

.highlight-share-aspect-icon-story {
  width: 10px;
  height: 16px;
}

.highlight-share-controls {
  padding: 18px 20px 20px;
  border-top: 0.5px solid var(--share-ui-border, rgba(139, 92, 246, 0.1));
  background: var(--share-ui-bg, #fffdf9);
}

.highlight-share-buttons {
  display: flex;
  gap: 12px;
}

.highlight-share-button {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.highlight-share-button:hover {
  transform: translateY(-1px);
}

.highlight-share-wisdom {
  background: var(--share-ui-primary-bg, #8b5cf6);
  color: #fff;
}

.highlight-share-wisdom:hover {
  background: var(--share-ui-primary-hover-bg, #7c3aed);
}

.highlight-share-download {
  background: var(--share-ui-secondary-bg, #f7f8fb);
  color: var(--share-ui-secondary-text, #6b7280);
  border-color: var(--share-ui-secondary-border, #dce2ea);
}

.highlight-share-download:hover {
  background: var(--share-ui-secondary-hover-bg, #eef1f6);
}


.highlight-share-capture-root {
  position: absolute;
  left: -10000px;
  top: -10000px;
  opacity: 0;
  pointer-events: none;
}

@media only screen and (max-width: 760px) {
  .highlight-share-card-container {
    width: min(96vw, 560px);
    max-height: 96vh;
  }

  .highlight-share-preview {
    height: clamp(250px, 50vh, 420px);
    padding: 12px 16px;
  }

  .highlight-share-style-picker-content {
    gap: 14px;
  }

  .highlight-share-buttons {
    flex-direction: column;
  }
}

/* Confirmation Modal */
.letter-confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5) !important; /* Force backdrop visibility */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.letter-confirmation-modal.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.letter-confirmation-modal-center {
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.letter-confirmation-modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.letter-confirmation-modal-message {
  font-size: 16px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.letter-confirmation-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.letter-confirmation-modal-button {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

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

/* Toast message styles - only used if main.css styles are not available */
#inspirationResponseModal .toast-message {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #8b5cf6;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  max-width: 80%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#inspirationResponseModal .toast-message.show {
  opacity: 1;
  visibility: visible;
}

/* Only apply these styles if not in the modal */
.toast-message:not(#inspirationResponseModal .toast-message) {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #8b5cf6;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  max-width: 80%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-message.show:not(#inspirationResponseModal .toast-message) {
  opacity: 1;
  visibility: visible;
}

@media only screen and (max-width: 760px) {
  .toast-message {
    width: 90%;
    font-size: 13px;
    padding: 10px 16px;
  }
}

/* X (Twitter) */
.highlight-share-x {
  background-color: #000000;
  color: white;
}

.highlight-share-x:hover {
  background-color: #333333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Instagram */
.highlight-share-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
}

.highlight-share-instagram:hover {
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Threads */
.highlight-share-threads {
  background-color: #000000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight-share-threads img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.highlight-share-threads:hover {
  background-color: #333333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* TikTok */
.highlight-share-tiktok {
  background-color: #000000;
  color: white;
}

.highlight-share-tiktok:hover {
  background-color: #333333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* LinkedIn */
.highlight-share-linkedin {
  background-color: #0077B5;
  color: white;
}

.highlight-share-linkedin:hover {
  background-color: #006699;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Highlight options menu */
.highlight-options-menu {
  position: absolute;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  z-index: 10000;
  min-width: 150px;
  margin-top: 0; /* Remove margin to position exactly at the highlight */
  border: 1px solid rgba(0, 0, 0, 0.1);
  transform-origin: top left;
  animation: menuAppear 0.15s ease-out;
}

@keyframes menuAppear {
  from { 
    opacity: 0; 
    transform: translateY(-5px) scale(0.98);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

.highlight-option-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
}

.highlight-option-item:hover {
  background-color: #f5f5f5;
  color: #000;
}

.highlight-option-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.highlight-option-share {
  color: #A855F7;
}

.highlight-option-remove {
  color: #ef4444;
}
