/* Стили для сообщений в состоянии "отправляется" */
.message-bubble.pending {
    opacity: 0.6;
}

/* Контейнер для загружающегося медиа в чате */
.chat-media-uploading-container {
    position: relative;
    display: inline-block;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    background: transparent;
}

/* Картинка (или кадр видео), которая грузится - размыта и полупрозрачна */
.chat-media-uploading-img {
    display: block;
    max-width: 25vh;
    max-height: 25vh;
    width: auto;
    height: auto;
    border-radius: 18px;
    filter: blur(4px);
    opacity: 0.7;
    object-fit: cover;
}

/* Оверлей со спиннером поверх картинки */
.chat-media-uploading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    transition: opacity 0.4s ease;
}

/* Текст процентов */
.chat-media-uploading-text {
    color: white;
    font-size: 0.85em;
    font-weight: 500;
    margin-top: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Плавное появление финального медиа контента */
@keyframes mediaCrossfade {
    0% { opacity: 0.5; filter: blur(4px); transform: scale(0.98); }
    100% { opacity: 1; filter: blur(0); transform: scale(1); }
}

.media-fade-in {
    animation: mediaCrossfade 0.5s ease-out forwards;
}

/* Сам кружок загрузки */
.upload-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Индикатор на кнопке скрепки */
.paperclip-button.uploading {
    pointer-events: none;
}

.paperclip-button.uploading i {
    animation: pulse 1.5s infinite;
    color: var(--accent-red, #ff4757);
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}
