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

body {
    font-family: Arial, sans-serif;
    background: #f4f8fd;
    color: #172b45;
}

/* HEADER */

.friends-header {
    background: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #e5edf6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eaf4ff;
    color: #168bfa;
    text-decoration: none;
    display: grid;
    place-items: center;
    font-size: 28px;
}

.friends-header h2 {
    font-size: 19px;
}

.friends-header p {
    color: #8493a7;
    font-size: 12px;
    margin-top: 4px;
}

/* MAIN */

.friends-container {
    max-width: 850px;
    margin: 20px auto;
    padding: 0 14px 30px;
}

.friends-intro {
    margin-bottom: 20px;
}

.friends-intro h2 {
    font-size: 21px;
    margin-bottom: 6px;
}

.friends-intro p {
    font-size: 13px;
    color: #8493a7;
}

/* SEARCH */

.friends-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 13px;
    border: 1px solid #e0eaf5;
    border-radius: 12px;
    margin-bottom: 25px;
}

.friends-search-box span {
    font-size: 23px;
    color: #168bfa;
}

.friends-search-box input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

/* HEADING */

.friends-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.friends-heading h3 {
    font-size: 16px;
}

.friends-heading span {
    font-size: 12px;
    color: #168bfa;
}

/* USER GRID */

.friends-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

/* USER CARD */

.friend-card {
    background: white;
    border: 1px solid #e5edf6;
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    min-width: 0;
}

/* CIRCULAR PROFILE IMAGE */

.friend-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5f2ff;
    display: block;
    margin: 0 auto 12px;
}

/* NAME */

.friend-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

/* USERNAME */

.friend-username {
    color: #8997a9;
    font-size: 12px;
    margin-bottom: 16px;
    overflow-wrap: anywhere;
}

/* BUTTONS */

.friend-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.friend-actions button,
.friend-actions a {
    width: 100%;
    min-height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

/* FOLLOW */

.follow-button {
    background: #168bfa;
    color: white;
}

.follow-button.following {
    background: #eaf4ff;
    color: #168bfa;
}

/* VIEW PROFILE */

.view-profile {
    background: #f0f3f7;
    color: #42536a;
}

/* ADD FRIEND */

.add-friend-button {
    background: #e8f7ee;
    color: #168b52;
}

/* MESSAGE */

.message-button {
    background: #168bfa;
    color: white;
}

/* DISABLED */

.friend-actions button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* LOADING */

.loading-message,
.empty-friends {
    grid-column: 1 / -1;
    padding: 30px 15px;
    background: white;
    border-radius: 12px;
    text-align: center;
    color: #8493a7;
    font-size: 13px;
}

/* RESPONSIVE */

@media (max-width: 350px) {
    .friends-list {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 600px) {
    .friends-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 800px) {
    .friends-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}