:root {
  --bg-color: #000000;
  --text-primary: #e7e9ea;
  --text-secondary: #71767b;
  --blue: #1d9bf0;
  --blue-hover: #1a8cd8;
  --border-color: #2f3336;
  --hover-bg: rgba(231, 233, 234, 0.1);
  --blue-bg-hover: rgba(29, 155, 240, 0.1);
  --widget-bg: #16181c;
  --search-bg: #202327;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.app-container {
  display: flex;
  width: 100%;
  max-width: 1265px;
  margin: 0 auto;
}

.sidebar {
  width: 275px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 0 8px;
}

.sidebar-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.logo {
  padding: 12px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 2px;
}

.logo:hover {
  background-color: var(--hover-bg);
}

.logo svg {
  width: 28px;
  fill: var(--text-primary);
}

.nav-links {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 20px;
  border-radius: 9999px;
  width: fit-content;
  transition: background-color 0.2s;
  margin-bottom: 4px;
}

.nav-item:hover {
  background-color: var(--hover-bg);
}

.nav-item i {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  font-size: 24px;
}

.nav-item span.nav-text {
  margin-right: 16px;
}

.nav-item.active {
  font-weight: 700;
}

.post-btn {
  background-color: var(--blue);
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 15px 32px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  width: 90%;
  transition: background-color 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.post-icon {
  display: none;
}

.post-btn.small {
  padding: 0 16px;
  height: 36px;
  width: auto;
  font-size: 15px;
  margin-top: 0;
}

.post-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.post-btn:disabled:hover {
  background-color: var(--blue);
}

.profile-pill {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 12px;
  margin-top: auto;
}

.profile-pill:hover {
  background-color: var(--hover-bg);
}

.profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.profile-info {
  margin-left: 12px;
  flex: 1;
}

.name {
  font-weight: 700;
  font-size: 15px;
}

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

.ellipsis-icon {
  margin-left: auto;
}

.feed {
  width: 600px;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
}

.feed-header {
  position: sticky;
  top: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.tabs {
  display: flex;
  height: 53px;
}

.tab {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}

.tab:hover {
  background-color: var(--hover-bg);
}

.tab.active {
  font-weight: 700;
  color: var(--text-primary);
}

.tab.active span {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.tab.active span::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--blue);
  border-radius: 9999px;
}

.compose-tweet {
  display: flex;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.compose-right {
  flex: 1;
  margin-left: 12px;
}

.compose-right textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  resize: none;
  outline: none;
  min-height: 52px;
  padding-top: 12px;
}

.compose-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.action-icons {
  display: flex;
  color: var(--blue);
}

.action-icons i {
  width: 34px;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.action-icons i:hover {
  background-color: var(--blue-bg-hover);
}

.post {
  display: flex;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.post:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.post-content {
  flex: 1;
  margin-left: 12px;
}

.post-header {
  display: flex;
  align-items: center;
  font-size: 15px;
  position: relative;
}

.verified {
  color: var(--blue);
  margin-left: 4px;
  font-size: 14px;
}

.verified.gold {
  color: #e4b830;
}

.post-header .handle, .post-header .dot, .post-header .time {
  color: var(--text-secondary);
  margin-left: 4px;
}

.more-icon {
  margin-left: auto;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.more-icon:hover {
  background-color: var(--blue-bg-hover);
  color: var(--blue);
}

.post-text {
  font-size: 15px;
  margin-top: 4px;
  line-height: 20px;
  word-wrap: break-word;
}

.post-image-container {
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.post-image {
  width: 100%;
  height: auto;
  display: block;
}

.post-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--text-secondary);
  max-width: 425px;
}

.action {
  display: flex;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.action.flex-end {
  gap: 0;
}

.icon-container {
  width: 34px;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  margin-right: 4px;
}

.action span {
  padding: 0 4px;
}

.action:hover:nth-child(1) { color: var(--blue); }
.action:hover:nth-child(1) .icon-container { background-color: var(--blue-bg-hover); color: var(--blue); }

.action:hover:nth-child(2) { color: #00ba7c; }
.action:hover:nth-child(2) .icon-container { background-color: rgba(0, 186, 124, 0.1); color: #00ba7c; }

.action:hover:nth-child(3) { color: #f91880; }
.action:hover:nth-child(3) .icon-container { background-color: rgba(249, 24, 128, 0.1); color: #f91880; }

.action:hover:nth-child(4) { color: var(--blue); }
.action:hover:nth-child(4) .icon-container { background-color: var(--blue-bg-hover); color: var(--blue); }

.action.flex-end .icon-container:hover {
  background-color: var(--blue-bg-hover);
  color: var(--blue);
}

.right-sidebar {
  width: 350px;
  padding: 0 0 0 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--search-bg);
  border-radius: 9999px;
  height: 44px;
  padding: 0 16px;
  margin-top: 5px;
  margin-bottom: 16px;
  position: sticky;
  top: 5px;
  z-index: 10;
  border: 1px solid transparent;
}

.search-bar:focus-within {
  background-color: var(--bg-color);
  border-color: var(--blue);
}

.search-bar i {
  color: var(--text-secondary);
  margin-right: 12px;
}

.search-bar:focus-within i {
  color: var(--blue);
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  width: 100%;
  outline: none;
}

.widget {
  background-color: var(--widget-bg);
  border-radius: 16px;
  margin-bottom: 16px;
  padding: 16px 0;
}

.widget h2 {
  font-size: 20px;
  font-weight: 800;
  padding: 0 16px;
  margin-bottom: 12px;
}

.subscribe-widget p {
  font-size: 15px;
  padding: 0 16px;
  margin-bottom: 12px;
  line-height: 20px;
}

.subscribe-btn {
  background-color: var(--blue);
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin: 0 16px;
  transition: background-color 0.2s;
}

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

.trend {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.trend:hover {
  background-color: var(--hover-bg);
}

.trend-category, .trend-posts {
  color: var(--text-secondary);
  font-size: 13px;
}

.trend-title {
  font-size: 15px;
  font-weight: 700;
  margin: 2px 0;
}

.trend > i {
  position: absolute;
  top: 12px;
  right: 16px;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  margin-top: -8px;
}

.trend > i:hover {
  background-color: var(--blue-bg-hover);
  color: var(--blue);
}

.show-more {
  padding: 16px;
  color: var(--blue);
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.show-more:hover {
  background-color: var(--hover-bg);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.follow-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.follow-info {
  flex: 1;
  margin-left: 12px;
}

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

.follow-btn:hover {
  opacity: 0.9;
}

.right-footer {
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 64px;
}

.right-footer a, .right-footer span {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
}

.right-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1265px) {
  .sidebar { width: 88px; align-items: center; }
  .nav-item span.nav-text { display: none; }
  .nav-item i { margin-right: 0; }
  .post-btn { width: 50px; height: 50px; padding: 0; }
  .post-text { display: none; }
  .post-icon { display: block; font-size: 20px; }
  .profile-pill { padding: 12px; border-radius: 50%; }
  .profile-info, .ellipsis-icon { display: none; }
  .profile-pic { width: 40px; height: 40px; }
}

@media (max-width: 1000px) {
  .right-sidebar { display: none; }
  .feed { width: 100%; max-width: 600px; }
}

@media (max-width: 500px) {
  .app-container { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: fixed; bottom: 0; z-index: 100; background-color: var(--bg-color); border-top: 1px solid var(--border-color); padding: 0; }
  .sidebar-container { flex-direction: row; justify-content: space-around; width: 100%; padding: 8px 0; }
  .logo, .post-btn, .profile-pill, .nav-item:nth-child(n+5) { display: none; }
  .nav-links { flex-direction: row; justify-content: space-around; margin: 0; }
  .nav-item { margin: 0; padding: 8px; }
  .feed { margin-bottom: 60px; border: none; }
}

.go-back-btn {
  position: absolute;
  top: 24px;
  left: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.2s;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.go-back-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
