/* --- Sidebar Styles --- */
.sidebar-left a, .sidebar-right a, .sidebar-left .nav-item, .sidebar-right .nav-item {
  color: var(--sidebarText, #111);
}

.sidebar-left, .sidebar-right {
  top: 0;
  position: fixed;
  height: 100vh;
  padding: 1em;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--sidebar, #f7f7f7);
  color: var(--sidebarText, #111);
  transition: background 2s cubic-bezier(.4,1,.4,1), color 2s cubic-bezier(.4,1,.4,1);
  z-index: 5
}

.sidebar-left {
  left: 0;
  width: 16.5em ;
  border-right: 1px solid var(--accent, #ddd);
  transition: transform 0.3s cubic-bezier(.4,1,.4,1), box-shadow 0.3s
}

.sidebar-right {
  right: 0;
  width: 18em;
  right: 0;
  border-left: 1px solid var(--accent, #ddd)
}

/* Sidebar animation */

/* Animations */
@keyframes slideInSidebar {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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


/* Rules */
.sidebar-slidein {
  display: flex !important;
  animation: slideInSidebar 0.3s ease-out forwards;
}

.sidebar-slideout {
  display: flex !important;
  pointer-events: auto;
  animation: slideOutSidebar 0.25s ease-in forwards;
}


a, .hashtag, .trend-item {
  color: var(--sidebar);
  transition: color 0.8s;
}

.button, .hashtag, .trend-item, .video-profile, .video-desc {
  border-color: var(--accent);
}

.profile img { width: 40px; height: 40px; border-radius: 25%; }
.display-name { font-weight: bold; margin-right: 4px; }
.balance { display: flex; align-items: center; gap: 5px; }
.balance span { font-size: 18px; color: #FFD700; }
.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.nav-item, .profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.profile { width: 100%; }

.profile-buttons {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  gap: 1em;
}

.profile-action-btn {
  background: linear-gradient(90deg, var(--accent), #8a2be2);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-grow: 1; /* Allow buttons to grow and fill available space */
  min-width: 0; /* Allow flex item to shrink below content size */
}

.profile-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
  background: linear-gradient(90deg, var(--link), #6a0dad);
}

.profile .profile-avatar {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent);
  background: transparent;
}

.material-symbols-outlined.badge {
  color: var(--accent);
}

img.badge {
	color: var(--accent);
	border-radius: 4px;
  margin: 0 6px;
}

.profile .balance {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item:hover, .profile:hover {
  color: var(--sidebarText);
  background: var(--background, var(--accent));
}

.nav-create {
  background: linear-gradient(90deg, var(--accent) 60%, var(--text) 100%);
  color: var(--sidebar, white) !important;
  font-weight: bold;
  font-size: 1.13em;
  box-shadow: 0 2px 12px rgba(79,140,255,0.13);
  border-radius: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.nav-create .material-icons {
  font-size: 2.1em;
  color: var(--sidebar, white);
}
.nav-create:hover {
  background: linear-gradient(90deg, #6ee7b7 40%, #4f8cff 100%);
  color: #fff;
}

/* --- Search and hash tags --- */
.search {
  padding: 10px;
  border-radius: 8px;
  border: none;
  width: 100%;
  transition: background 0.5s, border 0.5s;
  outline: none;
}

.search::placeholder {
  color: var(--link);
}

.search:focus {
  background: #e3e8f0;
  border-color: #bbb;
  outline: none;
}

.search-bar-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 0.5em;
}

.search-bar-wrapper .search {
  color: var(--accent);
  width: 100%;
  padding-right: 38px;
}

.search-bar-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.3em;
  pointer-events: none;
  user-select: none;
}

.hashtags, .trend-section {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hashtag, .trend-item {
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--accent);
  white-space: nowrap;
}

/* --- Latest and Trending --- */
.hot-topics {
  font-weight: 600;
  font-size: 1.1em;
  color: var(--sidebarText, #111);
}

/* --- Hot Spaces --- */
.hot-space-card {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 7px 14px 7px 8px;
  width: 180px;
  max-width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: background 0.2s;
  cursor: pointer;
  border: 1px solid #e3e8f0;
}

.hot-space-card:hover {
  background: var(--accent)
}

.hot-space-icon {
  font-size: 1.5em;
  color: var(--link, #4f8cff);
  flex-shrink: 0;
}

.hot-space-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hot-space-name {
  font-weight: bold;
  font-size: 1em;
  color: var(--sidebarText, #222);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hot-space-members {
  font-size: 0.92em;
  color: var(--link);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hot-spaces-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 100vw;
  overflow-x: auto;
}

.hotspace-cards-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
}

.hotspace-carousel-arrow {
  background: none;
  border: none;
  color: var(--sidebarText, #888);
  font-size: 1.7rem;
  cursor: pointer;
  padding: 0 2px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  height: 32px;
  width: 32px;
  border-radius: 50%;
  justify-content: center;
}
.hotspace-carousel-arrow:hover {
  color: var(--link, #4f8cff);
  background: rgba(79,140,255,0.08);
}

.trend-section.suggested-creators {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.trend-avatar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-avatar .creator-name {
  position: absolute;
  left: 1px;
  bottom: 1px;
  font-size: 6px;
  color: var(--sidebarText, #fff);
  background: var(--sidebar, #222b);
  border-radius: 6px;
  padding: 1px 6px 1px 4px;
  opacity: 0.82;
  pointer-events: none;
  z-index: 2;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Latest post carousel styles --- */
#latest-posts-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 72px;
  margin-bottom: 8px;
}

.latest-carousel-arrow {
  background: none;
  border: none;
  color: var(--sidebarText, #888);
  font-size: 2rem;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  height: 56px;
  width: 32px;
  border-radius: 50%;
}
.latest-carousel-arrow:hover {
  color: var(--link, #4f8cff);
  background: rgba(79,140,255,0.08);
}

.latest-post-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 0;
  justify-content: space-around;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.latest-post-image {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  flex-shrink: 0;
}

.latest-post-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.latest-post-desc {
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  color: var(--sidebarText, #222);
  word-break: break-word;
  max-width: 16em;
  max-height: 2.4em; /* 2 lines at line-height 1.2 */
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.latest-post-meta {
  font-size: 0.95em;
  color: var(--link);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.latest-post-profile-name {
  font-size: 14px;
  color: var(--sidebarText, #222);
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7em;
}

.scroll-horizontal { display: flex; overflow-x: auto; gap: 10px; }

.trend-icon { width: 40px; height: 40px; border-radius: 20%; background: inherit; display: flex; align-items: center; justify-content: center; }
.trend-avatar img { width: 40px; height: 40px; border-radius: 20%; background: inherit; display: flex; align-items: center; justify-content: center; }

@media screen and (max-width: 1200px) and (orientation: portrait){
  .sidebar-left, .sidebar-right { display: none; }
  .sidebar-left { transform: translateX(-110vw); }

  .nav-item.mobile-ambiguous, .profile-buttons {
    display: none;
  }
}

/* --- Phone Viewport --- */
@media screen and (max-width: 499px) and (orientation: portrait){

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

  .sidebar-left {
    transform: scale(95%);
    padding: 1.5em;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: 80vw;
    max-width: 340px;
    min-width: 220px;
    background: var(--sidebar, #fff);
    z-index: 4;
    box-shadow: 2px 0 16px rgba(0,0,0,0.18);
    margin: -1em 0 0 -1em;
  }

  .sidebar-left.sidebar-mobile-visible {
    transform: translateX(0);
    box-shadow: 2px 0 16px rgba(0,0,0,0.18);
  }

  .hot-space-card,
  .hotspace-cards-vertical,
  #hot-spaces-list {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .latest-post-card {
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
}
