/* pasien/css/konsultasi.css - WhatsApp Style Consultation Room */

/* Opacity utilities & avatar fallback for Bootstrap 5.0 */
.avatar-icon,
.bg-primary.bg-opacity-10 {
    background-color: rgba(4, 99, 250, 0.1) !important;
    color: #0463fa !important;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(25, 135, 84, 0.12) !important;
    color: #198754 !important;
}

.bg-secondary.bg-opacity-10 {
    background-color: rgba(108, 117, 125, 0.12) !important;
    color: #6c757d !important;
}

.object-cover {
    object-fit: cover !important;
}

#headerDocAvatarContainer img {
    object-fit: cover;
}

/* Container Utama Chat Pasien */
.chat-app-wrapper {
    height: 500px;
    max-height: 520px;
    min-height: 360px;
    background-color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
}

.chat-app-wrapper > .row {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden;
}

/* Kolom Kiri: Sidebar Daftar Obrolan Pasien */
.chat-sidebar-col {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background-color: #ffffff;
    overflow: hidden;
}

.chat-sidebar-header {
    flex-shrink: 0 !important;
}

.chat-sidebar-list {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Kolom Kanan: Main Chat Panel */
.chat-main-col {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background-color: #ffffff;
    overflow: hidden;
    position: relative;
}

#chatActiveView {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
}

/* WA Style: Topbar Header Chat (Info Dokter) - FIXED DI ATAS */
.chat-header {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    left: 0;
    right: 0;
    z-index: 20 !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* WA Style: Area Pesan - BISA DI-SCROLL Bebas */
.chat-body {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth !important;
    background-color: #f8fafc !important;
    background-image: radial-gradient(#cbd5e1 0.75px, transparent 0.75px) !important;
    background-size: 16px 16px !important;
    padding: 1rem !important;
}

/* WA Style: Area Input Pesan - FIXED DI BAWAH */
.chat-footer {
    flex-shrink: 0 !important;
    position: sticky !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    z-index: 20 !important;
    background-color: #ffffff !important;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04) !important;
}

.chat-item {
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.chat-item:hover {
    background-color: #f8fafc;
}

.chat-item.active {
    background-color: #eff6ff !important;
    border-left-color: #0d6efd !important;
}

/* WhatsApp Style Unread Counter Badge */
.wa-unread-badge {
    background-color: #25D366 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    min-width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    padding: 0 6px !important;
    border-radius: 9999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-shadow: 0 1px 3px rgba(37, 211, 102, 0.35) !important;
    flex-shrink: 0 !important;
}

.chat-time-text.unread,
.chat-time-text[data-unread="true"] {
    color: #25D366 !important;
    font-weight: 700 !important;
}

/* Chat Bubbles */
.message-bubble-wrapper {
    display: flex;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.message-bubble-wrapper.outgoing {
    justify-content: flex-end;
}

.message-bubble-wrapper.incoming {
    justify-content: flex-start;
}

.bubble-content {
    max-width: 72%;
    padding: 0.65rem 0.95rem;
    position: relative;
    word-break: break-word;
    font-size: 0.84rem;
    line-height: 1.45;
}

.outgoing .bubble-content {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #ffffff;
    border-radius: 1.125rem 1.125rem 0.25rem 1.125rem;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.incoming .bubble-content {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 1.125rem 1.125rem 1.125rem 0.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.bubble-meta {
    font-size: 0.6875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.outgoing .bubble-meta {
    color: rgba(255, 255, 255, 0.8);
    justify-content: flex-end;
}

.incoming .bubble-meta {
    color: #64748b;
    justify-content: flex-start;
}

.bubble-sender {
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #0d6efd;
}

/* Custom Sleek Scrollbar */
.chat-sidebar-list::-webkit-scrollbar,
.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-sidebar-list::-webkit-scrollbar-track,
.chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-sidebar-list::-webkit-scrollbar-thumb,
.chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chat-sidebar-list::-webkit-scrollbar-thumb:hover,
.chat-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Mobile View */
@media (max-width: 767.98px) {
    .chat-app-wrapper {
        height: auto;
        min-height: auto;
        max-height: none;
    }
    .chat-sidebar-col {
        height: 220px !important;
    }
    .chat-main-col {
        height: 460px !important;
    }
}
