/* ----------------- GENERAL ----------------- */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background:white;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Update these in your <style> tag */
#loading-screen {
  display: none; /* Changed from flex to none */
}

#main-ui {
  display: flex; /* Changed from none to flex */
  flex: 1;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}


/* ----------------- TOP BAR ----------------- */
#top-bar {
  padding: 12px 16px;
  font-size: 24px;
  font-weight: bold;
  color: black;
  border-bottom: 1px solid #ddd;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

#search-bar {
  margin: 8px 16px;
  padding:8px 12px;
  border-radius:20px;
  border:1px solid #ccc;
  font-size:14px;
  width: calc(100% - 32px);
}

/* ----------------- USERS LIST ----------------- */
#users-list {
  flex:1;
  overflow-y:auto;
  margin: 0 16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding-bottom: 70px;
}

/* ----------------- FCARD ----------------- */
.fcard {
  background:white;
  border-radius:10px;
  padding:12px;
  display:flex;
  align-items:center;
  gap:12px;
  box-shadow:0 2px 5px rgba(0,0,0,0.1);
  cursor:pointer;
}

.pfp {
  width:50px;
  height:50px;
  border-radius:50%;
  object-fit:cover;
  background:black;
  color:white;
  display:flex;
  justify-content:center;
  align-items:center;
  font-weight:bold;
  font-size:18px;
}

.username { font-size:16px; font-weight:bold; }
.userid { font-size:12px; color:#555; }

/* ----------------- MODAL ----------------- */
#profile-modal {
  position:fixed;
  top:0; left:0;
  width:100%; height:100%;
  background:rgba(0,0,0,0.85);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:2000;
}
#profile-modal img { width:75%; max-width:300px; border-radius:50%; }

/* ----------------- ADD BUTTON ----------------- */
#add-btn {
  position:fixed;
  right:16px;
  bottom:80px;
  width:55px;
  height:55px;
  border-radius:50%;
  background:#2196f3;
  color:white;
  border:none;
  font-size:28px;
  font-weight:bold;
  display:flex;
  justify-content:center;
  align-items:center;
  box-shadow:0 3px 6px rgba(0,0,0,0.2);
}

/* ----------------- BOTTOM NAV ----------------- */
#bottom-nav {
  position:fixed;
  bottom:0;
  left:0;
  width:100%;
  height:60px;
  display:flex;
  border-top:1px solid #ddd;
  background:white;
}

.nav-item {
  flex:1;
  text-align:center;
  font-size:14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  color:#555;
}

.nav-item.active { color:#2196f3; font-weight:bold; }

/* ----------------- UPDATE LOG ----------------- */
#update-log {
  position:fixed;
  bottom:65px;
  left:0;
  width:100%;
  text-align:center;
  font-size:14px;
  color:#555;
}
/* ----------------- THREE DOTS MENU ----------------- */
#menu-btn {
  cursor: pointer;
  font-size: 24px;
  padding: 4px 8px;
  border: none;
  background: none;
}

#menu-dropdown {
  position: absolute;
  top: 50px; /* below the top bar */
  right: 16px; /* aligned with button */
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  min-width: 160px;
  z-index: 3000;
}

.menu-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background 0.2s;
}

.menu-item:hover {
  background: #f0f0f0;
}
.last-msg {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.last-msg.unread {
  color: #2196f3;
  font-weight: 600;
}
#menu-container {
  position: relative;
  display: inline-block;
}

#menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 999;
  min-width: 150px;
}

#menu-dropdown.show {
  display: block;
}

.menu-item {
  padding: 10px;
  cursor: pointer;
}

.menu-item:hover {
  background: #f2f2f2;
}
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  color: black;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}