/* Styling for the reply preview bar above the message input */
.reply-preview-container {
    background-color: var(--background-secondary);
    padding: 8px 12px;
    margin: 0 10px 8px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--accent-color);
    animation: slideInDown 0.2s ease-out;
}

.reply-preview-content {
    overflow: hidden; /* This is key for truncation */
    flex-grow: 1;
}

.reply-preview-header {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

#reply-preview-sender {
    color: var(--accent-color);
    font-weight: 700;
}

.reply-preview-text {
    font-size: 0.9rem;
    color: var(--text-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Fix emoji size in preview bar */
.reply-preview-text .emoji {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.2em; /* Better alignment with text */
}


.cancel-reply-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 8px;
    margin-left: 8px;
    align-self: flex-start; /* Align to the top */
    line-height: 1;
}

.cancel-reply-btn:hover {
    color: var(--text-normal);
}

/* Keyframes for animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Styling for the rendered reply block inside a message bubble */
.reply-preview-in-message {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    cursor: pointer;
    background-color: rgba(0,0,0,0.05); /* Very subtle background */
    padding: 4px 8px;
    border-radius: 8px;
    max-width: 400px; /* Or other max-width */
}

/* For light theme */
.light-theme .reply-preview-in-message {
     background-color: rgba(0,0,0,0.05);
}
/* For dark/aurora theme */
.dark-theme .reply-preview-in-message, .aurora-theme .reply-preview-in-message {
     background-color: rgba(255,255,255,0.05);
}


.reply-preview-in-message .reply-bar {
    width: 2px;
    background-color: var(--accent-color);
    align-self: stretch; /* Make the bar full height of the container */
    margin-right: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.reply-preview-in-message .reply-content {
    overflow: hidden;
    font-size: 0.85rem;
}

.reply-preview-in-message .reply-sender {
    font-weight: 700;
    color: var(--accent-color);
}

.reply-preview-in-message .reply-text {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* THIS IS THE FIX for huge emojis in sent replies */
.reply-preview-in-message .reply-text .emoji {
    width: 1em;
    height: 1em;
    vertical-align: -0.1em;
}
