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

body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    color: #1c1e21;
}

/* HEADER */

.topbar {
    height: 60px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.brand {
    font-size: 25px;
    font-weight: 900;
    color: #1877f2;
    letter-spacing: 1px;
}

.topbar nav {
    display: flex;
    gap: 30px;
}

.topbar nav a {
    text-decoration: none;
    color: #606770;
    font-weight: 600;
    font-size: 14px;
}

.topbar nav a:hover {
    color: #1877f2;
}

.settings-icon {
    font-size: 24px;
    text-decoration: none;
    color: #1877f2;
}


/* MAIN */

.profile-container {
    max-width: 1050px;
    margin: 25px auto;
    padding: 0 15px;
}


/* COVER */

.cover-section {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cover-photo {
    height: 260px;
    background: linear-gradient(120deg, #1877f2, #7db9ff);
    background-size: cover;
    background-position: center;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 35px;
    margin-top: -65px;
    position: relative;
}

.avatar-wrapper {
    width: 145px;
    height: 145px;
    border: 5px solid white;
    border-radius: 50%;
    background: #e4e6eb;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-heading {
    padding-top: 65px;
}

.profile-heading h1 {
    font-size: 27px;
    margin-bottom: 5px;
}

.profile-heading p {
    color: #65676b;
    font-size: 14px;
    margin-top: 6px;
}


/* STATS */

.profile-stats {
    display: flex;
    gap: 50px;
    padding: 25px 35px;
    margin-top: 10px;
    border-top: 1px solid #eee;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat strong {
    font-size: 21px;
    color: #1877f2;
}

.stat span {
    color: #65676b;
    font-size: 13px;
}


/* EDIT ACCOUNT */

.edit-account {
    background: white;
    padding: 22px;
    margin-top: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.edit-icon {
    width: 50px;
    height: 50px;
    background: #e7f0ff;
    color: #1877f2;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 25px;
}

.edit-text h3 {
    font-size: 17px;
    margin-bottom: 7px;
}

.edit-text p {
    color: #65676b;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.edit-text a {
    display: inline-block;
    color: #1877f2;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
}

.edit-text a:hover {
    text-decoration: underline;
}


/* POSTS */

.posts-section {
    margin-top: 25px;
}

.section-title {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.section-title h2 {
    font-size: 19px;
}

.post-card {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.post-header img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.post-header strong {
    font-size: 14px;
}

.post-date {
    display: block;
    font-size: 12px;
    color: #65676b;
    margin-top: 4px;
}

.post-content {
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.post-media {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 15px;
    background: #f0f2f5;
}

.loading,
.empty-posts {
    background: white;
    padding: 35px;
    text-align: center;
    color: #65676b;
    border-radius: 10px;
}


/* MOBILE */

@media(max-width: 650px) {

    .topbar {
        padding: 0 15px;
    }

    .topbar nav {
        gap: 12px;
    }

    .topbar nav a {
        font-size: 11px;
    }

    .brand {
        font-size: 20px;
    }

    .settings-icon {
        font-size: 21px;
    }

    .cover-photo {
        height: 180px;
    }

    .profile-main {
        padding: 0 15px;
        gap: 12px;
        margin-top: -48px;
    }

    .avatar-wrapper {
        width: 105px;
        height: 105px;
    }

    .profile-heading {
        padding-top: 55px;
    }

    .profile-heading h1 {
        font-size: 19px;
    }

    .profile-heading p {
        font-size: 12px;
    }

    .profile-stats {
        gap: 30px;
        padding: 20px 15px;
    }

    .stat strong {
        font-size: 18px;
    }

    .edit-account {
        padding: 17px;
        align-items: flex-start;
    }

    .edit-text h3 {
        font-size: 15px;
    }

    .edit-text p {
        font-size: 12px;
    }

}
.delete-post-btn {
    margin-left: auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #ffe5e5;
    color: #e03131;
    font-size: 25px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-post-btn:hover {
    background: #ffcccc;
}

.delete-post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* FOLLOW BUTTON */

.profile-follow-area {
    margin-top: 15px;
}

.profile-follow-button {
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.profile-follow-button:hover {
    background: #0866d8;
}

.profile-follow-button.following {
    background: #e8edf3;
    color: #26364f;
    border: 1px solid #d5deea;
}

.profile-follow-button.following:hover {
    background: #dce4ed;
}

.profile-follow-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* PROFILE STATISTICS */

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 15px;
}

.profile-stats .stat {
    text-align: center;
    min-width: 65px;
}

.profile-stats .stat strong {
    display: block;
    font-size: 20px;
    color: #1877f2;
}

.profile-stats .stat span {
    font-size: 12px;
    color: #68778b;
}

@media (max-width: 480px) {
    .profile-follow-button {
        padding: 8px 22px;
        font-size: 13px;
    }

    .profile-stats {
        gap: 10px;
    }

    .profile-stats .stat strong {
        font-size: 17px;
    }
}

.logout-btn {
    display: inline-block;
    background: red;
    color: blue;
    padding: 10px 22px;
    border-radius: 7px;
    text-decoration: none;
    font-weight: bold;
}