/* Kibhel Twitter/X Clone Modern Dark Stylesheet */
:root {
  --bg-color: #000000;
  --card-bg: #16181c;
  --card-hover: #1c1f24;
  --border-color: #2f3336;
  --text-main: #e7e9ea;
  --text-muted: #71767b;
  --primary: #1d9bf0;
  --primary-hover: #1a8cd8;
  --danger: #f4212e;
  --danger-hover: #dc1e29;
  --success: #00ba7c;
  --sidebar-w: 260px;
  --right-w: 320px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-layout {
  display: flex;
  width: 100%;
  max-width: 1240px;
  min-height: 100vh;
}

/* Left Sidebar */
.left-sidebar {
  width: var(--sidebar-w);
  border-right: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  text-decoration: none;
  margin-bottom: 24px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1d9bf0, #7928ca);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 9999px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

.nav-item.active {
  font-weight: 800;
  color: var(--primary);
}

.user-session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 9999px;
  background-color: transparent;
  transition: background-color 0.2s;
  cursor: pointer;
}

.user-session-card:hover {
  background-color: var(--card-hover);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3e4144;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.user-names {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.user-handle {
  color: var(--text-muted);
  font-size: 13px;
}

/* Center Feed Column */
.main-feed-col {
  flex: 1;
  max-width: 620px;
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
}

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

.feed-title {
  padding: 14px 16px;
  font-size: 20px;
  font-weight: 800;
}

.feed-tabs {
  display: flex;
  width: 100%;
}

.feed-tab {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s, background-color 0.2s;
}

.feed-tab:hover {
  background-color: rgba(231, 233, 234, 0.05);
  color: var(--text-main);
}

.feed-tab.active {
  color: var(--text-main);
}

.feed-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 9999px;
}

/* Post Composer */
.composer-box {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

.composer-content {
  flex: 1;
}

.composer-textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  font-family: inherit;
  resize: none;
  min-height: 80px;
  outline: none;
  line-height: 1.4;
}

.composer-textarea::placeholder {
  color: var(--text-muted);
}

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #202327;
}

.char-indicator {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.char-indicator.warning {
  color: #ffd400;
}

.char-indicator.error {
  color: var(--danger);
  font-weight: 700;
}

.btn-post {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

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

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

/* Post Card Stream */
.post-stream {
  display: flex;
  flex-direction: column;
}

.stream-card {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  transition: background-color 0.2s;
  word-break: break-word;
}

.stream-card:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.stream-card-body {
  flex: 1;
}

.stream-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

.author-name {
  font-weight: 700;
  color: var(--text-main);
}

.author-handle, .post-time {
  color: var(--text-muted);
}

.post-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  margin-top: 4px;
}

.post-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-action-follow {
  background-color: #fff;
  color: #000;
  border: none;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-action-follow.following {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-delete-post {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s;
  padding: 4px;
}

.btn-delete-post:hover {
  color: var(--danger);
}

/* Right Sidebar */
.right-sidebar {
  width: var(--right-w);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
}

.sidebar-card-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}

/* Auth Modal / Box */
.auth-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-input {
  width: 100%;
  background-color: #000;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.auth-input:focus {
  border-color: var(--primary);
}

.auth-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-auth-primary {
  flex: 1;
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn-auth-secondary {
  flex: 1;
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.alert-message {
  font-size: 13px;
  color: var(--danger);
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 992px) {
  .right-sidebar { display: none; }
  .left-sidebar { width: 80px; padding: 16px 8px; align-items: center; }
  .nav-item span, .brand-logo span, .user-names { display: none; }
}

@media (max-width: 600px) {
  .left-sidebar { display: none; }
  .main-feed-col { border-right: none; }
}
