:root {
  --bg-primary: #000;
  --bg-secondary: #000;
  --text-primary: #e7e9ea;
  --text-secondary: #71767b;
  --border-color: #2f3336;
  --accent: #1d9bf0;
  --btn-bg: #eff3f4;
  --btn-text: #0f1419;
  --btn-hover: #d7dbdc;
}

[data-theme="light"] {
  --bg-primary: #fff;
  --bg-secondary: #f7f9f9;
  --text-primary: #0f1419;
  --text-secondary: #536471;
  --border-color: #eff3f4;
  --accent: #1d9bf0;
  --btn-bg: #0f1419;
  --btn-text: #fff;
  --btn-hover: #272c30;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.3125;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color 0.3s,
    color 0.3s;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
}

/* Header with theme toggle */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: var(--bg-primary);
  z-index: 100;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.theme-toggle:hover {
  background-color: var(--border-color);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
  display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
  display: none;
}

/* Post styles */
.post {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.post-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  object-fit: cover;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.post-header-content {
  flex: 1;
  min-width: 0;
}

.post-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.display-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  text-decoration: none;
}

.display-name:hover {
  text-decoration: underline;
}

.verified-badge {
  width: 18px;
  height: 18px;
  margin-left: 2px;
  flex-shrink: 0;
}

.username {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
}

.follow-btn {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.follow-btn:hover {
  background-color: var(--btn-hover);
}

.more-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.more-btn:hover {
  background-color: rgba(29, 155, 240, 0.1);
  color: var(--accent);
}

.post-text {
  font-size: 15px;
  line-height: 1.4;

  margin-bottom: 12px;
}

.post-text a {
  color: var(--accent);
  text-decoration: none;
}

.post-text a:hover {
  text-decoration: underline;
}

.post-image {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.image-caption {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.post-time {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.5px;
}

.post-time span {
  margin: 0 4px;
}

.views-count {
  color: var(--text-primary);
  font-weight: 400;
}

.post-stats {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-top: 4px;
}

.stat-item {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.stat-number {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  margin-right: 4px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Action buttons */
.post-actions {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  margin-top: 4px;
  max-width: 425px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  font-size: 13px;
}

.action-btn svg {
  width: 18.75px;
  height: 18.75px;
}

.action-btn.comment:hover {
  color: var(--accent);
  background-color: rgba(29, 155, 240, 0.1);
}

.action-btn.retweet:hover,
.action-btn.retweet.active {
  color: #00ba7c;
  background-color: rgba(0, 186, 124, 0.1);
}

.action-btn .like:hover {
  color: #f91880;
  background-color: rgba(249, 24, 128, 0.1);
}

.action-btn.like.active {
  color: #f91880;
}

.action-btn.like.active svg {
  fill: #f91880;
}

.action-btn.bookmark:hover,
.action-btn.bookmark.active {
  color: var(--accent);
  background-color: rgba(29, 155, 240, 0.1);
}

.action-btn.share:hover {
  color: var(--accent);
  background-color: rgba(29, 155, 240, 0.1);
}

.action-count {
  font-size: 13px;
  min-width: 16px;
}

/* Comment styles */
.comment {
  padding: 12px 16px;
  display: flex;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}

.comment-header .display-name {
  font-size: 15px;
}

.comment-header .username {
  font-size: 15px;
}

.comment-header .dot {
  color: var(--text-secondary);
  font-size: 15px;
}

.comment-header .time {
  color: var(--text-secondary);
  font-size: 15px;
}

.comment-text {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 12px;
  word-wrap: break-word;
}

.comment-actions {
  display: flex;
  justify-content: space-between;
  max-width: 425px;
}

.comment-actions .action-btn {
  padding: 8px 12px;
  margin-left: -12px;
}

.comment-actions .action-btn:first-child {
  margin-left: -8px;
}

/* Header row with more button */
.comment-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Responsive */
@media (max-width: 500px) {
  .container {
    border-left: none;
    border-right: none;
  }

  .post-actions,
  .comment-actions {
    max-width: 100%;
  }

  .stat-item {
    margin-right: 16px;
  }
}

/* Animation for like */
@keyframes heartBeat {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.2);
  }

  50% {
    transform: scale(1);
  }

  75% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.action-btn.like.animating svg {
  animation: heartBeat 0.4s ease-in-out;
}

.replying-to {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 4px;
}

.replying-to a {
  color: var(--accent);
  text-decoration: none;
}

.replying-to a:hover {
  text-decoration: underline;
}
