/* ================================== */
/* ПАНЕЛЬ ОТВЕТА (REPLY BAR) – поднята над InputArea */
/* ================================== */
.reply-bar {
    position: absolute;
    bottom: 72px;           /* отступ, чтобы не перекрывать панель ввода */
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    padding: 8px 16px;
    z-index: var(--z-sticky);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
}

/* Содержимое панели ответа */
.reply-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    overflow: hidden;
}

.reply-bar-content i.fa-reply {
    color: var(--primary);
    font-size: 1.2rem;
    opacity: 0.9;
}

.reply-sender {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.reply-preview-text,
.reply-full-text {
    font-size: 13px;
    color: var(--text);
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Для изображений, видео, иконок в превью */
.reply-preview-image,
.reply-preview-video,
.reply-preview-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.reply-preview-img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.reply-file-name {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Кнопка закрытия */
.reply-bar .btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    line-height: 1;
}

.reply-bar .btn-close:hover {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text);
}

/* ================================== */
/* ПРЕВЬЮ ОТВЕТА ВНУТРИ СООБЩЕНИЯ     */
/* ================================== */
.reply-indicator-compact {
    background: var(--bg-hover);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    padding: 6px 10px;
    border-left: 3px solid var(--primary);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.reply-indicator-compact:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

body.light-theme .reply-indicator-compact {
    background: rgba(0, 0, 0, 0.04);
}

body.light-theme .reply-indicator-compact:hover {
    background: rgba(0, 0, 0, 0.08);
}

.reply-preview-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Стили для разных типов контента в ответе */
.reply-compact-video,
.reply-compact-image,
.reply-compact-file,
.reply-compact-sticker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reply-compact-media {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.reply-compact-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary);
}

.reply-full-text {
    font-size: 13px;
    color: var(--text) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Для светлой темы используем основной цвет текста */
body.light-theme .reply-full-text {
    color: var(--text) !important;
}

/* Обёртка для аудио в превью ответа: вертикальное расположение и отступы */
.reply-audio-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.reply-audio-wrapper .reply-full-text {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    white-space: normal;
    word-break: break-word;
    flex: none;
    text-align: left;
}

/* Адаптация под мобильные устройства */
@media (max-width: 768px) {
    .reply-bar {
        bottom: 68px;
        left: 12px;
        right: 12px;
        padding: 6px 12px;
    }
    .reply-sender {
        font-size: 11px;
    }
    .reply-full-text {
        font-size: 11px;
    }
}

/* Уважение prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .reply-bar,
    .reply-indicator-compact {
        transition: none;
    }
    .reply-indicator-compact:hover {
        transform: none;
    }
}