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

:root {
  --primary: #0095f6;
  --primary-hover: #1877f2;
  --secondary: #8e8e8e;
  --success: #00a400;
  --danger: #ed4956;
  --warning: #f0b90b;
  --bg-primary: #000000;
  --bg-secondary: #121212;
  --bg-tertiary: #1c1c1c;
  --bg-card: #262626;
  --border-color: #363636;
  --text-primary: #fafafa;
  --text-secondary: #a8a8a8;
  --text-tertiary: #737373;
  --overlay: rgba(0, 0, 0, 0.65);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: all 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, textarea {
  font-family: inherit;
}

.container {
  max-width: 935px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-primary:disabled {
  background: rgba(0, 149, 246, 0.3);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #c13748;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  padding: 8px;
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
  white-space: pre-wrap;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-tertiary);
}

.avatar-sm {
  width: 24px;
  height: 24px;
}

.avatar-md {
  width: 44px;
  height: 44px;
}

.avatar-lg {
  width: 77px;
  height: 77px;
}

.avatar-xl {
  width: 150px;
  height: 150px;
}

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, var(--primary), #833ab4);
  color: #fff;
  font-weight: 600;
}

.avatar-container {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  color: var(--primary);
  background: #fff;
  border-radius: 50%;
  font-size: 14px;
  z-index: 2;
  border: 2px solid var(--bg-primary);
}

.avatar-sm .verified-badge {
  font-size: 10px;
  bottom: -1px;
  right: -1px;
}

.avatar-lg .verified-badge {
  font-size: 18px;
  bottom: 2px;
  right: 2px;
}

.avatar-xl .verified-badge {
  font-size: 32px;
  bottom: 10px;
  right: 10px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--text-secondary);
}

.text-sm {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.hidden {
  display: none !important;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-container {
  width: 100%;
  max-width: 975px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo i {
  color: var(--primary);
}

.nav-search {
  flex: 0 1 268px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
}

.nav-search input:focus {
  outline: none;
}

.nav-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-primary);
  font-size: 22px;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--text-secondary);
}

.nav-links a.active {
  color: var(--text-primary);
}

.nav-links .badge {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.main-content {
  padding-top: 80px;
  padding-bottom: 80px;
  min-height: 100vh;
}

.sidebar-left {
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  width: 244px;
  padding: 20px;
  border-right: 1px solid var(--border-color);
  background: var(--bg-primary);
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  font-size: 16px;
}

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

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

.sidebar-nav-item i {
  width: 24px;
  font-size: 24px;
  text-align: center;
}

.sidebar-nav-item span {
  flex: 1;
}

.page-layout {
  display: flex;
  gap: 30px;
  max-width: 975px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-main {
  flex: 1;
  max-width: 614px;
}

.page-sidebar {
  width: 319px;
  position: sticky;
  top: 88px;
  height: fit-content;
}

.post-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.post-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
}

.post-header-info {
  flex: 1;
}

.post-username {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
}

.post-username:hover {
  color: var(--text-secondary);
}

.post-location {
  font-size: 12px;
  color: var(--text-secondary);
}

.post-more {
  color: var(--text-primary);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.post-media {
  position: relative;
  background: var(--bg-secondary);
}

.post-media img,
.post-media video {
  width: 100%;
  display: block;
}

.post-media-carousel {
  position: relative;
  overflow: hidden;
}

.post-media-slides {
  display: flex;
  transition: transform 0.3s ease;
}

.post-media-slide {
  min-width: 100%;
}

.post-media-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: #262626;
  opacity: 0.7;
  transition: var(--transition);
}

.post-media-nav:hover {
  opacity: 1;
}

.post-media-nav.prev {
  left: 8px;
}

.post-media-nav.next {
  right: 8px;
}

.post-media-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.post-media-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.4);
}

.post-media-dot.active {
  background: var(--primary);
}

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

.post-action {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
}

.post-action:hover {
  color: var(--text-secondary);
}

.post-action.liked {
  color: var(--danger);
}

.post-action.liked i {
  animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.post-action-right {
  margin-left: auto;
}

.post-likes {
  padding: 0 16px;
  font-weight: 600;
  font-size: 14px;
}

.post-caption {
  padding: 8px 16px;
  font-size: 14px;
}

.post-caption-username {
  font-weight: 600;
  margin-right: 4px;
}

.post-comments-link {
  display: block;
  padding: 4px 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.post-time {
  padding: 4px 16px 16px;
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.post-comment-form {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  gap: 12px;
}

.post-comment-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  max-height: 80px;
}

.post-comment-input:focus {
  outline: none;
}

.post-comment-submit {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.3;
  transition: var(--transition);
}

.post-comment-submit:not(:disabled) {
  opacity: 1;
}

.post-comment-submit:not(:disabled):hover {
  color: var(--primary-hover);
}

.stories-container {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  overflow-x: auto;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.story-avatar-ring {
  padding: 3px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  border-radius: var(--radius-full);
}

.story-avatar-ring.seen {
  background: var(--border-color);
}

.story-avatar-ring img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-primary);
  object-fit: cover;
}

.story-username {
  font-size: 12px;
  color: var(--text-primary);
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions-box {
  background: var(--bg-primary);
  padding: 16px 0;
}

.suggestions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  margin-bottom: 16px;
}

.suggestions-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.suggestions-see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 12px;
}

.suggestion-info {
  flex: 1;
  overflow: hidden;
}

.suggestion-username {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-name {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-follow {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
}

.suggestion-follow:hover {
  color: var(--primary-hover);
}

.profile-header {
  display: flex;
  gap: 30px;
  margin-bottom: 44px;
  padding: 20px 0;
}

.profile-avatar-container {
  flex: 0 0 150px;
  display: flex;
  justify-content: center;
}

.profile-info {
  flex: 1;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.profile-username {
  font-size: 20px;
  font-weight: 400;
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.profile-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 20px;
}

.profile-stat {
  font-size: 16px;
}

.profile-stat strong {
  font-weight: 600;
}

.profile-bio {
  font-size: 14px;
}

.profile-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-tabs {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border-color);
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-top: 1px solid transparent;
  margin-top: -1px;
  transition: var(--transition);
}

.profile-tab:hover {
  color: var(--text-primary);
}

.profile-tab.active {
  color: var(--text-primary);
  border-top-color: var(--text-primary);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.profile-grid-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-secondary);
  cursor: pointer;
  overflow: hidden;
}

.profile-grid-item img,
.profile-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-grid-item:hover .profile-grid-overlay {
  opacity: 1;
}

.profile-grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  opacity: 0;
  transition: var(--transition);
}

.profile-grid-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-lg {
  max-width: 600px;
}

.modal-xl {
  max-width: 900px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.chat-layout {
  display: flex;
  height: calc(100vh - 60px);
  margin-top: 60px;
}

.chat-sidebar {
  width: 350px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.chat-sidebar-title {
  font-size: 16px;
  font-weight: 600;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: var(--transition);
}

.chat-list-item:hover {
  background: var(--bg-tertiary);
}

.chat-list-item.active {
  background: var(--bg-tertiary);
}

.chat-list-info {
  flex: 1;
  overflow: hidden;
}

.chat-list-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.chat-list-preview {
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.chat-list-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-list-unread {
  min-width: 18px;
  height: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.chat-header-info {
  flex: 1;
}

.chat-header-name {
  font-weight: 600;
  font-size: 16px;
}

.chat-header-status {
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-message {
  max-width: 65%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  position: relative;
  margin-bottom: 2px;
  display: flex;
  flex-direction: column;
}

.chat-message.sent {
  align-self: flex-end;
  background-color: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

.chat-message.received {
  align-self: flex-start;
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  margin-right: auto;
}

.message-content {
  display: flex;
  flex-direction: column;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.chat-message-time {
  font-size: 10px;
  opacity: 0.7;
}

.chat-message.received .chat-message-time {
  color: var(--text-tertiary);
  text-align: left;
}

.chat-message.sent .chat-message-time {
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
}

.chat-message.sent + .chat-message.sent {
  margin-top: -4px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 18px;
}

.chat-message.received + .chat-message.received {
  margin-top: -4px;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 18px;
}

.chat-message.sent:first-child,
.chat-message.sent:not(:has(+ .chat-message.sent)) {
  border-bottom-right-radius: 18px;
}

.chat-message.received:first-child,
.chat-message.received:not(:has(+ .chat-message.received)) {
  border-bottom-left-radius: 18px;
}

.chat-message.sent:not(:has(+ .chat-message.sent)) {
  border-bottom-right-radius: 18px !important;
}

.chat-message.received:not(:has(+ .chat-message.received)) {
  border-bottom-left-radius: 18px !important;
}

.chat-input-container {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.chat-input-form {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 8px 16px;
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
}

.chat-input:focus {
  outline: none;
}

.chat-send-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-send-btn:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.chat-empty i {
  font-size: 64px;
  margin-bottom: 20px;
  color: var(--text-tertiary);
}

.chat-empty h3 {
  font-size: 22px;
  font-weight: 300;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.create-post-modal {
  max-width: 800px;
}

.create-post-content {
  display: flex;
  min-height: 400px;
}

.create-post-media {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color);
  padding: 20px;
  background: var(--bg-tertiary);
}

.create-post-upload {
  text-align: center;
}

.create-post-upload i {
  font-size: 64px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.create-post-upload p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.create-post-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.create-post-form {
  width: 340px;
  display: flex;
  flex-direction: column;
}

.create-post-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.create-post-textarea {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  resize: none;
}

.create-post-textarea:focus {
  outline: none;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(237, 73, 86, 0.1);
  border: 1px solid rgba(237, 73, 86, 0.3);
  color: var(--danger);
}

.alert-success {
  background: rgba(0, 164, 0, 0.1);
  border: 1px solid rgba(0, 164, 0, 0.3);
  color: var(--success);
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.loading-page .loading-spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state i {
  font-size: 48px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 22px;
  font-weight: 300;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 100;
  display: none;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
}

.dropdown-item i {
  width: 20px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-message {
  flex: 1;
  font-size: 14px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

@media (max-width: 935px) {
  .page-sidebar {
    display: none;
  }

  .page-main {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-search {
    display: none;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .profile-stats {
    justify-content: center;
  }

  .chat-sidebar {
    width: 100%;
    display: none;
  }

  .chat-sidebar.active {
    display: flex;
  }

  .chat-main {
    display: none;
  }

  .chat-main.active {
    display: flex;
    width: 100%;
  }

  .create-post-content {
    flex-direction: column;
  }

  .create-post-form {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .nav-logo span {
    display: none;
  }

  .post-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-bottom: 0;
  }

  .stories-container {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

.post-caption-text,
.comment-text {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    line-height: 1.5;
}

.post-caption-text a,
.comment-text a {
    color: var(--primary);
    text-decoration: none;
}

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