.LinkPreview {
  display: block;
  margin-top: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
  background: rgba(0, 0, 0, 0.02);
  position: relative;
  isolation: isolate;
}

@media (prefers-color-scheme: dark) {
  .LinkPreview {
    background: rgba(255, 255, 255, 0.04);
  }
}

.LinkPreview::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  pointer-events: none;
  z-index: -1;
  transition: all 0.2s;
}

@media (hover: hover) {
  .LinkPreview:hover::before {
    border-color: var(--accent-color, #999);
    filter: var(--user-content-filter);
  }
}

.LinkPreview:active::before {
  border-color: var(--accent-color, #999);
  filter: var(--user-content-filter);
  transition-duration: 0.05s;
}

.LinkPreview--simple .LinkPreview-info {
  padding: 16px;
}

.LinkPreview--simple .LinkPreview-title {
  font-size: 15px;
  font-weight: normal;
  line-height: 1.5;
}

.LinkPreview-thumb {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.LinkPreview-info {
  padding: 16px;
}

.LinkPreview-domain {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: lowercase;
}

.LinkPreview-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.3;
}

.LinkPreview-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.LinkPreview-container {
  position: relative;
  margin-top: 12px;
  isolation: isolate;
}

.LinkPreview-deleteButton {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

@media (hover: hover) {
  .LinkPreview-deleteButton:hover {
    color: white;
    background: rgba(0, 0, 0, 0.7);
  }
}

.LinkPreview-deleteButton:active {
  background: rgba(0, 0, 0, 0.7);
  transition-duration: 0.05s;
}

.LinkPreview-deleteButton:focus-visible {
  outline: 1px solid var(--accent-color);
}

/* GIF embed styles */
.LinkPreview-gif {
  position: relative;
  width: 100%;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.LinkPreview-gif-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.LinkPreview-gif-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Player embed styles (YouTube, Spotify, etc.) */
.LinkPreview-player {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 80vh;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.LinkPreview-container .LinkPreview-player {
  margin-top: 0;
  z-index: 1;
}

.LinkPreview-player-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}
