/* WhatsApp-style Message Status Ticks */
.message-status {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    position: relative;
}

/* Base tick styles */
.message-tick {
    width: 16px;
    height: 16px;
    position: relative;
    display: inline-block;
}

/* Single tick (sent) */
.message-tick.sent::before {
    content: '✓';
    color: #667781; /* WhatsApp gray */
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    left: 2px;
}

/* Double tick (delivered) */
.message-tick.delivered::before {
    content: '✓✓';
    color: #667781; /* WhatsApp gray */
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Double tick blue (read) */
.message-tick.read::before {
    content: '✓✓';
    color: #53bdeb; /* WhatsApp blue */
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Failed status */
.message-tick.failed::before {
    content: '⚠';
    color: #f15c6d; /* Red for failed */
    font-size: 14px;
    position: absolute;
    left: 2px;
}

/* Pending/sending status */
.message-tick.pending::before {
    content: '🕐';
    color: #667781;
    font-size: 12px;
    position: absolute;
    left: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Message bubble styles for chat interface */
.message-bubble {
    position: relative;
    padding: 8px 12px;
    border-radius: 12px;
    margin: 4px 0;
    max-width: 65%;
    word-wrap: break-word;
}

.message-bubble.outbound {
    background: #dcf8c6; /* WhatsApp green */
    margin-left: auto;
    margin-right: 8px;
}

.message-bubble.inbound {
    background: #ffffff;
    margin-right: auto;
    margin-left: 8px;
    border: 1px solid #e9ecef;
}

.message-bubble .message-text {
    color: #1f2937;
    line-height: 1.4;
}

.message-bubble .message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 11px;
    color: #667781;
}

.message-bubble.outbound .message-meta {
    justify-content: flex-end;
    gap: 6px;
}

.message-timestamp {
    font-size: 11px;
    color: #667781;
    white-space: nowrap;
}

/* Status tooltip */
.message-status-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 1000;
}

.message-status:hover .message-status-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }
    
    .message-tick {
        width: 14px;
        height: 14px;
    }
    
    .message-tick.sent::before,
    .message-tick.delivered::before,
    .message-tick.read::before {
        font-size: 12px;
    }
}

/* Enhanced message list styles */
.message-list {
    display: flex;
    flex-direction: column;
    padding: 16px 8px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Status indicators in conversation list */
.conversation-item .last-message-status {
    margin-left: 4px;
}

.conversation-item .last-message-status .message-tick {
    width: 12px;
    height: 12px;
}

.conversation-item .last-message-status .message-tick::before {
    font-size: 10px;
}
