/* Shared tweet rendering styles */

/* Tweet card base */
.tweet-card {
  background: #12121a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tweet-card:hover {
  border-color: #555;
  background: rgba(30, 30, 45, 0.5);
}
.tweet-card.current {
  border-color: #7eb8da;
  background: rgba(126, 184, 218, 0.08);
}
.tweet-card.dimmed { opacity: 0.6; }
.tweet-card.dimmed:hover { opacity: 1; }
.tweet-card.is-retweet { border-left: 3px solid #6a6; }

/* Compact variant */
.tweet-card.compact {
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

/* Header with avatar */
.tweet-card .tweet-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 15px;
}

.tweet-card .tweet-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a3a4a 0%, #2a2a3a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #7eb8da;
  flex-shrink: 0;
}

.tweet-card.compact .tweet-avatar {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.tweet-card .tweet-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tweet-card .tweet-name {
  font-weight: 700;
  color: #e0e0e0;
}

.tweet-card .tweet-handle {
  color: #666;
  font-size: 14px;
}

/* Meta info (date, fav, badges) */
.tweet-card .tweet-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 13px;
  margin-left: auto;
}

.tweet-card .tweet-meta .tweet-date { color: #666; }
.tweet-card .tweet-meta .tweet-fav { color: #f91880; }
.tweet-card .tweet-meta .similarity {
  color: #7eb8da;
  background: rgba(126, 184, 218, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}

/* Simple meta line (for compact view without avatar) */
.tweet-card .tweet-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #666;
}
.tweet-card .tweet-meta-line .fav { color: #f91880; }
.tweet-card .tweet-meta-line a {
  color: #7eb8da;
  text-decoration: none;
  margin-left: auto;
}
.tweet-card .tweet-meta-line a:hover { text-decoration: underline; }

/* Tweet text */
.tweet-card .tweet-text {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
  line-height: 1.4;
}

.tweet-card .tweet-text.truncated {
  position: relative;
  max-height: 100px;
  overflow: hidden;
}

.tweet-card .show-more {
  color: #1d9bf0;
  font-size: 13px;
  margin-top: 4px;
  cursor: pointer;
}
.tweet-card .show-more:hover { text-decoration: underline; }

/* Retweet indicator */
.tweet-card .retweet-indicator {
  font-size: 12px;
  color: #6a6;
  margin-bottom: 6px;
}

/* Images */
.tweet-card .tweet-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tweet-card .tweet-images img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.tweet-card .tweet-images img:hover { opacity: 0.9; }

.tweet-card .tweet-images.single img {
  max-width: 100%;
  max-height: 500px;
}

.tweet-card .tweet-images.multi img {
  max-width: calc(50% - 4px);
  max-height: 200px;
  object-fit: cover;
}

/* Video thumbnails */
.tweet-card .video-thumb-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.tweet-card .video-thumb-container img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
}
.tweet-card .video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  pointer-events: none;
}
.tweet-card .video-thumb-container:hover .video-play-icon {
  background: rgba(29, 155, 240, 0.9);
}

/* Transcriptions */
.tweet-card .tweet-transcription {
  background: #1a1a24;
  border-left: 3px solid #444;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 13px;
  color: #aaa;
  max-height: 200px;
  overflow-y: auto;
}

.tweet-card.compact .tweet-transcription {
  padding: 6px 10px;
  font-size: 11px;
  max-height: 80px;
}

/* Concept tags */
.tweet-card .tweet-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.tweet-card .concept-tag {
  font-size: 10px;
  color: #7eb8da;
  background: rgba(126, 184, 218, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(126, 184, 218, 0.2);
  cursor: pointer;
  transition: background 0.15s;
}
.tweet-card .concept-tag:hover {
  background: rgba(126, 184, 218, 0.25);
  color: #fff;
}
.tweet-card .concept-tag.current {
  background: rgba(126, 184, 218, 0.3);
  color: #fff;
  border-color: rgba(126, 184, 218, 0.5);
}
.tweet-card .concept-tag.model-tag {
  color: #dab87e;
  background: rgba(218, 184, 126, 0.1);
  border-color: rgba(218, 184, 126, 0.2);
}
.tweet-card .concept-tag.model-tag:hover {
  background: rgba(218, 184, 126, 0.25);
  color: #fff;
}

/* Footer */
.tweet-card .tweet-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #2a2a3a;
  font-size: 13px;
}

.tweet-card .tweet-footer .tweet-fav { color: #f91880; }

.tweet-card .tweet-link {
  color: #666;
  text-decoration: none;
  margin-left: auto;
}
.tweet-card .tweet-link:hover { color: #1d9bf0; }

/* Connection type badges */
.tweet-card .connection-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}
.tweet-card .connection-badge.reply { background: rgba(100, 200, 100, 0.2); color: #8c8; }
.tweet-card .connection-badge.quote { background: rgba(200, 150, 100, 0.2); color: #da8; }
.tweet-card .connection-badge.thread { background: rgba(150, 150, 200, 0.2); color: #aaf; }
.tweet-card .connection-badge.retweet { background: rgba(100, 180, 100, 0.2); color: #6a6; }

/* Image modal */
.tweet-image-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  cursor: pointer;
  justify-content: center;
  align-items: center;
}
.tweet-image-modal.open { display: flex; }
.tweet-image-modal img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}

/* Two-column layout for multiple tweets */
.tweet-grid {
  display: flex;
  gap: 16px;
}
.tweet-grid .tweet-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tweet-grid .tweet-card {
  margin-bottom: 0;
}
.tweet-grid .tweet-card .tweet-images {
  display: block !important;
}
.tweet-grid .tweet-card .tweet-images img {
  width: 100% !important;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
}
.tweet-grid .tweet-card .tweet-images.multi {
  display: flex !important;
  flex-wrap: wrap;
}
.tweet-grid .tweet-card .tweet-images.multi img {
  max-height: 150px;
  width: calc(50% - 4px) !important;
  object-fit: cover;
}
.tweet-grid .tweet-card .tweet-transcription { display: none; }

/* Nested quoted tweet */
.quoted-tweet-nested {
  margin-top: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
  border-radius: 12px;
}
.quoted-tweet-nested .tweet-card {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
