/* ============================================
   WhatsApp-style Chat UI
   ============================================ */

/* Chat background - WhatsApp doodle pattern */
.whatsapp-chat-bg {
    background-color: #ECE5DD;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cfc6' fill-opacity='0.35'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Contact list */
.wa-contact-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}
.wa-contact-item:hover {
    background-color: #f5f6f6;
}
.wa-contact-item.active {
    background-color: #ebebeb;
}
.wa-contact-item.unread {
    background-color: #f0faf0;
}

/* Unread badge */
.wa-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background-color: #25D366;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

/* Chat header */
.wa-chat-header {
    background-color: #f0f2f5;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 16px;
}

/* Message bubbles */
.wa-bubble {
    max-width: 65%;
    padding: 6px 8px 4px 9px;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}
.wa-bubble.inbound {
    background-color: #ffffff;
    border-top-left-radius: 0;
}
.wa-bubble.outbound {
    background-color: #D9FDD3;
    border-top-right-radius: 0;
}

/* Delivery ticks */
.wa-tick {
    font-size: 14px;
    margin-left: 3px;
    vertical-align: middle;
}
.wa-tick.sent { color: #8696a0; }
.wa-tick.delivered { color: #8696a0; }
.wa-tick.read { color: #53bdeb; }
.wa-tick.failed { color: #e74c3c; }

/* Message timestamp */
.wa-time {
    font-size: 11px;
    color: rgba(0,0,0,0.45);
    display: inline-flex;
    align-items: center;
    float: right;
    margin: 2px 0 -4px 12px;
}
.wa-bubble.outbound .wa-time {
    color: rgba(0,0,0,0.45);
}

/* Media previews */
.wa-media-image {
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
}
.wa-media-document {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.04);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 4px;
    text-decoration: none;
    color: inherit;
}
.wa-media-document:hover {
    background: rgba(0,0,0,0.08);
}
.wa-media-document .doc-icon {
    font-size: 28px;
    color: #8696a0;
    margin-right: 10px;
}
.wa-media-audio {
    width: 100%;
    height: 36px;
    margin-bottom: 4px;
}
.wa-media-video {
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 4px;
}

/* Caption text */
.wa-caption {
    font-size: 13.5px;
    margin-top: 2px;
    line-height: 1.35;
}

/* Chat footer / input */
.wa-chat-footer {
    background-color: #f0f2f5;
    border-top: 1px solid #e0e0e0;
    padding: 10px 16px;
}
.wa-chat-footer .form-control {
    border-radius: 8px;
    border: none;
    background: #fff;
    padding: 9px 12px;
}
.wa-chat-footer .form-control:focus {
    box-shadow: none;
}
.wa-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #00a884;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s;
    flex-shrink: 0;
}
.wa-send-btn:hover {
    background-color: #008f72;
}
.wa-send-btn:disabled {
    background-color: #8696a0;
    cursor: not-allowed;
}

/* Last message preview in contact list */
.wa-last-msg {
    font-size: 12.5px;
    color: #667781;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Contact time */
.wa-contact-time {
    font-size: 11px;
    color: #667781;
}
.wa-contact-time.has-unread {
    color: #25D366;
}

/* Search bar */
.wa-search-bar {
    background-color: #f0f2f5;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
}
.wa-search-bar .form-control {
    border-radius: 8px;
    border: none;
    background: #fff;
    font-size: 13px;
    padding: 8px 12px 8px 36px;
}
.wa-search-bar .search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #8696a0;
    font-size: 14px;
}

/* Sidebar panel */
.wa-sidebar {
    background-color: #fff;
    border-right: 1px solid #e0e0e0;
}

/* Sticker display */
.wa-sticker {
    max-width: 150px;
}
