/* ══════════════════════════════════════════════════════
   Twitter / X — Component Styles
   ══════════════════════════════════════════════════════ */

/* ── Twitter Card Base ── */
.tw-card {
  background: var(--tw-bg, #000);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 16px;
  font-family: inherit;
  color: var(--tw-text, #e7e9ea);
}
[data-theme="light"] .tw-card {
  --tw-bg: #fff;
  --tw-text: #0f1419;
  border-color: rgba(0,0,0,0.1);
}
.tw-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.tw-nr {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}
.tw-name { font-weight: 700; font-size: 14px; }
.tw-handle { color: #71767b; font-size: 13px; }
.tw-badge-row { margin-top: 2px; }
.tw-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}
.tw-text {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 12px;
  color: var(--tw-text, #e7e9ea);
}
[data-theme="light"] .tw-text { color: #0f1419; }

/* ── Media Wrap ── */
.tw-media-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.tw-media {
  width: 100%;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  max-height: 280px;
}
.tw-media-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .5px;
}

/* ── Action Bar ── */
.tw-acts {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-wrap: wrap;
}
[data-theme="light"] .tw-acts { border-top-color: rgba(0,0,0,0.07); }
.tw-act {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #71767b;
  cursor: pointer;
  transition: color .2s;
}
.tw-act:hover { color: #1d9bf0; }
.tw-act-like:hover { color: #f91880; }
.tw-act .material-symbols-outlined { font-size: 17px; }

/* ── Poll ── */
.tw-poll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.tw-poll-opt {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(29,155,240,0.15);
  border: 1px solid rgba(29,155,240,0.3);
  border-radius: 6px;
  overflow: hidden;
  padding: 10px 12px;
  gap: 8px;
}
.tw-poll-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(29,155,240,0.35);
  pointer-events: none;
}
.tw-poll-label { font-size: 13px; font-weight: 600; position: relative; flex: 1; }
.tw-poll-pct { font-size: 12px; font-weight: 700; color: #1d9bf0; position: relative; }
.tw-poll-meta { font-size: 12px; color: #71767b; text-align: right; }

/* ── Link Card ── */
.tw-link-card {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .2s;
}
[data-theme="light"] .tw-link-card { border-color: rgba(0,0,0,0.12); }
.tw-link-card:hover { border-color: #1d9bf0; }
.tw-link-card-img { width: 100%; height: 140px; object-fit: cover; display: block; }
.tw-link-card-body { padding: 10px 14px 12px; background: rgba(255,255,255,0.04); }
[data-theme="light"] .tw-link-card-body { background: rgba(0,0,0,0.03); }
.tw-link-card-domain { font-size: 11px; color: #71767b; margin-bottom: 2px; }
.tw-link-card-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.tw-link-card-desc { font-size: 12px; color: #71767b; }

/* ── 4-Image Grid ── */
.tw-img-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  aspect-ratio: 16/10;
}
.tw-img-grid-4 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .2s;
}
.tw-img-grid-4 img:hover { opacity: .85; }

/* ── Video Wrap ── */
.tw-video-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #000;
}
.tw-video-ov {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 60%);
}
.tw-video-play {
  width: 52px;
  height: 52px;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  backdrop-filter: blur(4px);
}
.tw-video-play .material-symbols-outlined { font-size: 32px; color: #fff; }
.tw-video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}
.tw-video-badge {
  background: rgba(255,255,255,0.2);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: .5px;
}
.tw-gif-badge {
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
  margin: auto;
}

/* ── Quote Tweet ── */
.tw-qt-wrap {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
[data-theme="light"] .tw-qt-wrap { border-color: rgba(0,0,0,0.12); }
.tw-qt-head { padding: 8px 12px 4px; font-size: 12px; color: #71767b; font-weight: 600; }
.tw-qt-name { color: #1d9bf0; }
.tw-qt-body { padding: 0 12px 8px; font-size: 13px; line-height: 1.5; }
.tw-qt-img { width: 100%; max-height: 120px; object-fit: cover; display: block; }

/* ── Thread ── */
.tw-thread-wrap { border-radius: 16px; overflow: hidden; }
.tw-thread { display: flex; flex-direction: column; }
.tw-thread-item {
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
}
.tw-thread-item:first-child { border-radius: 16px 16px 0 0 !important; border-top: 1px solid rgba(255,255,255,0.1) !important; }
[data-theme="light"] .tw-thread-item:first-child { border-top-color: rgba(0,0,0,0.1) !important; }
.tw-thread-item:last-child { border-radius: 0 0 16px 16px !important; }
.tw-thread-av-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.tw-thread-line {
  width: 2px;
  flex: 1;
  min-height: 16px;
  background: rgba(113,118,123,0.5);
  margin-top: 6px;
  border-radius: 1px;
}

/* ── Pinned Ribbon ── */
.tw-pinned-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(245,158,11,0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: .5px;
  backdrop-filter: blur(6px);
  z-index: 2;
}

/* ── Spaces Card ── */
.tw-spaces-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 180px;
}
.tw-spaces-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1040 0%, #3b1f7a 40%, #7b61ff 70%, #c084fc 100%);
}
.tw-spaces-content {
  position: relative;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
}
.tw-spaces-live-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #fff;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(4px);
}
.tw-spaces-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.tw-spaces-host {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}
.tw-spaces-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
}
.tw-spaces-waveform {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 34px;
  margin-top: 4px;
}
.tw-wave-bar {
  width: 4px;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
  animation: twWavePulse 1.2s ease-in-out infinite alternate;
}
.tw-wave-bar:nth-child(odd) { animation-delay: 0.1s; }
.tw-wave-bar:nth-child(3n) { animation-delay: 0.3s; }
.tw-wave-bar:nth-child(4n) { animation-delay: 0.5s; }
@keyframes twWavePulse {
  0% { opacity: 0.4; transform: scaleY(0.7); }
  100% { opacity: 1; transform: scaleY(1); }
}

/* ── Caption Bar (Subtitles) ── */
.tw-caption-bar {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  padding: 6px 16px;
  border-radius: 6px;
  max-width: 80%;
  text-align: center;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.tw-caption-text {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .2px;
}

/* ── Before / After Split ── */
.tw-video-split {
  display: flex;
  position: relative;
}
.tw-split-left, .tw-split-right {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.tw-split-left img, .tw-split-right img {
  display: block;
}
.tw-split-label {
  position: absolute;
  top: 10px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  z-index: 2;
}
.tw-split-label-before {
  left: 8px;
  background: rgba(239,68,68,0.85);
}
.tw-split-label-after {
  right: 8px;
  background: rgba(52,211,153,0.85);
}
.tw-split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  pointer-events: none;
}
.tw-split-divider-line {
  flex: 1;
  width: 2px;
  background: rgba(255,255,255,0.7);
}
.tw-split-divider-icon {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tw-split-divider-icon .material-symbols-outlined {
  font-size: 16px;
  color: #000;
}

/* ── Teaser / Countdown Overlay ── */
.tw-teaser-ov {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 2;
}
.tw-teaser-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tw-teaser-count-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tw-teaser-num {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.tw-teaser-unit {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1.5px;
}
.tw-teaser-sep {
  font-size: 24px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  margin-top: -12px;
  animation: twBlink 1s ease-in-out infinite;
}
@keyframes twBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.tw-teaser-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}
.tw-teaser-play {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: transform .2s, background .2s;
}
.tw-teaser-play:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.25);
}
.tw-teaser-play .material-symbols-outlined {
  font-size: 24px;
  color: #fff;
}

/* ── Legacy compat (monolith uses these) ── */
.tw-post {
  background: var(--tw-bg, #000);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 16px;
  color: var(--tw-text, #e7e9ea);
}
[data-theme="light"] .tw-post { --tw-bg: #fff; --tw-text: #0f1419; border-color: rgba(0,0,0,0.1); }
.tw-flex { display: flex; gap: 12px; }
.tw-body { flex: 1; min-width: 0; }

.tw-sales-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tw-sales-strip .conv-chip {
  font-size: 9px;
  padding: 5px 8px;
}

.tw-media-panel {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(12, 18, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #fff;
}

.tw-media-panel strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 4px;
}

.tw-media-panel p {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}
