#wall { margin-bottom: 35px; }

#message-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 650px;
    background-color: var(--white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

#message-form label {
    font-weight: bold;
    color: var(--dark-pink);
}

#message-form textarea {
    width: 100%;
    min-height: 130px;
    padding: 15px;
    border: 1px solid #edc4d4;
    border-radius: var(--radius-sm);
    font: inherit;
    resize: vertical;
    outline: none;
}

#message-form textarea:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(217, 79, 131, 0.12);
}

#messages-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
    gap: 16px;
    margin-top: 25px;
    align-items: start;
}

#messages-list article {
    background: var(--white);
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid #f5d5e2;
    box-shadow: var(--shadow-sm);
    overflow-wrap: anywhere;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#messages-list article::before {
    content: "♥";
    display: block;
    color: var(--pink);
    font-size: 25px;
    margin-bottom: 12px;
}

#messages-list article p {
    color: #555555;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin: 0;
}

#messages-list article:hover {
    transform: translateY(-4px);
    border-color: #e8a5bf;
    box-shadow: var(--shadow-md);
}

@media (hover: none) {
    #messages-list article:hover { transform: none; }
}

@media (max-width: 600px) {
    #messages-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    #messages-list article { padding: 12px; }
    #messages-list article p { font-size: 14px; line-height: 1.7; }
}
/* رسائل الحالة (تحميل/فراغ/خطأ) تمتد على عمودَي الشبكة وتتوسط */
#messages-list > p {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    padding: 20px;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    20%      { transform: scale(1.18); }
    40%      { transform: scale(1); }
    60%      { transform: scale(1.12); }
    80%      { transform: scale(1); }
}

#messages-list article:hover::before {
    animation: heartbeat 1.2s ease-in-out infinite;
    transform-origin: center;
}

@media (hover: none), (prefers-reduced-motion: reduce) {
    #messages-list article:hover::before { animation: none; }
}
