/* X (Twitter) Platform Specific Styles */
.social-post[data-platform="x"] {
  border-left-color: var(--x-blue);
}

.social-post[data-platform="x"] .social-post-platform {
  color: var(--x-blue);
}

.social-post[data-platform="x"] .platform-icon {
  background-color: var(--x-blue);
  border-radius: 4px;
}

/* X Tweet Container */
.x-tweet-container {
  background: var(--gray-10);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.x-tweet-container:hover {
  border-color: var(--x-blue);
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.1);
}

/* X Tweet Header */
.x-tweet-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.x-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

.x-user-info {
  flex: 1;
}

.x-user-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
}

.x-user-handle {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin: 0;
}

.x-tweet-time {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-left: auto;
}

/* X Tweet Content */
.x-tweet-text {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--primary-color);
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.x-tweet-text a {
  color: #1DA1F2;
  text-decoration: none;
}

.x-tweet-text a:hover {
  text-decoration: underline;
}

.x-tweet-text .hashtag {
  color: #1DA1F2;
  font-weight: 500;
}

.x-tweet-text .mention {
  color: #1DA1F2;
  font-weight: 500;
}

/* X Tweet Media */
.x-tweet-media {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.x-tweet-media img,
.x-tweet-media video {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.x-tweet-media-grid {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
}

.x-tweet-media-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.x-tweet-media-grid.grid-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.x-tweet-media-grid.grid-3 .media-item:first-child {
  grid-row: 1 / 3;
}

.x-tweet-media-grid.grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.x-tweet-media-grid .media-item {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.x-tweet-media-grid .media-item:hover {
  transform: scale(1.02);
}

.x-tweet-media-grid .media-item img,
.x-tweet-media-grid .media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* X Tweet Video Play Button */
.x-video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(29, 161, 242, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.x-video-play-button:hover {
  background: #1DA1F2;
  transform: translate(-50%, -50%) scale(1.1);
}

.x-video-play-button::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 16px solid var(--gray-1);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}

/* X Tweet Stats */
.x-tweet-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.x-tweet-actions {
  display: flex;
  gap: 2rem;
}

.x-tweet-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.9rem;
  transition: color 0.3s ease;
  cursor: pointer;
}

.x-tweet-action:hover {
  color: #1DA1F2;
}

.x-tweet-action-icon {
  width: 18px;
  height: 18px;
}

.x-tweet-action-count {
  font-weight: 500;
}

/* X Tweet Quote/Retweet */
.x-quoted-tweet {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  background: var(--gray-50);
}

.x-quoted-tweet .x-tweet-header {
  margin-bottom: 0.5rem;
}

.x-quoted-tweet .x-user-avatar {
  width: 32px;
  height: 32px;
}

.x-quoted-tweet .x-user-name {
  font-size: 0.9rem;
}

.x-quoted-tweet .x-user-handle {
  font-size: 0.8rem;
}

.x-quoted-tweet .x-tweet-text {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* X Thread Indicator */
.x-thread-indicator {
  position: relative;
  padding-left: 2rem;
}

.x-thread-indicator::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 60px;
  bottom: -1rem;
  width: 2px;
  background: var(--gray-300);
}

.x-thread-continue {
  color: #1DA1F2;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.5rem;
  cursor: pointer;
}

.x-thread-continue:hover {
  text-decoration: underline;
}

/* X Verified Badge */
.x-verified-badge {
  width: 16px;
  height: 16px;
  margin-left: 0.25rem;
  color: #1DA1F2;
}

/* X Promoted Tweet */
.x-promoted-tweet {
  position: relative;
}

.x-promoted-tweet::before {
  content: 'Promoted';
  position: absolute;
  top: -0.5rem;
  left: 0;
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Responsive Design for X */
@media (max-width: 768px) {
  .x-tweet-container {
    padding: 1rem;
    border-radius: 12px;
  }

  .x-user-avatar {
    width: 40px;
    height: 40px;
  }

  .x-user-name {
    font-size: 0.95rem;
  }

  .x-user-handle {
    font-size: 0.85rem;
  }

  .x-tweet-text {
    font-size: 0.95rem;
  }

  .x-tweet-actions {
    gap: 1.5rem;
  }

  .x-action-button {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .x-action-count {
    font-size: 0.8rem;
  }

  .x-quoted-tweet {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .x-tweet-container {
    padding: 0.75rem;
    border-radius: 8px;
  }

  .x-tweet-header {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .x-user-avatar {
    width: 36px;
    height: 36px;
  }

  .x-user-name {
    font-size: 0.9rem;
  }

  .x-user-handle {
    font-size: 0.8rem;
  }

  .x-tweet-text {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }

  .x-tweet-actions {
    gap: 1rem;
  }

  .x-action-button {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .x-action-count {
    font-size: 0.75rem;
  }

  .x-quoted-tweet {
    padding: 0.5rem;
    margin-top: 0.75rem;
  }
}