/* ===================================
   CHAT & MESSAGING STYLES
   Consistent UI for all chat components
   =================================== */

/* ===================================
   CHAT CONTAINER
   =================================== */
.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    max-height: 800px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card, #ffffff);
    border: 2px solid var(--border-color, #e0e8d5);
    box-shadow: 0 4px 20px rgba(107, 142, 35, 0.08);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--bg-secondary, #f5f8f0) 0%, var(--bg-tertiary, #eef3e8) 100%);
    border-bottom: 2px solid var(--border-color, #e0e8d5);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    position: relative;
    flex-shrink: 0;
}

.chat-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #e0e8d5);
    transition: transform 0.2s ease;
}

.chat-avatar:hover img {
    transform: scale(1.05);
}

.chat-avatar .online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4caf50;
    border: 2px solid var(--bg-card, #ffffff);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.chat-avatar .online-indicator.offline {
    background: #9e9e9e;
}

.chat-user-details h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #2a3a2a);
}

.chat-user-details small {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

/* ===================================
   MESSAGES CONTAINER
   =================================== */
.messages-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(180deg, var(--bg-card, #ffffff) 0%, var(--bg-secondary, #fafcf8) 100%);
    scroll-behavior: smooth;
}

.messages-wrapper::-webkit-scrollbar {
    width: 6px;
}

.messages-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.messages-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color, #d0dcc5);
    border-radius: 3px;
}

.messages-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--olive-primary, #6B8E23);
}

/* Date Separator */
.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    gap: 16px;
}

.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color, #e0e8d5), transparent);
}

.date-separator span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    background: var(--bg-secondary, #f5f8f0);
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ===================================
   MESSAGE BUBBLES
   =================================== */
.message-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.message-group.sent {
    align-items: flex-end;
}

.message-group.received {
    align-items: flex-start;
}

.message-bubble {
    max-width: 75%;
    min-width: 80px;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    animation: messageSlide 0.3s ease;
    word-wrap: break-word;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.sent {
    background: linear-gradient(135deg, var(--olive-primary, #6B8E23) 0%, var(--olive-dark, #5a7a1f) 100%);
    color: #ffffff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(107, 142, 35, 0.25);
}

.message-bubble.received {
    background: var(--bg-secondary, #f0f2f5);
    color: var(--text-primary, #2a3a2a);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message-bubble .sender-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--olive-primary, #6B8E23);
    margin-bottom: 4px;
    display: block;
}

.message-bubble.sent .sender-name {
    color: rgba(255, 255, 255, 0.9);
}

.message-bubble .message-content {
    font-size: 0.925rem;
    line-height: 1.5;
    margin: 0;
}

.message-bubble .message-time {
    font-size: 0.7rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.message-bubble.sent .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.message-bubble.received .message-time {
    color: var(--text-muted, #6c757d);
}

.message-bubble .message-status {
    font-size: 0.75rem;
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
}

.message-bubble.sent .message-status.sent {
    color: rgba(255, 255, 255, 0.6);
}

.message-bubble.sent .message-status.delivered {
    color: rgba(255, 255, 255, 0.8);
}

.message-bubble.sent .message-status.read {
    color: #64b5f6;
}

.message-bubble.sent .message-status.read i {
    font-size: 0.8rem;
}

/* ===================================
   MESSAGE IMAGES
   =================================== */
.message-images {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.message-images.single {
    grid-template-columns: 1fr;
    max-width: 280px;
}

.message-images.double {
    grid-template-columns: repeat(2, 1fr);
    max-width: 280px;
}

.message-images.multiple {
    grid-template-columns: repeat(2, 1fr);
    max-width: 280px;
}

.message-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.message-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.message-image-wrapper:hover img {
    transform: scale(1.05);
}

.message-image-wrapper .image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-image-wrapper:hover .image-overlay {
    opacity: 1;
}

.message-image-wrapper .image-overlay i {
    color: white;
    font-size: 1.5rem;
}

.message-images .more-images {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

/* ===================================
   MESSAGE INPUT AREA
   =================================== */
.message-input-wrapper {
    padding: 12px 16px;
    background: var(--input-bg, #f0f2f5);
    border-top: 1px solid var(--border-color, #e0e8d5);
}

.typing-indicator {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    padding: 4px 0 8px;
    display: none;
}

.typing-indicator.active {
    display: block;
}

.typing-indicator .dots {
    display: inline-flex;
    gap: 3px;
}

.typing-indicator .dots span {
    width: 6px;
    height: 6px;
    background: var(--olive-primary, #6B8E23);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator .dots span:nth-child(1) { animation-delay: 0s; }
.typing-indicator .dots span:nth-child(2) { animation-delay: 0.16s; }
.typing-indicator .dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Image Preview */
.image-preview-area {
    display: none;
    padding: 12px 0;
    gap: 8px;
    overflow-x: auto;
}

.image-preview-area.active {
    display: flex;
}

.image-preview-item {
    position: relative;
    flex-shrink: 0;
}

.image-preview-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--border-color, #e0e8d5);
}

.image-preview-item .remove-image {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef5350;
    color: white;
    border: 2px solid var(--bg-card, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.image-preview-item .remove-image:hover {
    transform: scale(1.1);
}

/* Input Group - WhatsApp-like Style */
.message-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-input-group .attachment-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary, #54656f);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 20px;
}

.message-input-group .attachment-btn:hover {
    background: var(--hover-bg, rgba(0,0,0,0.05));
    color: var(--olive-primary, #6B8E23);
}

.message-input-group input[type="text"],
.message-input-group textarea {
    flex: 1;
    border: none;
    background: var(--bg-card, #ffffff);
    padding: 12px 20px;
    font-size: 15px;
    color: var(--text-primary, #2a3a2a);
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    border-radius: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
}

.message-input-group input[type="text"]:focus,
.message-input-group textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(107, 142, 35, 0.25);
}

.message-input-group input[type="text"]::placeholder,
.message-input-group textarea::placeholder {
    color: var(--text-muted, #8696a0);
}

.message-input-group .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--olive-primary, #6B8E23);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    font-size: 18px;
}

.message-input-group .send-btn:hover {
    transform: scale(1.05);
    background: var(--olive-dark, #5a7a1f);
}

.message-input-group .send-btn:active {
    transform: scale(0.95);
}

.message-input-group .send-btn:disabled {
    background: var(--border-color, #adb5bd);
    cursor: not-allowed;
}

.message-input-group .send-btn:disabled:hover {
    transform: none;
}

/* Character Counter */
.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    text-align: right;
    padding: 4px 12px 0;
}

.char-counter.warning {
    color: #ff9800;
}

.char-counter.danger {
    color: #f44336;
}

/* Keyboard shortcut hints */
.message-input-wrapper kbd {
    background: var(--bg-secondary, #e9ecef);
    border: 1px solid var(--border-color, #d0dcc5);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.65rem;
    font-family: inherit;
    color: var(--text-muted, #6c757d);
}

[data-theme="dark"] .message-input-wrapper kbd {
    background: #1f251f;
    border-color: #2a352a;
    color: #7a8a7a;
}

/* ===================================
   CONVERSATION LIST
   =================================== */
.conversation-list {
    display: flex;
    flex-direction: column;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color, #eef3e8);
    position: relative;
}

.conversation-item:hover {
    background: linear-gradient(90deg, rgba(107, 142, 35, 0.06) 0%, transparent 100%);
}

.conversation-item.unread {
    background: linear-gradient(90deg, rgba(107, 142, 35, 0.08) 0%, rgba(107, 142, 35, 0.02) 100%);
}

.conversation-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--olive-primary, #6B8E23);
}

.conversation-item .conv-avatar {
    position: relative;
    flex-shrink: 0;
}

.conversation-item .conv-avatar img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color, #e0e8d5);
}

.conversation-item .conv-avatar .online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
    border: 2px solid var(--bg-card, #ffffff);
}

.conversation-item .conv-content {
    flex: 1;
    min-width: 0;
}

.conversation-item .conv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.conversation-item .conv-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #2a3a2a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item.unread .conv-name {
    font-weight: 700;
}

.conversation-item .conv-time {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    flex-shrink: 0;
    margin-left: 8px;
}

.conversation-item .conv-preview {
    display: flex;
    align-items: center;
    gap: 6px;
}

.conversation-item .conv-message {
    font-size: 0.875rem;
    color: var(--text-muted, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conversation-item.unread .conv-message {
    color: var(--text-primary, #2a3a2a);
    font-weight: 500;
}

.conversation-item .conv-sender {
    color: var(--olive-primary, #6B8E23);
    font-weight: 500;
}

.conversation-item .unread-badge {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

/* ===================================
   EMPTY STATE
   =================================== */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.chat-empty-state .empty-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(107, 142, 35, 0.1) 0%, rgba(107, 142, 35, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.chat-empty-state .empty-icon i {
    font-size: 2.5rem;
    color: var(--olive-primary, #6B8E23);
    opacity: 0.7;
}

.chat-empty-state h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #2a3a2a);
    margin-bottom: 8px;
}

.chat-empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 20px;
    max-width: 280px;
}

/* ===================================
   MEMBERS PANEL
   =================================== */
.members-panel {
    background: var(--bg-card, #ffffff);
}

.members-panel .member-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    gap: 12px;
    border-bottom: 1px solid var(--border-color, #eef3e8);
    cursor: pointer;
    transition: all 0.2s ease;
}

.members-panel .member-item:hover {
    background: linear-gradient(90deg, rgba(107, 142, 35, 0.06) 0%, transparent 100%);
    margin: 0 -12px;
    padding: 12px;
    border-radius: 8px;
}

.members-panel .member-item:last-child {
    border-bottom: none;
}

.members-panel .member-avatar {
    position: relative;
}

.members-panel .member-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.members-panel .member-info {
    flex: 1;
    min-width: 0;
}

.members-panel .member-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #2a3a2a);
}

.members-panel .member-role {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    text-transform: capitalize;
}

.members-panel .member-role.admin {
    color: var(--olive-primary, #6B8E23);
    font-weight: 500;
}

/* ===================================
   IMAGE LIGHTBOX
   =================================== */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    display: flex;
    opacity: 1;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-lightbox .close-lightbox {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-lightbox .close-lightbox:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===================================
   SEARCH BAR
   =================================== */
.chat-search {
    padding: 16px 20px;
    background: var(--bg-card, #ffffff);
    border-bottom: 2px solid var(--border-color, #e0e8d5);
}

.chat-search .search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary, #f5f8f0);
    border: 2px solid var(--border-color, #e0e8d5);
    border-radius: 24px;
    padding: 8px 16px;
    transition: all 0.25s ease;
}

.chat-search .search-input-wrapper:focus-within {
    border-color: var(--olive-primary, #6B8E23);
    box-shadow: 0 0 0 4px rgba(107, 142, 35, 0.1);
}

.chat-search .search-input-wrapper i {
    color: var(--text-muted, #9ca3af);
    margin-right: 10px;
}

.chat-search .search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-primary, #2a3a2a);
}

.chat-search .search-input-wrapper input:focus {
    outline: none;
}

.chat-search .search-input-wrapper input::placeholder {
    color: var(--text-muted, #9ca3af);
}

/* ===================================
   RESPONSIVE STYLES
   =================================== */
@media (max-width: 768px) {
    .chat-wrapper {
        height: calc(100vh - 160px);
        min-height: 400px;
        max-height: none;
        border-radius: 12px;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-avatar img {
        width: 40px;
        height: 40px;
    }

    .messages-wrapper {
        padding: 16px;
    }

    .message-bubble {
        max-width: 85%;
        padding: 10px 14px;
    }

    .message-input-wrapper {
        padding: 12px 16px;
    }

    .message-input-group {
        padding: 6px 10px;
    }

    .message-input-group .send-btn {
        width: 38px;
        height: 38px;
    }

    .conversation-item {
        padding: 14px 16px;
    }

    .conversation-item .conv-avatar img {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 576px) {
    .message-bubble {
        max-width: 90%;
    }

    .message-images {
        max-width: 200px !important;
    }

    .chat-header-actions .btn span {
        display: none;
    }
}

/* ===================================
   DARK THEME
   =================================== */
[data-theme="dark"] .chat-wrapper {
    background: var(--bg-card, #1a1f1a);
    border-color: var(--border-color, #2a352a);
}

[data-theme="dark"] .chat-header {
    background: linear-gradient(135deg, #1f251f 0%, #1a1f1a 100%);
    border-color: #2a352a;
}

[data-theme="dark"] .messages-wrapper {
    background: linear-gradient(180deg, #151a15 0%, #0f1410 100%);
}

[data-theme="dark"] .message-bubble.received {
    background: #1f251f;
    color: #c0cac0;
}

[data-theme="dark"] .message-input-wrapper {
    background: #1a1f1a;
    border-color: #2a352a;
}

[data-theme="dark"] .message-input-group input[type="text"],
[data-theme="dark"] .message-input-group textarea {
    background: #0f1410;
    color: #d0dac0;
    box-shadow: none;
}

[data-theme="dark"] .message-input-group input[type="text"]:focus,
[data-theme="dark"] .message-input-group textarea:focus {
    box-shadow: 0 0 0 2px rgba(107, 142, 35, 0.3);
}

[data-theme="dark"] .message-input-group .attachment-btn {
    color: #8a9a8a;
}

[data-theme="dark"] .message-input-group .attachment-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #9cb55a;
}

[data-theme="dark"] .conversation-item {
    border-color: #252a25;
}

[data-theme="dark"] .conversation-item:hover {
    background: linear-gradient(90deg, rgba(107, 142, 35, 0.08) 0%, transparent 100%);
}

[data-theme="dark"] .conversation-item.unread {
    background: linear-gradient(90deg, rgba(107, 142, 35, 0.12) 0%, rgba(107, 142, 35, 0.04) 100%);
}

[data-theme="dark"] .conversation-item .conv-name {
    color: #d0dac0;
}

[data-theme="dark"] .chat-empty-state h5 {
    color: #d0dac0;
}

[data-theme="dark"] .chat-search .search-input-wrapper {
    background: #0f1410;
    border-color: #2a352a;
}

[data-theme="dark"] .chat-search .search-input-wrapper input {
    color: #d0dac0;
}

[data-theme="dark"] .date-separator span {
    background: #1f251f;
    color: #7a8a7a;
}

[data-theme="dark"] .image-preview-item img {
    border-color: #2a352a;
}

[data-theme="dark"] .members-panel .member-item {
    border-color: #252a25;
}

[data-theme="dark"] .members-panel .member-name {
    color: #d0dac0;
}

/* ===================================
   MESSAGE REACTIONS (WhatsApp-like)
   =================================== */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.reaction-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-secondary, #f0f2f5);
    border: 1px solid var(--border-color, #e0e8d5);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reaction-bubble:hover {
    background: var(--bg-tertiary, #e8ebe5);
    transform: scale(1.05);
}

.reaction-bubble.own-reaction {
    background: rgba(107, 142, 35, 0.15);
    border-color: var(--olive-primary, #6B8E23);
}

.reaction-bubble .reaction-emoji {
    font-size: 1rem;
}

.reaction-bubble .reaction-count {
    color: var(--text-muted, #6c757d);
    font-weight: 600;
}

/* Reaction Picker */
.reaction-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    background: var(--bg-card, #ffffff);
    border-radius: 24px;
    padding: 8px 12px;
    display: flex;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(10px);
    transition: all 0.2s ease;
}

.reaction-picker.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.message-group.sent .reaction-picker {
    right: 0;
}

.message-group.received .reaction-picker {
    left: 0;
}

.reaction-picker button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-picker button:hover {
    background: var(--bg-secondary, #f0f2f5);
    transform: scale(1.2);
}

.reaction-picker button.selected {
    background: rgba(107, 142, 35, 0.15);
}

[data-theme="dark"] .reaction-bubble {
    background: #1f251f;
    border-color: #2a352a;
}

[data-theme="dark"] .reaction-bubble:hover {
    background: #252a25;
}

[data-theme="dark"] .reaction-bubble.own-reaction {
    background: rgba(107, 142, 35, 0.2);
}

[data-theme="dark"] .reaction-picker {
    background: #1f251f;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .reaction-picker button:hover {
    background: #2a352a;
}

/* ===================================
   REPLY PREVIEW (WhatsApp-like)
   =================================== */
.reply-preview-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-secondary, #f5f8f0);
    border-left: 4px solid var(--olive-primary, #6B8E23);
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
}

.reply-preview-bar.active {
    display: flex;
}

.reply-preview-bar .reply-content {
    flex: 1;
    min-width: 0;
}

.reply-preview-bar .reply-to-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--olive-primary, #6B8E23);
    margin-bottom: 2px;
}

.reply-preview-bar .reply-to-text {
    font-size: 0.85rem;
    color: var(--text-muted, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-bar .cancel-reply {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.reply-preview-bar .cancel-reply:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #ef5350;
}

/* Reply Reference in Message Bubble */
.message-reply-ref {
    background: rgba(0, 0, 0, 0.06);
    border-left: 3px solid var(--olive-primary, #6B8E23);
    border-radius: 0 8px 8px 0;
    padding: 8px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.message-reply-ref:hover {
    background: rgba(0, 0, 0, 0.1);
}

.message-bubble.sent .message-reply-ref {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.5);
}

.message-bubble.sent .message-reply-ref:hover {
    background: rgba(255, 255, 255, 0.2);
}

.message-reply-ref .reply-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--olive-primary, #6B8E23);
    margin-bottom: 2px;
}

.message-bubble.sent .message-reply-ref .reply-author {
    color: rgba(255, 255, 255, 0.9);
}

.message-reply-ref .reply-text {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-bubble.sent .message-reply-ref .reply-text {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .reply-preview-bar {
    background: #1f251f;
}

[data-theme="dark"] .message-reply-ref {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .message-bubble.received .message-reply-ref {
    background: rgba(255, 255, 255, 0.08);
}

/* ===================================
   FORWARDED MESSAGE LABEL
   =================================== */
.forwarded-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-style: italic;
    color: var(--text-muted, #8696a0);
    margin-bottom: 4px;
}

.forwarded-label i {
    font-size: 0.65rem;
}

.message-bubble.sent .forwarded-label {
    color: rgba(255, 255, 255, 0.6);
}

/* ===================================
   EDITED MESSAGE INDICATOR
   =================================== */
.edited-indicator {
    font-size: 0.65rem;
    font-style: italic;
    color: var(--text-muted, #8696a0);
    margin-left: 4px;
}

.message-bubble.sent .edited-indicator {
    color: rgba(255, 255, 255, 0.5);
}

/* ===================================
   MOBILE ACTION MENU (WhatsApp-like)
   =================================== */
.mobile-action-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-action-overlay.active {
    display: flex;
    opacity: 1;
}

.mobile-action-menu {
    background: var(--bg-card, #ffffff);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 400px;
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
}

.mobile-action-overlay.active .mobile-action-menu {
    transform: translateY(0);
}

.mobile-action-menu .menu-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color, #e0e8d5);
}

.mobile-action-menu .menu-header .drag-indicator {
    width: 40px;
    height: 4px;
    background: var(--border-color, #d0dcc5);
    border-radius: 2px;
}

.mobile-action-menu .message-preview {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e0e8d5);
    background: var(--bg-secondary, #f5f8f0);
}

.mobile-action-menu .message-preview p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary, #2a3a2a);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-action-menu .action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px;
}

.mobile-action-menu .action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary, #2a3a2a);
}

.mobile-action-menu .action-item:hover {
    background: var(--bg-secondary, #f5f8f0);
}

.mobile-action-menu .action-item:active {
    transform: scale(0.95);
}

.mobile-action-menu .action-item .action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.mobile-action-menu .action-item .action-icon.reply {
    background: #e3f2fd;
    color: #1976d2;
}

.mobile-action-menu .action-item .action-icon.forward {
    background: #e8f5e9;
    color: #388e3c;
}

.mobile-action-menu .action-item .action-icon.copy {
    background: #fff3e0;
    color: #f57c00;
}

.mobile-action-menu .action-item .action-icon.react {
    background: #fce4ec;
    color: #c2185b;
}

.mobile-action-menu .action-item .action-icon.edit {
    background: #e0f7fa;
    color: #0097a7;
}

.mobile-action-menu .action-item .action-icon.delete {
    background: #ffebee;
    color: #d32f2f;
}

.mobile-action-menu .action-item .action-icon.info {
    background: #f3e5f5;
    color: #7b1fa2;
}

.mobile-action-menu .action-item .action-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Quick Reactions Row */
.mobile-action-menu .quick-reactions {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #e0e8d5);
}

.mobile-action-menu .quick-reactions button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary, #f5f8f0);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mobile-action-menu .quick-reactions button:hover {
    transform: scale(1.15);
    background: var(--bg-tertiary, #e8ebe5);
}

.mobile-action-menu .quick-reactions button:active {
    transform: scale(0.95);
}

[data-theme="dark"] .mobile-action-menu {
    background: #1a1f1a;
}

[data-theme="dark"] .mobile-action-menu .menu-header {
    border-color: #2a352a;
}

[data-theme="dark"] .mobile-action-menu .menu-header .drag-indicator {
    background: #3a453a;
}

[data-theme="dark"] .mobile-action-menu .message-preview {
    background: #151a15;
    border-color: #2a352a;
}

[data-theme="dark"] .mobile-action-menu .message-preview p {
    color: #c0cac0;
}

[data-theme="dark"] .mobile-action-menu .action-item {
    color: #c0cac0;
}

[data-theme="dark"] .mobile-action-menu .action-item:hover {
    background: #252a25;
}

[data-theme="dark"] .mobile-action-menu .quick-reactions {
    border-color: #2a352a;
}

[data-theme="dark"] .mobile-action-menu .quick-reactions button {
    background: #252a25;
}

[data-theme="dark"] .mobile-action-menu .quick-reactions button:hover {
    background: #2a352a;
}

/* ===================================
   MESSAGE HOVER ACTIONS (Desktop)
   =================================== */
.message-hover-actions {
    position: absolute;
    top: -8px;
    display: flex;
    gap: 4px;
    background: var(--bg-card, #ffffff);
    border-radius: 20px;
    padding: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
}

.message-group.sent .message-hover-actions {
    right: 8px;
}

.message-group.received .message-hover-actions {
    left: 8px;
}

.message-bubble:hover .message-hover-actions,
.message-group:hover .message-hover-actions {
    opacity: 1;
    visibility: visible;
}

.message-hover-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.message-hover-actions button:hover {
    background: var(--bg-secondary, #f0f2f5);
    color: var(--olive-primary, #6B8E23);
}

.message-hover-actions button.delete:hover {
    background: #ffebee;
    color: #d32f2f;
}

[data-theme="dark"] .message-hover-actions {
    background: #1f251f;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .message-hover-actions button:hover {
    background: #2a352a;
}

/* ===================================
   FORWARD MODAL
   =================================== */
.forward-modal .conversation-list {
    max-height: 350px;
    overflow-y: auto;
}

.forward-modal .conversation-item {
    cursor: pointer;
    border-radius: 12px;
    margin: 4px 0;
}

.forward-modal .conversation-item:hover {
    background: var(--bg-secondary, #f5f8f0);
}

.forward-modal .conversation-item.selected {
    background: rgba(107, 142, 35, 0.1);
    border-color: var(--olive-primary, #6B8E23);
}

.forward-modal .forward-message-preview {
    background: var(--bg-secondary, #f5f8f0);
    border-left: 4px solid var(--olive-primary, #6B8E23);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 16px;
}

.forward-modal .forward-message-preview .preview-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--olive-primary, #6B8E23);
    margin-bottom: 4px;
}

.forward-modal .forward-message-preview .preview-text {
    font-size: 0.9rem;
    color: var(--text-primary, #2a3a2a);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="dark"] .forward-modal .forward-message-preview {
    background: #1f251f;
}

[data-theme="dark"] .forward-modal .forward-message-preview .preview-text {
    color: #c0cac0;
}

/* ===================================
   EDIT MESSAGE MODAL
   =================================== */
.edit-message-modal .original-message {
    background: var(--bg-secondary, #f5f8f0);
    border-left: 4px solid var(--text-muted, #9ca3af);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 16px;
}

.edit-message-modal .original-message .original-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
    margin-bottom: 4px;
}

.edit-message-modal .original-message .original-text {
    font-size: 0.9rem;
    color: var(--text-primary, #2a3a2a);
}

.edit-message-modal textarea {
    width: 100%;
    min-height: 100px;
    border: 2px solid var(--border-color, #e0e8d5);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.edit-message-modal textarea:focus {
    outline: none;
    border-color: var(--olive-primary, #6B8E23);
}

[data-theme="dark"] .edit-message-modal .original-message {
    background: #1f251f;
}

[data-theme="dark"] .edit-message-modal .original-message .original-text {
    color: #c0cac0;
}

[data-theme="dark"] .edit-message-modal textarea {
    background: #0f1410;
    border-color: #2a352a;
    color: #d0dac0;
}

/* ===================================
   DELETE CONFIRMATION
   =================================== */
.delete-confirm-modal .delete-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.delete-confirm-modal .delete-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border-color, #e0e8d5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-confirm-modal .delete-option:hover {
    border-color: var(--olive-primary, #6B8E23);
    background: rgba(107, 142, 35, 0.05);
}

.delete-confirm-modal .delete-option.selected {
    border-color: var(--olive-primary, #6B8E23);
    background: rgba(107, 142, 35, 0.1);
}

.delete-confirm-modal .delete-option i {
    font-size: 1.25rem;
    color: var(--text-muted, #6c757d);
}

.delete-confirm-modal .delete-option .option-text {
    flex: 1;
}

.delete-confirm-modal .delete-option .option-title {
    font-weight: 600;
    color: var(--text-primary, #2a3a2a);
}

.delete-confirm-modal .delete-option .option-desc {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
}

/* ===================================
   SYSTEM/ADMIN MESSAGE STYLING
   =================================== */
.system-message {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.system-message .system-bubble {
    background: linear-gradient(135deg, rgba(107, 142, 35, 0.1) 0%, rgba(107, 142, 35, 0.05) 100%);
    border: 1px solid rgba(107, 142, 35, 0.2);
    border-radius: 12px;
    padding: 10px 20px;
    max-width: 80%;
    text-align: center;
}

.system-message .system-bubble .system-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--olive-primary, #6B8E23);
    color: white;
    font-size: 0.7rem;
    margin-right: 8px;
    vertical-align: middle;
}

.system-message .system-bubble .system-text {
    font-size: 0.85rem;
    color: var(--text-primary, #2a3a2a);
}

.system-message .system-bubble .system-time {
    font-size: 0.7rem;
    color: var(--text-muted, #6c757d);
    margin-top: 4px;
}

[data-theme="dark"] .system-message .system-bubble {
    background: linear-gradient(135deg, rgba(107, 142, 35, 0.15) 0%, rgba(107, 142, 35, 0.08) 100%);
    border-color: rgba(107, 142, 35, 0.25);
}

[data-theme="dark"] .system-message .system-bubble .system-text {
    color: #c0cac0;
}

/* ===================================
   ATTACHMENT PREVIEWS
   =================================== */
.attachment-grid {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.attachment-grid.cols-1 { grid-template-columns: 1fr; max-width: 280px; }
.attachment-grid.cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 280px; }
.attachment-grid.cols-3 { grid-template-columns: repeat(3, 1fr); max-width: 320px; }

.attachment-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.attachment-item.image {
    aspect-ratio: 1;
}

.attachment-item.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.attachment-item.image:hover img {
    transform: scale(1.05);
}

.attachment-item.document {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary, #f0f2f5);
    padding: 12px;
    border: 1px solid var(--border-color, #e0e8d5);
}

.message-bubble.sent .attachment-item.document {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.attachment-item.document .doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--olive-primary, #6B8E23);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.attachment-item.document .doc-info {
    flex: 1;
    min-width: 0;
}

.attachment-item.document .doc-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary, #2a3a2a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-bubble.sent .attachment-item.document .doc-name {
    color: white;
}

.attachment-item.document .doc-size {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
}

.message-bubble.sent .attachment-item.document .doc-size {
    color: rgba(255, 255, 255, 0.7);
}

.attachment-item.video {
    position: relative;
    aspect-ratio: 16/9;
}

.attachment-item.video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.attachment-item.video .play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
}

.attachment-item.video:hover .play-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.attachment-item.video .play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary, #2a3a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.attachment-item.video:hover .play-btn {
    transform: scale(1.1);
}

[data-theme="dark"] .attachment-item.document {
    background: #252a25;
    border-color: #2a352a;
}

[data-theme="dark"] .attachment-item.document .doc-name {
    color: #d0dac0;
}

/* ===================================
   UPLOAD PROGRESS
   =================================== */
.upload-progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.upload-progress-overlay .progress-ring {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.upload-progress-overlay .progress-ring circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.upload-progress-overlay .progress-ring .bg {
    stroke: rgba(255, 255, 255, 0.2);
}

.upload-progress-overlay .progress-ring .progress {
    stroke: var(--olive-primary, #6B8E23);
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    transition: stroke-dashoffset 0.3s ease;
}

.upload-progress-overlay .progress-text {
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===================================
   VOICE MESSAGE (Future)
   =================================== */
.voice-message {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.voice-message .play-pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary, #2a3a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.message-bubble.sent .voice-message .play-pause-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.voice-message .waveform {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.voice-message .waveform span {
    width: 3px;
    background: var(--text-muted, #8696a0);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.message-bubble.sent .voice-message .waveform span {
    background: rgba(255, 255, 255, 0.5);
}

.voice-message .waveform span.played {
    background: var(--olive-primary, #6B8E23);
}

.message-bubble.sent .voice-message .waveform span.played {
    background: white;
}

.voice-message .duration {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    flex-shrink: 0;
}

.message-bubble.sent .voice-message .duration {
    color: rgba(255, 255, 255, 0.7);
}

/* ===================================
   LOADING & SKELETON STATES
   =================================== */
.message-skeleton {
    display: flex;
    gap: 12px;
    padding: 16px;
}

.message-skeleton.sent {
    flex-direction: row-reverse;
}

.message-skeleton .skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--bg-secondary, #f0f2f5) 25%, var(--bg-tertiary, #e8ebe5) 50%, var(--bg-secondary, #f0f2f5) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.message-skeleton .skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-skeleton .skeleton-bubble {
    background: linear-gradient(90deg, var(--bg-secondary, #f0f2f5) 25%, var(--bg-tertiary, #e8ebe5) 50%, var(--bg-secondary, #f0f2f5) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 18px;
}

.message-skeleton .skeleton-bubble.long { width: 200px; height: 60px; }
.message-skeleton .skeleton-bubble.medium { width: 150px; height: 40px; }
.message-skeleton .skeleton-bubble.short { width: 100px; height: 30px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[data-theme="dark"] .message-skeleton .skeleton-avatar,
[data-theme="dark"] .message-skeleton .skeleton-bubble {
    background: linear-gradient(90deg, #1f251f 25%, #252a25 50%, #1f251f 75%);
    background-size: 200% 100%;
}

/* ===================================
   SWIPE GESTURES (Mobile)
   =================================== */
.message-group {
    position: relative;
    overflow: hidden;
}

.message-group .swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary, #f0f2f5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--olive-primary, #6B8E23);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-group.received .swipe-hint {
    right: -50px;
}

.message-group.sent .swipe-hint {
    left: -50px;
}

.message-group.swiping .swipe-hint {
    opacity: 1;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.chat-hidden { display: none !important; }
.chat-visible { display: block !important; }
.chat-flex { display: flex !important; }

.chat-fade-in {
    animation: chatFadeIn 0.3s ease forwards;
}

@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-fade-out {
    animation: chatFadeOut 0.3s ease forwards;
}

@keyframes chatFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

/* Prevent text selection on long press */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
