/* =========================================================
   ChrisEmm Connect – Freundesystem 1.0.3
   ========================================================= */

.profile-social-actions {
    margin-top: 22px;
}

.profile-friend-action-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(130, 147, 184, 0.18);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
}

.profile-action-button {
    min-height: 42px;
    border-radius: 12px;
}

.profile-friend-state {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 0.77rem;
    font-weight: 850;
}

.profile-friend-state.is-pending {
    color: #cdd5ff;
    background: rgba(109, 124, 255, 0.13);
}

.profile-friend-state.is-incoming {
    color: #ffe0a2;
    background: rgba(255, 177, 55, 0.12);
}

.profile-friend-state.is-friend {
    color: #8de9bf;
    background: rgba(63, 210, 148, 0.11);
}

.profile-guest-friend-note {
    margin: 0;
    padding: 13px 15px;
    border: 1px solid rgba(130, 147, 184, 0.16);
    border-radius: 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.025);
}

.profile-friends-section {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(130, 147, 184, 0.18);
    border-radius: 17px;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0.012)
        );
}

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

.profile-section-heading h2 {
    margin: 0;
    font-size: 1.05rem;
}

.profile-section-heading > span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: #cbd4eb;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.72rem;
    font-weight: 800;
}

.profile-friend-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
}

.profile-friend-card {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    padding: 15px 12px;
    border: 1px solid rgba(130, 147, 184, 0.17);
    border-radius: 15px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.025);
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.profile-friend-card:hover {
    transform: translateY(-2px);
    border-color: rgba(109, 124, 255, 0.52);
    background: rgba(109, 124, 255, 0.07);
}

.profile-friend-avatar {
    position: relative;
    display: block;
    width: 68px;
    height: 68px;
}

.profile-friend-avatar img {
    display: block;
    width: 68px;
    height: 68px;
    object-fit: cover;
    border: 2px solid rgba(118, 136, 241, 0.32);
    border-radius: 18px;
}

.profile-friend-presence {
    position: absolute;
    right: -2px;
    bottom: 2px;
    width: 13px;
    height: 13px;
    border: 3px solid #121d34;
    border-radius: 50%;
}

.profile-friend-presence.is-online {
    background: #54d7a1;
}

.profile-friend-presence.is-offline {
    background: #68758c;
}

.profile-friend-name {
    max-width: 100%;
    overflow: hidden;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-friend-card small {
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-request-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(130, 147, 184, 0.14);
}

.profile-request-row:last-child {
    border-bottom: 0;
}

.profile-request-row form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-private-chat {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(130, 147, 184, 0.18);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.02);
}

.profile-private-message-list {
    display: grid;
    gap: 10px;
    max-height: 440px;
    padding: 4px;
    overflow-y: auto;
}

.profile-private-message-list article {
    max-width: 78%;
    padding: 11px 13px;
    border: 1px solid rgba(130, 147, 184, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.profile-private-message-list article.is-own {
    margin-left: auto;
    border-color: rgba(109, 124, 255, 0.25);
    background: rgba(109, 124, 255, 0.12);
}

.profile-private-message-list article header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.7rem;
}

.profile-private-message-list article time {
    color: var(--muted);
}

.profile-private-message-list article p {
    margin: 7px 0 0;
    overflow-wrap: anywhere;
}

.profile-private-message-list article img {
    display: block;
    max-width: 100%;
    max-height: 330px;
    margin-top: 9px;
    border-radius: 12px;
    object-fit: contain;
}

.profile-private-message-form {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(130, 147, 184, 0.14);
}

.profile-private-message-form textarea {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 92px;
    resize: vertical;
}

.profile-private-message-form label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px dashed rgba(130, 147, 184, 0.28);
    border-radius: 12px;
    color: var(--muted);
    cursor: pointer;
}

.profile-private-message-form label span {
    font-size: 0.72rem;
}

.profile-private-message-form input[type="file"] {
    min-width: 0;
}

.profile-private-upload-preview {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border: 1px solid rgba(109, 124, 255, 0.2);
    border-radius: 12px;
    background: rgba(109, 124, 255, 0.06);
}

.profile-private-upload-preview[hidden] {
    display: none;
}

.profile-private-upload-preview img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 10px;
}

.profile-private-upload-preview span {
    min-width: 0;
    overflow: hidden;
    color: #d8dfef;
    font-size: 0.73rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .profile-friend-action-form {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-action-button,
    .profile-friend-state {
        justify-content: center;
        width: 100%;
    }

    .profile-request-row {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-request-row form {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .profile-private-message-list article {
        max-width: 94%;
    }

    .profile-private-message-form {
        grid-template-columns: 1fr;
    }

    .profile-private-message-form textarea,
    .profile-private-upload-preview {
        grid-column: 1;
    }
}
