@import 'variables.css';

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

html {
  background-color: var(--background-color);
}

body {
  font-family: var(--font-family);
  background-color: transparent; /* Transparent to show background */
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

/* Post Card background needs to be solid */
.post-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  margin-bottom: 20px; /* Spacing between posts */
}
.post-stream-enter {
  animation: postStreamEnter 0.34s ease-out;
}
.post-card-optimistic {
  opacity: 0.72;
}
@keyframes postStreamEnter {
  0% { opacity: 0; transform: translateY(-14px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #f6fffb 22%, #ebfff7 48%, #d9fff0 74%, #7fffd4 100%);
  background-size: 220% 220%;
  animation: heylifeDynamicBackground 18s ease-in-out infinite alternate;
  z-index: -2;
  opacity: 1;
}

.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 22% 18%, rgba(127, 255, 212, 0.22), transparent 45%), radial-gradient(circle at 82% 82%, rgba(127, 255, 212, 0.14), transparent 42%);
  z-index: -1;
  pointer-events: none;
}

@keyframes heylifeDynamicBackground {
  0% {
    background-position: 0% 12%;
  }
  50% {
    background-position: 70% 52%;
  }
  100% {
    background-position: 100% 88%;
  }
}

/* Header */
.header {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-content {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.logo-container {
  height: 40px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Logo Gradient Text */
.logo-text {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 27px;
  font-weight: 800;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}

.logo-icon {
  font-size: 24px;
  margin-right: 8px;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.header-actions {
  display: flex;
  gap: var(--spacing-md);
}

.global-user-search {
  position: relative;
  flex: 1;
  max-width: min(560px, 100%);
}

.global-user-search-box {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--surface-color) 92%, #00F260 8%);
}

.global-user-search-box i {
  color: var(--text-secondary);
}

#global-user-search-input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.93rem;
  color: var(--text-primary);
}

.global-user-search-filter-btn {
  border: 0;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

.global-user-search-filter-btn:hover {
  color: var(--primary-color);
}

.global-user-search-filters {
  position: static;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-color);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 10px;
  display: none;
  z-index: 1450;
}

.global-user-search-filters.open {
  display: block;
}

.global-user-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.global-user-filter-row + .global-user-filter-row {
  margin-top: 8px;
}

.global-user-filter-row input,
.global-user-filter-row select {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-primary);
  padding: 0 10px;
}

.global-user-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-color);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  z-index: 1440;
}

.global-user-search-dropdown.hidden {
  display: none;
}

.global-user-search-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.global-user-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.global-user-result-item:last-child {
  border-bottom: none;
}

.global-user-result-item img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.global-user-result-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.global-user-result-meta strong {
  font-size: 0.93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-user-result-meta span {
  font-size: 0.81rem;
  color: var(--text-secondary);
}

.global-user-result-side {
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-secondary);
  gap: 2px;
}

#live-message-toast-host {
  position: fixed;
  top: calc(var(--header-height) + 10px);
  right: 12px;
  z-index: 2200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-message-toast {
  min-width: 220px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  font-size: 0.87rem;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.live-message-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.header-icon {
  font-size: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
}

.header-icon:hover, .header-icon.active {
  color: var(--primary-color);
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.notifications-wrapper {
  position: relative;
}

.notifications-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #ed4956;
}
.notification-badge-pop {
  animation: notificationBadgePop 0.55s ease-out;
}
@keyframes notificationBadgePop {
  0% { transform: scale(0.7); }
  45% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.notification-icon-pulse {
  animation: notificationIconPulse 0.65s ease-out;
}
@keyframes notificationIconPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.notifications-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 340px;
  max-width: min(340px, calc(100vw - 24px));
  max-height: var(--notifications-max-height, min(420px, calc(100dvh - 96px)));
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--surface-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: none;
  z-index: 1400;
}

.notifications-dropdown.open {
  display: flex;
  flex-direction: column;
}

.notifications-dropdown-header {
  padding: 12px 14px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notifications-dropdown-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: max(36px, calc(var(--safe-area-bottom, 0px) + 12px));
  scroll-padding-bottom: max(36px, calc(var(--safe-area-bottom, 0px) + 12px));
  overscroll-behavior: contain;
}
.notification-icon-gradient {
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 0 transparent;
}
.notification-icon-gradient-animated {
  animation: notificationGradientBreath 5.4s ease-in-out infinite;
}
@keyframes notificationGradientBreath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.98;
  }
  50% {
    transform: scale(1.02);
    opacity: 1;
  }
}

.notifications-clear-all-btn {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.notification-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
}

.notification-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.notification-item.unread {
  background: rgba(0, 114, 255, 0.06);
}
.notification-item.notification-item-suggestion {
  border-left: 3px solid rgba(0, 242, 96, 0.65);
}

.notification-item-main {
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  width: 100%;
  padding: 0;
}
.notification-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.notification-action-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.notification-action-btn.accept {
  background: rgba(0, 149, 246, 0.15);
  color: #0077cc;
}
.notification-action-btn.reject {
  background: rgba(237, 73, 86, 0.12);
  color: #c62839;
}
.notification-latest-item {
  animation: notificationItemEnter 0.4s ease-out;
}
@keyframes notificationItemEnter {
  0% { transform: translateY(-8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.notification-item-delete {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.notification-item-delete:hover {
  color: #ed4956;
  background: rgba(237, 73, 86, 0.1);
}

.notification-item-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.notification-item-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.notification-item-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.notifications-empty-state {
  padding: 28px 16px;
  text-align: center;
}

.notifications-empty-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notifications-empty-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--error-color);
  color: white;
  font-size: 0.7rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Main Content */
.main-container {
  margin-top: var(--header-height);
  margin-bottom: var(--nav-height); /* Ensure content isn't hidden behind nav */
  padding: var(--spacing-md) 0;
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
  display: flex;
  justify-content: flex-start; /* Align to top, but center horizontally via align-items */
  flex-direction: column; /* Allow stories to stack */
  align-items: center;
}

#feed-container {
  width: 100%;
  max-width: var(--feed-width);
  margin: 0 auto;
}

/* Loading State - Centered and Enlarged */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 500;
}

.loading i {
    font-size: 4rem; /* Enlarged icon */
    background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.loading p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Stories */
.stories-container {
  width: 100%;
  max-width: var(--feed-width);
  display: flex;
  overflow-x: auto;
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md) var(--spacing-md); /* Added horizontal padding */
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
  cursor: grab; /* Cursor to indicate draggability */
}
.stories-container.active {
    cursor: grabbing;
}
.stories-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 70px;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none; /* Prevent text selection while dragging */
}
.story-item:active {
  transform: scale(0.95);
}
.story-avatar-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2px; /* Space for gradient border */
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  margin-bottom: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.story-avatar-container.seen {
  background: var(--border-color); /* Grey for seen stories */
}
.story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--surface-color); /* White border between image and gradient */
  object-fit: cover;
  background-color: #fff;
  pointer-events: none; /* Prevent image dragging interfering with scroll */
}
.story-username {
  font-size: 0.75rem;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.story-avatar-create {
  background: linear-gradient(135deg, #00F260 0%, #0575E6 50%, #00F260 100%);
}
.story-plus-icon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.story-avatar-add-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--surface-color);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.story-viewer-modal,
.story-create-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
}
.story-viewer-backdrop,
.story-create-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}
.story-viewer-card,
.story-create-card {
  position: relative;
  width: min(460px, 92vw);
  margin: 40px auto 0;
  border-radius: 18px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.story-viewer-progress {
  display: flex;
  gap: 4px;
  padding: 10px 10px 0;
}
.story-progress-segment {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}
.story-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  transform-origin: left center;
  transform: scaleX(0);
  display: block;
}
.story-progress-fill.complete {
  transform: scaleX(1);
}
.story-viewer-header,
.story-create-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}
.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.story-viewer-username-link {
  color: inherit;
  text-decoration: none;
}
.story-viewer-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.story-viewer-close,
.story-create-close {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}
.story-viewer-body {
  width: 100%;
  background: #000;
  position: relative;
}
.story-viewer-media {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}
.story-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 16px;
  flex-wrap: wrap;
}
.story-viewer-nav {
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 22px;
  cursor: pointer;
  background: var(--bg-color);
  color: var(--text-primary);
}
.story-viewer-nav:disabled {
  opacity: 0.5;
  cursor: default;
}
.story-viewer-caption {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  padding: 12px 14px 0;
  min-height: 22px;
  word-break: break-word;
}
.story-viewer-count {
  font-size: 13px;
  color: var(--text-secondary);
}
.story-viewer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.story-viewer-action-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  background: var(--bg-color);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.story-viewer-action-icon {
  font-size: 14px;
  line-height: 1;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.story-viewer-action-count {
  font-size: 12px;
  color: var(--text-secondary);
}
.story-viewer-like {
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  background: var(--bg-color);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.story-viewer-like.active {
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.story-viewer-like:disabled {
  cursor: default;
  opacity: 0.6;
}
.story-like-icon {
  font-size: 16px;
  line-height: 1;
}
.story-like-count {
  font-size: 13px;
  min-width: 16px;
}
.story-comments-panel {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding-top 0.25s ease, padding-bottom 0.25s ease;
}
.story-comments-panel.open {
  max-height: 240px;
  padding-top: 10px;
  padding-bottom: 12px;
}
.story-viewers-inline-panel {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding-top 0.25s ease, padding-bottom 0.25s ease;
}
.story-viewers-inline-panel.open {
  max-height: 260px;
  padding-top: 10px;
  padding-bottom: 12px;
}
.story-viewers-inline-list {
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.story-comments-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.story-comments-list {
  max-height: 130px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.story-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.story-comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.story-comment-content {
  flex: 1;
  min-width: 0;
}
.story-comment-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.story-comment-text {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}
.story-comments-empty {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px 0 2px;
}
.story-comment-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.story-comment-input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-color);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
}
.story-comment-submit {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.story-viewers-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
}
.story-viewers-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}
.story-viewers-card {
  position: relative;
  width: min(380px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 48px));
  overflow: hidden;
  margin: 24px auto;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  display: flex;
  flex-direction: column;
}
.story-viewers-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.story-viewers-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
}
.story-viewers-list {
  overflow-y: auto;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.story-viewer-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  padding: 8px;
}
.story-viewer-user-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.story-viewer-user-item img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.story-viewer-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.story-viewer-user-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 700;
}
.story-viewer-user-time {
  font-size: 12px;
  color: var(--text-secondary);
}
.story-viewers-empty {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 14px 8px;
}
.story-viewer-tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.story-viewer-tap-zone.left {
  left: 0;
}
.story-viewer-tap-zone.right {
  right: 0;
}
.story-create-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.story-create-card textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-color);
  color: var(--text-primary);
  padding: 10px;
}
.story-file-picker {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-color);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.story-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.story-file-btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  cursor: pointer;
  white-space: nowrap;
}
.story-file-btn-mobile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.story-file-name {
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 100%;
}
.story-preview-shell {
  width: 100%;
  min-height: 150px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-preview-shell img,
.story-preview-shell video {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: none;
  background: #000;
}
.story-preview-shell:not(.story-preview-empty) .story-preview-image[src] {
  display: block;
}
.story-preview-shell:not(.story-preview-empty) .story-preview-video[src] {
  display: block;
}
.story-preview-shell.story-preview-empty::before {
  content: 'Anteprima contenuto';
  font-size: 13px;
  color: var(--text-secondary);
}
.story-submit-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  cursor: pointer;
}
.story-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Suggestion Card */
.suggestion-card {
  background-color: transparent;
  padding: var(--spacing-xs) 0;
  margin-bottom: 20px;
  border: none;
}
.suggestion-header {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0 var(--spacing-xs);
}
.suggestion-list {
  display: flex;
  overflow-x: auto;
  gap: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  scrollbar-width: none;
}
.suggestion-list::-webkit-scrollbar {
  display: none;
}
.suggestion-item {
  flex-shrink: 0;
  width: 140px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.suggestion-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: var(--spacing-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
}
.suggestion-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-bio {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.follow-btn {
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  border: none;
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: transform 0.2s;
}
.follow-btn:hover {
  transform: scale(1.05);
}

/* Gallery / Carousel Styles */
.gallery-container { position: relative; width: 100%; overflow: hidden; }
.gallery-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-item { flex-shrink: 0; width: 100%; scroll-snap-align: start; }
.gallery-indicators { position: absolute; bottom: 10px; left: 0; width: 100%; display: flex; justify-content: center; gap: 6px; }
.gallery-dot { width: 8px; height: 8px; border-radius: 50%; background-color: rgba(255,255,255,0.5); transition: background-color 0.2s; }
.gallery-dot.active { background-color: #fff; transform: scale(1.1); }

/* Skeleton Loading Styles */
.skeleton-post .skeleton-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #eee;
}
.skeleton-post .skeleton-text {
  height: 10px; background: #eee; margin-bottom: 5px; border-radius: 4px;
}
.skeleton-post .skeleton-image {
  width: 100%; height: 300px; background: #eee;
}
.skeleton-post {
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Dark Mode Styles */
body.dark-mode {
  --background-color: #121212;
  --surface-color: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --border-color: #333333;
}
body.dark-mode .background-container {
    opacity: 0.28;
    filter: saturate(0.78) brightness(0.62);
}
body.dark-mode .skeleton-post .skeleton-avatar,
body.dark-mode .skeleton-post .skeleton-text,
body.dark-mode .skeleton-post .skeleton-image {
    background: #333;
}

/* Comments Enhancements */
.add-comment-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.emoji-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 4px;
  transition: transform 0.2s;
}

.emoji-btn:hover {
  transform: scale(1.1);
}

.emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  margin-bottom: 8px;
}

.emoji-item {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  text-align: center;
}

.emoji-item:hover {
  background-color: rgba(0,0,0,0.05);
}

.mentions-popup {
  position: absolute;
  bottom: 100%;
  left: 40px; /* Offset for avatar/emoji */
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 200px;
  max-height: 150px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  margin-bottom: 8px;
}

.mention-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  color: var(--text-primary);
  text-align: left;
}

.mention-item:last-child {
  border-bottom: none;
}

.mention-item:hover {
  background-color: rgba(0,0,0,0.05);
}

.mention-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.mention-username {
  font-size: 0.9rem;
  font-weight: 500;
}

.mention-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: auto;
}

/* Link Preview */
.link-preview-container {
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  transition: transform 0.2s;
}

.link-preview-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.link-preview-card:hover {
  background-color: rgba(0,0,0,0.02);
}

.preview-image {
  height: 160px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-color);
}

.preview-info {
  padding: 12px;
}

.preview-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-domain {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Link Preview Skeleton */
.link-preview-skeleton {
  padding: 0;
  height: 250px;
  display: flex;
  flex-direction: column;
}

.link-preview-skeleton .skeleton-image {
  height: 160px;
  background: #eee;
  width: 100%;
}

.link-preview-skeleton .skeleton-text {
  height: 16px;
  background: #eee;
  margin: 12px 12px 4px 12px;
  border-radius: 4px;
  width: 80%;
}

.link-preview-skeleton .skeleton-text.short {
  width: 40%;
}

[data-theme="dark"] .link-preview-skeleton .skeleton-image,
[data-theme="dark"] .link-preview-skeleton .skeleton-text {
  background: #333;
}

/* View Transitions */
@view-transition {
  navigation: auto;
}

#profile-image {
  view-transition-name: profile-avatar;
}

/* --- RESTORED STYLES FOR POSTS AND NAVBAR --- */

/* Post Components */
.post-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.username {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.username:hover {
  text-decoration: underline;
}

.post-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.post-media {
  width: 100%;
  height: auto;
  display: block;
  max-height: 600px;
  object-fit: contain; /* Ensure images are fully visible */
  background-color: var(--background-color); /* Fill empty space if aspect ratio differs */
}

.post-content {
  position: relative;
}

.like-animation {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  font-size: 84px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: like-pop 700ms ease-out forwards;
}

@keyframes like-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

.post-actions {
  display: flex;
  padding: 12px 16px;
  gap: 16px;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  transition: transform 0.2s, color 0.2s;
}

.action-btn:hover {
  transform: scale(1.1);
  color: var(--text-secondary);
}

.action-btn.disabled,
.action-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.reaction-btn.active {
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.reaction-btn.active i {
    font-weight: 900; /* Solid icon */
}

.post-details {
  padding: 0 16px 16px 16px;
}

.reactions-count {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.description {
  font-size: 0.9rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.post-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.post-link {
    color: #00376b;
    text-decoration: none;
}
.post-link:hover {
    text-decoration: underline;
}

.forward-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 2200;
}

.forward-modal.open {
  opacity: 1;
  pointer-events: all;
}

.forward-modal-panel {
  width: min(100%, 460px);
  background: var(--surface-color);
  border-radius: 18px 18px 0 0;
  padding: 16px;
  transform: translateY(24px);
  transition: transform 0.24s ease;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forward-modal.open .forward-modal-panel {
  transform: translateY(0);
}

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

.forward-modal-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.forward-modal-search {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  background: var(--background-color);
  color: var(--text-primary);
}

.forward-modal-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forward-target-item {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-primary);
}

.forward-target-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.forward-target-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 2px;
}

.forward-target-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.forward-target-username {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.forward-target-action {
  margin-left: auto;
  font-size: 0.78rem;
  color: #0575E6;
  font-weight: 600;
}

.forward-modal-status,
.forward-loading-state,
.forward-empty-state {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 4px;
}

.forward-modal-open {
  overflow: hidden;
}

.view-comments-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0;
  cursor: pointer;
  margin-bottom: 8px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.comment-user-link {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.comment-user-link:hover {
  text-decoration: underline;
}

.comment-text {
  color: var(--text-primary);
  word-break: break-word;
}

.comment-like-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  font-size: 0.82rem;
}

.comment-like-btn.active {
  color: var(--text-primary);
}

.comment-like-btn.active i {
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.comment-like-count {
  min-width: 12px;
  text-align: right;
}

.comment-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.comment-input:focus {
    outline: none;
}

.post-comment-btn {
    background: none;
    border: none;
    color: #0095f6;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.5;
}
.post-comment-btn:not(:disabled) {
    opacity: 1;
}

/* Navbar */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height, 60px);
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
    transition: transform 0.3s ease-in-out;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

body.page-swipe-left {
    animation: pageSwipeLeft 0.16s ease-out forwards;
}

body.page-swipe-right {
    animation: pageSwipeRight 0.16s ease-out forwards;
}

@keyframes pageSwipeLeft {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0.88; transform: translateX(-24px); }
}

@keyframes pageSwipeRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0.88; transform: translateX(24px); }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
    padding: 8px;
    width: 20%;
    min-width: 72px;
    flex: 1 0 20%;
    position: relative;
}

.nav-item i {
    font-size: 1.4rem;
    transition: transform 0.2s;
}

.nav-item.active {
    color: var(--text-primary);
}
.nav-item.active i {
    background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 900; /* Solid */
}

.nav-item.has-unread {
    color: #0077cc;
}

.nav-item.has-unread i {
    color: #0077cc;
    transform: scale(1.08);
}

.nav-unread-badge {
    position: absolute;
    top: 6px;
    right: 20%;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ed4956;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(237, 73, 86, 0.45);
}

@media (max-width: 767px) {
    .bottom-navbar {
        height: calc(var(--nav-height, 62px) + env(safe-area-inset-bottom));
        padding: 2px 6px calc(env(safe-area-inset-bottom) + 2px);
        justify-content: flex-start;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background-color: var(--surface-color);
    }

    .nav-item {
        font-size: 0.7rem;
        gap: 3px;
        padding: 6px 4px;
    }

    .nav-item i {
        font-size: 1.25rem;
    }
}

.create-post-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}

.create-post-modal.active {
  display: flex;
}

.create-post-page {
  width: min(980px, 100%);
  max-height: min(86vh, 760px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.26);
  background: var(--surface-color);
  display: flex;
  flex-direction: column;
}

.create-post-topbar {
  height: 60px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface-color);
}

.create-post-topbar h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.create-post-top-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
}

.create-post-publish-btn {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #00F260 0%, #0575E6 100%);
}

.create-post-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.create-post-media-panel {
  background: var(--surface-color);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

body.dark-mode .create-post-media-panel {
  background: #0b0d10;
}

.create-post-dropzone {
  width: 100%;
  max-width: 700px;
  min-height: 300px;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.create-post-dropzone.dragging {
  border-color: #4da3ff;
  background: rgba(77, 163, 255, 0.1);
}

.create-post-empty {
  text-align: center;
  color: var(--text-primary);
}

.create-post-empty-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.create-post-empty h4 {
  font-size: 1.7rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.create-post-select-btn {
  border: none;
  border-radius: 9px;
  padding: 11px 18px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: #2f6fff;
}

.create-post-preview {
  width: 100%;
  position: relative;
  text-align: center;
}

.create-post-preview-media {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 10px;
}

.create-post-remove-file {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
}

.create-post-meta-panel {
  padding: 16px;
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.create-post-meta-panel textarea,
.create-post-meta-panel input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: var(--surface-color);
  color: var(--text-primary);
}

.create-post-meta-panel textarea {
  min-height: 110px;
  resize: vertical;
}

.create-post-location-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  max-height: 230px;
  overflow-y: auto;
  z-index: 25;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.create-post-location-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text-primary);
}

.create-post-location-item:hover {
  background: rgba(5, 117, 230, 0.08);
}

.create-post-location-main {
  font-size: 0.88rem;
  line-height: 1.3;
  display: block;
}

.hidden {
  display: none !important;
}

@media (min-width: 980px) {
  .create-post-body {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  }

  .create-post-meta-panel {
    border-top: none;
    border-left: 1px solid var(--border-color);
  }
}

@media (max-width: 767px) {
  .notifications-dropdown {
    right: -40px;
    width: min(340px, calc(100vw - 16px));
  }
  .header-content {
    padding: 0 10px;
    gap: 8px;
  }
  .global-user-search {
    max-width: none;
  }
  .global-user-search-box {
    height: 38px;
    padding: 0 10px;
    gap: 6px;
  }
  #global-user-search-input {
    font-size: 0.84rem;
  }
  .global-user-search-filter-btn {
    width: 24px;
    height: 24px;
  }
  .global-user-filter-row {
    grid-template-columns: 1fr;
  }
  .global-user-result-item {
    padding: 10px;
  }
  .global-user-result-item img {
    width: 38px;
    height: 38px;
  }
  .global-user-result-side {
    display: none;
  }
  #live-message-toast-host {
    top: calc(var(--header-height) + 6px);
    right: 8px;
  }
  .live-message-toast {
    min-width: 180px;
    font-size: 0.82rem;
  }
  .create-post-modal {
    padding: 10px;
  }
  .create-post-page {
    max-height: 92vh;
    border-radius: 12px;
  }
  .create-post-empty h4 {
    font-size: 1.2rem;
  }
}

/* Desktop Navbar Behavior */
@media (min-width: 768px) {
    .bottom-navbar {
        transform: translateY(100%); /* Hidden by default */
    }
    .bottom-navbar.visible {
        transform: translateY(0); /* Show when visible class is added */
    }
}
