/* =====================
   GLOBAL RESET & BASE
===================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at top left, #fde2e4 0%, transparent 40%),
    radial-gradient(circle at bottom right, #f8edeb 0%, transparent 40%),
    linear-gradient(135deg, #fff1f2, #fdecef);
  min-height: 100vh;
  color: #4a2c32;
}

/* =====================
   PAGE TITLE
===================== */
.title {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 700;
  color: #5f3b44;
  letter-spacing: 0.3px;
}

/* =====================
   CARD LIST CONTAINER
===================== */
.card-container {
  display: grid;
  grid-template-columns: 1fr; /* mobile default */
  gap: 14px;
  width: 100%;
}

/* =====================
   USER CARD
===================== */
.user-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.user-card:hover {
  background: rgba(255, 246, 247, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

.user-card:active {
  transform: scale(0.985);
}

/* =====================
   AVATAR
===================== */
.avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f28482, #ffb5a7);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  box-shadow: 0 6px 12px rgba(242, 132, 130, 0.35);
}

/* ONLINE STATUS DOT */
.avatar.online::after {
  content: "";
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  background: #7bd389;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(123, 211, 137, 0.3);
}

/* =====================
   USER INFO
===================== */
.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.username {
  font-size: 15px;
  font-weight: 600;
  color: #4a2c32;
}

.last-message {
  font-size: 12px;
  color: #8a5a62;
  opacity: 0.9;
}

/* =====================
   SUBTLE DIVIDER (OPTIONAL)
===================== */
.user-card:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 12%;
  width: 76%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 0, 0, 0.04),
    transparent
  );
}
@media (min-width: 701px) {
  .card-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: stretch;
  }
}

/* =====================
   MOBILE OPTIMIZATION
===================== */
@media (max-width: 600px) {
  body {
    padding: 14px;
  }

  .title {
    font-size: 17px;
    text-align: center;
  }

  .user-card {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .username {
    font-size: 14px;
  }

  .last-message {
    font-size: 11px;
  }
}

/* =====================
   TABLET CENTERING
===================== */
@media (min-width: 601px) and (max-width: 900px) {
  .card-container {
    max-width: 620px;
    margin: 0 auto;
  }
}

/* =====================
   ACCESSIBILITY
===================== */
.user-card:focus-visible {
  outline: 2px solid #f28482;
  outline-offset: 3px;
}
