/* ===== RESET + BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f2f2f2;
}

body {
  width: 100%;
  min-height: 100vh;
  background: white;
  color: #111;
  overflow-x: hidden;
  padding-bottom: 90px; /* space for nav footer */
}

/* ===== HEADER ===== */
.messenger_header {
  width: 100%;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding: 12px 12px 10px 12px;
}

.messenger_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.messenger_title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
}

/* ===== CHAT BOX ===== */
.chat_box {
  width: 100%;
  max-width: 440px;
  margin: 10px auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: white;
  border: 1px solid rgba(0,0,0,0.12);
}

.chat_profile {
  position: relative;
  width: 56px;
  height: 56px;
}

.profile_circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.2);
  background: #f2f2f2;
}

.chat_profile_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Online dot sitting on circumference (overlapping the profile image edge) */
.online_dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;

  background: #19c37d; /* green */
  border: 2px solid white; /* white border to stand out */
  
  /* Position: on circumference, overlapping the edge */
  bottom: 0;      /* touch bottom edge */
  right: 0;       /* touch right edge */
  
  transform: translate(25%, 25%); /* move it slightly inside */
  z-index: 5;
}


/* ===== CHAT CONTENT ===== */
.chat_content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat_top_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chat_username {
  font-size: 15px;
  font-weight: 800;
  color: #111;
}

.verified_badge img {
  height: 16px;
  width: 16px;
  object-fit: contain;
  display: block;
}

.chat_time {
  font-size: 12px;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
}

.chat_bottom_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat_last_msg_area {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,0,0,0.75);
  max-width: 80%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message_status img {
  height: 14px;
  width: 14px;
}

.last_message {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.unread_badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 50px;
  background: #111;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

/* ===== BOTTOM NAV (SAME AS INDEX) ===== */
.nav_footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 62px;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.15);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav_footer a {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav_footer img {
  height: 38px;
  width: 38px;
  object-fit: contain;
  display: block;
}

#profile_nav {
  height: 38px;
  width: 38px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25);
  overflow: hidden;
}

#profile_nav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== DESKTOP CENTER ===== */
@media (min-width: 768px) {
  body {
    max-width: 440px;
    margin: 0 auto;
    border-left: 1px solid rgba(0,0,0,0.12);
    border-right: 1px solid rgba(0,0,0,0.12);
  }

  .nav_footer {
    max-width: 440px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ===== SMALL SCREEN ===== */
@media (max-width: 360px) {
  .nav_footer img,
  #profile_nav {
    height: 34px;
    width: 34px;
  }
}
/* ===== RESET + BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f2f2f2;
}

body {
  width: 100%;
  min-height: 100vh;
  background: white;
  color: #111;
  overflow-x: hidden;
  padding-bottom: 90px; /* space for nav footer */
}

/* ===== HEADER ===== */
.messenger_header {
  width: 100%;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding: 12px 12px 10px 12px;
}

.messenger_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.messenger_title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
}

#messenger_logo {
  height: 28px;
  width: 28px;
  object-fit: contain;
  display: block;
}

.icon_btn {
  height: 38px;
  width: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon_btn img {
  height: 22px;
  width: 22px;
  object-fit: contain;
  display: block;
}

.messenger_search {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#search_chat_input {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.18);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

#search_chat_input:focus {
  border-color: rgba(0,0,0,0.55);
}

/* ===== MAIN CHAT BOX ===== */
.messenger_main {
  padding: 10px;
}

.chat_box {
  width: 100%;
  max-width: 440px;
  margin: 10px auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: white;
  border: 1px solid rgba(0,0,0,0.12);
}

/* ===== CHAT PROFILE ===== */
.chat_profile {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.profile_circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.2);
  background: #f2f2f2;
}

.chat_profile_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== ONLINE DOT ===== */
.online_dot {
  position: absolute;
  bottom: 0;
  right: 0;
  transform: translate(25%, 25%); /* pushes dot outside profile circle */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #19c37d;
  border: 3px solid white;
  z-index: 2;
}

/* ===== CHAT CONTENT ===== */
.chat_content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat_top_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chat_username {
  font-size: 15px;
  font-weight: 800;
  color: #111;
}

.verified_badge img {
  height: 16px;
  width: 16px;
  object-fit: contain;
  display: block;
}

.chat_time {
  font-size: 12px;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
}

.chat_bottom_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat_last_msg_area {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(0,0,0,0.75);
  max-width: 80%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message_status img {
  height: 14px;
  width: 14px;
}

.last_message {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.unread_badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 50px;
  background: #111;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

/* ===== BOTTOM NAV (SAME AS INDEX/EXPLORE) ===== */
.nav_footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 62px;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.15);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav_footer a {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav_footer img {
  height: 38px;
  width: 38px;
  object-fit: contain;
  display: block;
}

#profile_nav {
  height: 42px;
  width: 42px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25);
  overflow: hidden;
}

#profile_nav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== DESKTOP CENTER ===== */
@media (min-width: 768px) {
  body {
    max-width: 440px;
    margin: 0 auto;
    border-left: 1px solid rgba(0,0,0,0.12);
    border-right: 1px solid rgba(0,0,0,0.12);
  }

  .nav_footer {
    max-width: 440px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ===== SMALL SCREEN SAFETY ===== */
@media (max-width: 360px) {
  .nav_footer img,
  #profile_nav {
    height: 34px;
    width: 34px;
  }
}
.chat_profile {
  position: relative;   /* make this the reference for absolute positioning */
  width: 56px;
  height: 56px;
}

/* Profile circle */
.profile_circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;   /* only affects the image */
  border: 1px solid rgba(0,0,0,0.2);
  background: #f2f2f2;
}

.chat_profile_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Online green dot */
.online_dot {
  position: absolute;  /* position relative to chat_profile */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #19c37d;
  border: 2px solid white;
  bottom: 3px;           /* aligns at bottom right */
  right: 3px;
  z-index: 2;
}
