/**
 * =========================================================================
 * SMARTAPP v3.0 - CHAT & DISCUSSION MODULE STYLESHEET
 * SMA 1 Barunawati
 * File: css/chat.css
 * =========================================================================
 */

/* Root Panel & Main Container */
#panel-obrolan {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.chat-panel-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 30px);
    height: calc(100dvh - 30px);
    min-height: 520px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
    margin-bottom: -30px !important;
}

/* Fullscreen Focus Mode (Hides main sidebar completely) */
body.chat-fullscreen #sidebar,
body.chat-fullscreen .sidebar {
    display: none !important;
}

body.chat-fullscreen .main-content {
    margin-left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
}

body.chat-fullscreen .chat-panel-container {
    height: 100vh !important;
    height: 100dvh !important;
    margin-top: -30px !important;
    margin-bottom: -30px !important;
    border-radius: 0 !important;
    border: none !important;
}

.chat-panel-inner {
    display: flex !important;
    flex-direction: row !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* =========================================================================
   KOLOM KIRI: SIDEBAR DAFTAR PERCAKAPAN
   ========================================================================= */
.chat-sidebar-col {
    width: 360px !important;
    min-width: 300px !important;
    max-width: 420px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    background: rgba(11, 17, 32, 0.98) !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    position: relative !important;
    z-index: 2 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.chat-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-chat-header-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
}

.btn-chat-header-action:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: #06b6d4;
    color: #67e8f9;
}

.btn-chat-delete-action {
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.btn-chat-delete-action:hover {
    color: #ffffff !important;
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.chat-search-wrap {
    position: relative;
    width: 100%;
}

.chat-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f8fafc;
    font-size: 0.84rem;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.chat-search-input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}

.chat-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.82rem;
    pointer-events: none;
}

.chat-filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chat-filter-pills::-webkit-scrollbar {
    display: none;
}

.chat-filter-pill {
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    box-sizing: border-box;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}

.chat-filter-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #e2e8f0;
}

.chat-filter-pill.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: #06b6d4;
    color: #67e8f9;
}

.chat-filter-pill-online.active {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: #22c55e !important;
    color: #4ade80 !important;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.chat-online-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
    display: inline-block;
    animation: chat-pulse-dot 1.8s infinite;
}

@keyframes chat-pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.chat-filter-count-badge {
    background: #22c55e;
    color: #052e16;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.2;
}

.chat-conversations-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.chat-conversations-list::-webkit-scrollbar {
    width: 6px;
}
.chat-conversations-list::-webkit-scrollbar-track {
    background: transparent;
}
.chat-conversations-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}
.chat-conversations-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

.chat-conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.chat-conv-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.chat-conv-item.active {
    background: rgba(6, 182, 212, 0.12);
    border-left: 3px solid #06b6d4;
}

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

.chat-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #0f172a;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
    z-index: 2;
}

.chat-status-dot.online {
    background-color: #22c55e !important;
    box-shadow: 0 0 0 1.5px rgba(34, 197, 94, 0.25), 0 0 8px rgba(34, 197, 94, 0.75) !important;
}

.chat-status-dot.online.pulsating {
    animation: chat-status-pulse 2s infinite;
}

@keyframes chat-status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.chat-online-tag {
    font-size: 0.68rem;
    color: #4ade80;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 1px 7px;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.chat-online-tag i {
    font-size: 0.45rem;
    color: #22c55e;
}

.chat-online-direct-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.chat-online-direct-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.chat-online-direct-btn:active {
    transform: translateY(0);
}

.chat-conv-item.chat-online-user-item:hover {
    background: rgba(34, 197, 94, 0.05);
}

.chat-status-dot.offline {
    background-color: #ef4444 !important;
    box-shadow: 0 0 0 1.5px rgba(239, 68, 68, 0.2), 0 0 6px rgba(239, 68, 68, 0.5) !important;
}

/* Fallback untuk kompatibilitas */
.chat-online-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid #0f172a;
    border-radius: 50%;
}

.chat-status-indicator-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-status-indicator-dot.online {
    background-color: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.chat-status-indicator-dot.offline {
    background-color: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.chat-typing-dots span {
    width: 4.5px;
    height: 4.5px;
    border-radius: 50%;
    background-color: #38bdf8;
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

.chat-conv-info {
    flex: 1;
    min-width: 0;
}

.chat-conv-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-conv-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conv-time {
    font-size: 0.72rem;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 6px;
}

.chat-conv-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-conv-last-msg {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conv-item.unread .chat-conv-last-msg {
    color: #e2e8f0;
    font-weight: 600;
}

.chat-conv-badge {
    background: #06b6d4;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

/* =========================================================================
   KOLOM KANAN: AREA PERCAKAPAN AKTIF
   ========================================================================= */
.chat-main-col {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    background: #0f172a !important;
    position: relative !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.chat-active-header {
    flex-shrink: 0 !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 10px 18px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 10 !important;
    gap: 10px !important;
    box-sizing: border-box !important;
}

.chat-active-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.chat-mobile-back-btn {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    font-size: 1rem;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-active-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.chat-active-subtitle {
    font-size: 0.74rem;
    color: #94a3b8;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.chat-active-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chat-messages-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 18px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    box-sizing: border-box !important;
}

.chat-messages-container::-webkit-scrollbar {
    width: 6px;
}
.chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}
.chat-messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Gelembung Pesan */
.chat-date-divider {
    text-align: center;
    margin: 10px 0;
    position: relative;
}

.chat-date-divider span {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.chat-system-msg {
    text-align: center;
    margin: 6px 0;
}

.chat-system-msg span {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
    font-size: 0.74rem;
    padding: 4px 14px;
    border-radius: 14px;
    display: inline-block;
}

.chat-message-row {
    display: flex;
    gap: 8px;
    max-width: 80%;
    position: relative;
    animation: bubbleFadeIn 0.2s ease;
}

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

.chat-message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
    max-width: 86%;
    position: relative;
    box-sizing: border-box;
}

.msg-incoming {
    align-self: flex-start !important;
    margin-right: auto !important;
    margin-left: 0 !important;
    flex-direction: row !important;
    justify-content: flex-start;
}

.msg-outgoing {
    align-self: flex-end !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    flex-direction: row !important;
    justify-content: flex-end;
}

.chat-msg-sender-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-bottom: 2px;
    position: relative;
    z-index: 2;
}

.chat-msg-sender-avatar.avatar-me {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.chat-msg-sender-avatar.avatar-other {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.chat-msg-sender-avatar img,
.chat-msg-sender-avatar .chat-user-avatar-img {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.chat-msg-sender-avatar.avatar-other img,
.chat-msg-sender-avatar.avatar-other .chat-user-avatar-img,
.chat-msg-sender-avatar.avatar-other .chat-initials-avatar {
    border: 2px solid rgba(255, 255, 255, 0.25) !important;
}

.chat-msg-sender-avatar.avatar-me img,
.chat-msg-sender-avatar.avatar-me .chat-user-avatar-img,
.chat-msg-sender-avatar.avatar-me .chat-initials-avatar {
    border: 2.5px solid #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.chat-msg-sender-avatar .chat-initials-avatar {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-bubble-wrapper {
    position: relative;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.msg-outgoing .chat-bubble-wrapper {
    align-items: flex-end;
}

.msg-incoming .chat-bubble-wrapper {
    align-items: flex-start;
}

.chat-message-bubble {
    padding: 12px 18px;
    font-size: 0.88rem;
    line-height: 1.48;
    position: relative;
    word-break: break-word;
    box-sizing: border-box;
    min-width: 140px;
    cursor: pointer;
    user-select: text;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* OUTGOING BUBBLE (YOU) - SMARTAPP OCEAN BLUE GRADIENT WITH IMAGE 2 SHAPE */
.bubble-me {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-radius: 26px 26px 4px 26px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.32), 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Curved swoosh tail under avatar on the right */
.msg-outgoing .chat-message-bubble::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -13px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    clip-path: polygon(0 0, 0 100%, 100% 100%);
    border-bottom-left-radius: 14px;
    pointer-events: none;
}

/* INCOMING BUBBLE (OTHER) - SLATE GELAP ELEGAN SMARTAPP WITH IMAGE 2 SHAPE */
.bubble-other {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    border-radius: 26px 26px 26px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.45);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Curved swoosh tail under avatar on the left */
.msg-incoming .chat-message-bubble::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -13px;
    width: 18px;
    height: 18px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    border-bottom-right-radius: 14px;
    pointer-events: none;
}

/* BUBBLE HEADER ROW (You 5:24 PM / JOKER 5:29 PM) */
.chat-bubble-header-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
    line-height: 1.2;
}

.chat-bubble-sender-name {
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: capitalize;
}

.bubble-me .chat-bubble-sender-name {
    color: #ffffff;
}

.bubble-other .chat-bubble-sender-name {
    color: #38bdf8;
}

.chat-bubble-header-time {
    font-size: 0.72rem;
    font-weight: 500;
}

.bubble-me .chat-bubble-header-time {
    color: rgba(255, 255, 255, 0.78);
}

.bubble-other .chat-bubble-header-time {
    color: #94a3b8;
}

.chat-sender-role-pill {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 6px;
    text-transform: capitalize;
}

.bubble-me .chat-bubble-content {
    color: #ffffff;
    font-size: 0.88rem;
    line-height: 1.5;
}

.bubble-other .chat-bubble-content {
    color: #f1f5f9;
    font-size: 0.88rem;
    line-height: 1.5;
}

.chat-bubble-reply-preview {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid #38bdf8;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.74rem;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.bubble-me .chat-bubble-reply-preview {
    background: rgba(0, 0, 0, 0.22);
    border-left-color: #7dd3fc;
    color: #f0f9ff;
}

.chat-bubble-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.68rem;
    opacity: 0.9;
}

.chat-msg-timestamp {
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.bubble-me .chat-msg-timestamp {
    color: rgba(255, 255, 255, 0.78);
}

.bubble-other .chat-msg-timestamp {
    color: #94a3b8;
}

.bubble-me .chat-msg-status {
    color: #e0f2fe;
    font-size: 0.78rem;
}

.bubble-me .chat-edited-tag {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.68rem;
}

.bubble-other .chat-edited-tag {
    color: #94a3b8;
    font-size: 0.68rem;
}

/* ATTACHMENT CARD IMAGE 2 STYLE */
.chat-doc-card-image2 {
    background: rgba(0, 0, 0, 0.28);
    border-radius: 20px;
    padding: 12px 18px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bubble-me .chat-doc-card-image2 {
    background: rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.16);
}

.chat-doc-sender-note {
    font-size: 0.72rem;
    opacity: 0.75;
}

.bubble-me .chat-doc-sender-note {
    color: rgba(255, 255, 255, 0.85);
}

.bubble-other .chat-doc-sender-note {
    color: #94a3b8;
}

.chat-doc-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-doc-filespec {
    font-size: 0.84rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bubble-me .chat-doc-filespec {
    color: #ffffff;
}

.bubble-other .chat-doc-filespec {
    color: #f8fafc;
}

.chat-doc-download-pill {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 20px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    transition: transform 0.15s ease, filter 0.15s ease;
    flex-shrink: 0;
}

.chat-doc-download-pill:hover {
    transform: scale(1.04);
    filter: brightness(1.1);
}

/* Light Mode Overrides for Image 2 Bubbles */
[data-theme="light"] .bubble-me,
body.light-mode .bubble-me {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border-color: rgba(2, 132, 199, 0.5) !important;
}

[data-theme="light"] .msg-outgoing .chat-message-bubble::after,
body.light-mode .msg-outgoing .chat-message-bubble::after {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

[data-theme="light"] .bubble-me .chat-bubble-sender-name,
body.light-mode .bubble-me .chat-bubble-sender-name {
    color: #ffffff !important;
}

[data-theme="light"] .bubble-me .chat-bubble-header-time,
body.light-mode .bubble-me .chat-bubble-header-time {
    color: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] .bubble-me .chat-bubble-content,
body.light-mode .bubble-me .chat-bubble-content {
    color: #ffffff !important;
}

[data-theme="light"] .bubble-me .chat-msg-timestamp,
body.light-mode .bubble-me .chat-msg-timestamp {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="light"] .bubble-me .chat-msg-status,
body.light-mode .bubble-me .chat-msg-status {
    color: #e0f2fe !important;
}

[data-theme="light"] .bubble-other,
body.light-mode .bubble-other {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .msg-incoming .chat-message-bubble::after,
body.light-mode .msg-incoming .chat-message-bubble::after {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
}

[data-theme="light"] .bubble-other .chat-bubble-sender-name,
body.light-mode .bubble-other .chat-bubble-sender-name {
    color: #0284c7 !important;
}

[data-theme="light"] .bubble-other .chat-bubble-header-time,
body.light-mode .bubble-other .chat-bubble-header-time {
    color: #64748b !important;
}

[data-theme="light"] .bubble-other .chat-msg-timestamp,
body.light-mode .bubble-other .chat-msg-timestamp {
    color: #64748b !important;
}

[data-theme="light"] .bubble-other .chat-bubble-content,
body.light-mode .bubble-other .chat-bubble-content {
    color: #1e293b !important;
}

.chat-msg-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.chat-msg-status.status-sending {
    color: #94a3b8;
}

.chat-msg-status.status-sent {
    color: #94a3b8;
}

.chat-msg-status.status-read {
    color: #38bdf8 !important;
}

.chat-msg-status.status-read i {
    color: #38bdf8 !important;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.45);
}

.chat-msg-status.status-partial-read {
    color: #60a5fa !important;
}

.chat-msg-status .read-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 6px;
    margin-left: 2px;
}

@keyframes chatReadPop {
    0% { transform: scale(0.7); opacity: 0.7; }
    50% { transform: scale(1.35); text-shadow: 0 0 12px rgba(56, 189, 248, 0.8); }
    100% { transform: scale(1); opacity: 1; }
}

.chat-read-pop {
    animation: chatReadPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Bilah Tombol Balas Cepat & Menu di Sebelah Chat Bubble */
.chat-bubble-side-actions {
    display: none;
    align-items: center;
    gap: 6px;
    align-self: center;
    margin: 0 6px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-message-row:hover .chat-bubble-side-actions,
.chat-message-row:focus-within .chat-bubble-side-actions,
.chat-message-row.active-row .chat-bubble-side-actions {
    display: inline-flex;
}

.btn-bubble-reply {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-bubble-reply:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-bubble-reply .btn-bubble-reply-label {
    font-size: 0.74rem;
    letter-spacing: 0.2px;
}

.btn-bubble-more {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-bubble-more:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

/* Chat Bubble Wrapper & Reactions System */
.chat-bubble-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    position: relative;
}

.chat-message-row.msg-outgoing .chat-bubble-wrapper {
    align-items: flex-end;
}

.chat-message-row.msg-incoming .chat-bubble-wrapper {
    align-items: flex-start;
}

/* Floating Reaction Picker Popover (10 Rekomendasi Reaksi) */
.chat-reaction-picker {
    position: absolute;
    top: -46px;
    z-index: 60;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.18);
    border-radius: 999px;
    padding: 3px 8px;
    gap: 2px;
    display: flex;
    align-items: center;
    max-width: 95vw;
    animation: pickerPop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    touch-action: pan-x;
}

.chat-message-row.msg-outgoing .chat-reaction-picker {
    right: 0;
}

.chat-message-row.msg-incoming .chat-reaction-picker {
    left: 0;
}

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

.reaction-choice-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    padding: 3px 5px;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.15s ease, background 0.15s ease;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reaction-choice-btn:hover {
    transform: scale(1.38);
    background: rgba(255, 255, 255, 0.15);
}

/* Reactions Pills row under the message */
.chat-bubble-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.72rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.reaction-pill:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.reaction-pill.active {
    background: rgba(6, 182, 212, 0.22) !important;
    border-color: #06b6d4 !important;
    color: #67e8f9 !important;
    font-weight: 700;
}

.reaction-pill .reaction-emoji {
    font-size: 0.85rem;
    line-height: 1;
}

.reaction-pill .reaction-count {
    font-weight: 600;
}

[data-theme="light"] .chat-reaction-picker,
body.light-mode .chat-reaction-picker {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .reaction-pill,
body.light-mode .reaction-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}

[data-theme="light"] .reaction-pill.active,
body.light-mode .reaction-pill.active {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0369a1 !important;
}

/* Bilah Input Pesan */
.chat-input-area {
    flex-shrink: 0 !important;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)) 18px !important;
    background: #0b1120 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative !important;
    z-index: 20 !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.chat-reply-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.85);
    border-left: 3px solid #38bdf8;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.78rem;
}

.chat-edit-bar {
    border-left: 3px solid #818cf8 !important;
    background: rgba(30, 27, 75, 0.85) !important;
}

.chat-edited-tag {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    font-style: italic;
    opacity: 0.85;
}

.chat-input-controls-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-input-field {
    flex: 1;
    background: rgba(11, 17, 32, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 14px;
    color: #f8fafc;
    font-size: 0.9rem;
    resize: none;
    max-height: 120px;
    min-height: 42px;
    outline: none;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-field:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}

.btn-chat-send {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: 1px solid #22d3ee;
    color: #ffffff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
    transition: all 0.2s;
}

.btn-chat-send:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.btn-chat-emoji-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f59e0b;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.btn-chat-emoji-toggle:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.chat-emoji-popover {
    display: none;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    max-height: 180px;
    overflow-y: auto;
    z-index: 100;
}

.chat-emoji-category-tabs {
    display: flex;
    gap: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    width: 100%;
    overflow-x: auto;
}

.btn-emoji-cat-tab {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn-emoji-cat-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.btn-emoji-cat-tab.active {
    background: rgba(6, 182, 212, 0.25);
    color: #67e8f9;
    font-weight: 700;
}

.chat-emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.btn-stock-emoji {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 8px;
    transition: transform 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-stock-emoji:hover {
    transform: scale(1.22);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* =========================================================================
   STOCK ICON SELECTOR & MODALS (38 PRESETS)
   ========================================================================= */
.stock-cat-pill {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.stock-cat-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.stock-cat-pill.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: #06b6d4;
    color: #67e8f9;
}

.stock-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    padding: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stock-icon-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 4px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.stock-icon-choice:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.stock-icon-choice.selected {
    border-color: #06b6d4 !important;
    background: rgba(6, 182, 212, 0.18) !important;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.35) !important;
}

.stock-icon-preview {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 1.05rem !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.stock-icon-preview i {
    color: #ffffff !important;
    font-size: 1.05rem !important;
    display: inline-block !important;
    line-height: 1 !important;
}

.stock-icon-label {
    font-size: 0.68rem;
    color: #cbd5e1;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Modal Group Info */
.group-info-header {
    text-align: center;
    padding: 8px 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.group-info-avatar-large {
    width: 68px !important;
    height: 68px !important;
    min-width: 68px !important;
    border-radius: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.85rem !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
    margin: 0 auto 12px !important;
    border: 2px solid rgba(255, 255, 255, 0.18) !important;
    flex-shrink: 0 !important;
}

.group-info-title {
    margin: 0 0 6px !important;
    font-size: 1.22rem !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
    line-height: 1.3 !important;
}

.group-info-desc {
    margin: 0 0 10px !important;
    font-size: 0.85rem !important;
    color: #94a3b8 !important;
    line-height: 1.4 !important;
    max-width: 90% !important;
}

.group-info-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 14px !important;
    border-radius: 999px !important;
    font-size: 0.76rem !important;
    font-weight: 600 !important;
    background: rgba(6, 182, 212, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(6, 182, 212, 0.3) !important;
}

.group-info-members-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.group-info-member-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    transition: all 0.2s ease !important;
}

.group-info-member-text {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.group-info-member-name {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    color: #f8fafc !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.group-info-member-sub {
    font-size: 0.74rem !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.badge-group-admin {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    background: rgba(234, 179, 8, 0.15) !important;
    color: #facc15 !important;
    border: 1px solid rgba(234, 179, 8, 0.3) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* =========================================================================
   RESPONSIVE MOBILE OVERHAUL (SMARTPHONE VIEW <= 768px)
   ========================================================================= */
@media (max-width: 768px) {
    #panel-obrolan {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Saat berada di daftar percakapan (list view) */
    .chat-panel-container {
        height: calc(100dvh - 74px - 64px - env(safe-area-inset-bottom)) !important;
        min-height: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: rgba(11, 17, 32, 0.98) !important;
        overflow: hidden !important;
        width: 100% !important;
    }

    /* DEFAULT MOBILE: Hanya tampilkan Sidebar (Daftar Obrolan) */
    .chat-sidebar-col {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        border-right: none !important;
        display: flex !important;
        height: 100% !important;
    }

    .chat-main-col {
        display: none !important;
    }

    /* =========================================================================
       SAAT OBROLAN DIBUKA (.mobile-chat-open / body.mobile-chat-active):
       Sembunyikan topbar umum & bottom-nav, jadikan ruang obrolan FULLSCREEN murni
       seperti WhatsApp / Telegram asli tanpa ada elemen yang terpotong.
       ========================================================================= */
    body.mobile-chat-active #mobileTopBar {
        display: none !important;
    }

    body.mobile-chat-active .mobile-bottom-nav {
        display: none !important;
    }

    body.mobile-chat-active .main-content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }

    body.mobile-chat-active #panel-obrolan,
    body.mobile-chat-active .chat-panel-container {
        height: 100dvh !important;
        width: 100vw !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        background: #0b1120 !important;
        overflow: hidden !important;
    }

    .chat-panel-inner.mobile-chat-open {
        height: 100% !important;
        width: 100% !important;
    }

    .chat-panel-inner.mobile-chat-open .chat-sidebar-col {
        display: none !important;
    }

    .chat-panel-inner.mobile-chat-open .chat-main-col {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        background: #0b1120 !important;
    }

    .chat-mobile-back-btn {
        display: inline-flex !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
    }

    .chat-sidebar-header {
        padding: 12px 14px !important;
        gap: 10px !important;
    }

    .chat-sidebar-title {
        font-size: 1.05rem !important;
    }

    .chat-active-header {
        padding: max(10px, env(safe-area-inset-top)) 12px 10px 12px !important;
        min-height: 56px !important;
        box-sizing: border-box !important;
        gap: 8px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        background: rgba(15, 23, 42, 0.98) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        flex-shrink: 0 !important;
    }

    .chat-active-user-info {
        gap: 8px !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
    }

    .chat-active-title {
        font-size: 0.92rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .chat-active-subtitle {
        font-size: 0.72rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .chat-active-actions {
        gap: 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
    }

    .chat-active-actions .btn-chat-header-action {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.82rem !important;
        flex-shrink: 0 !important;
    }

    /* Area Pesan Chat */
    .chat-messages-container {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 12px 10px !important;
        gap: 8px !important;
    }

    .chat-message-row {
        max-width: 88% !important;
    }

    .chat-message-bubble {
        max-width: 100% !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        box-sizing: border-box !important;
        font-size: 0.88rem !important;
        padding: 8px 12px !important;
    }

    .chat-media-img {
        max-width: 100% !important;
        width: auto !important;
        max-height: 220px !important;
        height: auto !important;
        object-fit: contain !important;
        border-radius: 10px !important;
    }

    .chat-doc-card,
    .chat-audio-player,
    .chat-poll-card,
    .chat-link-preview-card {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .chat-bubble-reply-preview {
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .chat-message-bubble pre,
    .chat-message-bubble code {
        max-width: 100% !important;
        overflow-x: auto !important;
        white-space: pre-wrap !important;
        word-break: break-all !important;
        box-sizing: border-box !important;
    }

    /* Area Input Chat di Bawah */
    .chat-input-area {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px !important;
        background: rgba(15, 23, 42, 0.98) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        flex-shrink: 0 !important;
        position: sticky !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 50 !important;
        box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.4) !important;
    }

    .wa-input-bar {
        gap: 6px !important;
    }

    .btn-wa-attach,
    .btn-wa-emoji {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.15rem !important;
    }

    .chat-input-pill-wrap {
        min-height: 38px !important;
        padding: 2px 8px !important;
        border-radius: 20px !important;
    }

    .wa-input-field {
        min-height: 34px !important;
        padding: 6px 4px !important;
        font-size: 0.88rem !important;
    }

    .btn-chat-action-circle {
        width: 38px !important;
        height: 38px !important;
        font-size: 1rem !important;
    }

    /* Popover Lampiran (Attachment Menu) WhatsApp Mobile 4-Kolom */
    .chat-attachment-popover {
        bottom: calc(100% + 8px) !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: calc(100vw - 16px) !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px 4px !important;
        padding: 12px 8px !important;
        box-sizing: border-box !important;
    }

    .chat-attachment-popover.active {
        display: grid !important;
    }

    .chat-attachment-popover[style*="display: none"] {
        display: none !important;
    }

    .chat-attachment-item {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 6px 2px !important;
        gap: 6px !important;
    }

    .chat-attach-icon {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.15rem !important;
    }

    .chat-attach-label {
        font-size: 0.72rem !important;
        line-height: 1.15 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 68px !important;
    }

    /* Popover Sebut Anggota (@mention) di Mobile */
    .chat-mention-popover {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: calc(100vw - 16px) !important;
        max-height: 180px !important;
        box-sizing: border-box !important;
    }

    /* Popover Emoji Cepat di Mobile */
    .chat-emoji-popover {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: calc(100vw - 16px) !important;
        box-sizing: border-box !important;
    }

    /* In-Chat Search Bar di Mobile */
    .chat-in-search-bar {
        padding: 6px 10px !important;
        gap: 4px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .chat-in-search-bar input {
        font-size: 0.82rem !important;
        min-width: 0 !important;
    }

    .chat-bubble-side-actions {
        display: inline-flex !important;
        opacity: 0.9 !important;
    }

    .btn-bubble-reply {
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
    }
}

/* =========================================================================
   IN-APP CHAT NOTIFICATION BANNER (TOAST MUNCUL KETIKA ADA CHAT MASUK)
   ========================================================================= */
.chat-in-app-banner {
    position: fixed;
    top: -140px;
    left: 50%;
    transform: translateX(-50%) scale(0.92);
    width: calc(100vw - 32px);
    max-width: 460px;
    z-index: 999999;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.97) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 20px;
    box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.75), 0 0 30px rgba(56, 189, 248, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    padding: 12px 16px 14px 16px;
    transition: all 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
}

.chat-in-app-banner.show {
    top: 18px;
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

.chat-in-app-banner:hover {
    transform: translateX(-50%) translateY(-2px) scale(1.01);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 24px 54px -10px rgba(0, 0, 0, 0.85), 0 0 36px rgba(56, 189, 248, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .chat-in-app-banner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.98) 100%);
    border-color: rgba(14, 165, 233, 0.4);
    box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.18), 0 0 24px rgba(14, 165, 233, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Accent glowing line at the top */
.chat-banner-top-line {
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2.5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
}

/* Header: Tag + Time + Close Button */
.chat-banner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.chat-banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chat-banner-tag.tag-direct {
    background: rgba(6, 182, 212, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.chat-banner-tag.tag-group {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.35);
}

.chat-banner-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-banner-time {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

[data-theme="light"] .chat-banner-time {
    color: #64748b;
}

.chat-banner-close-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    margin: 0;
    outline: none;
    box-sizing: border-box;
}

.chat-banner-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: scale(1.15) rotate(90deg);
}

[data-theme="light"] .chat-banner-close-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

/* Main Content: Avatar + Text + CTA */
.chat-banner-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.chat-banner-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.chat-banner-avatar.avatar-direct {
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.chat-banner-avatar.avatar-group {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border: 1px solid rgba(192, 132, 252, 0.4);
}

.chat-banner-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-banner-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #0f172a;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
}

[data-theme="light"] .chat-banner-status-dot {
    border-color: #ffffff;
}

.chat-banner-text-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-banner-title-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.chat-banner-name {
    font-size: 0.94rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

[data-theme="light"] .chat-banner-name {
    color: #0f172a;
}

.chat-banner-preview {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .chat-banner-preview {
    color: #475569;
}

.chat-banner-sender-name {
    color: #38bdf8;
    font-weight: 600;
}

[data-theme="light"] .chat-banner-sender-name {
    color: #0284c7;
}

.chat-banner-message-text {
    color: #e2e8f0;
}

[data-theme="light"] .chat-banner-message-text {
    color: #334155;
}

.chat-banner-cta {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-in-app-banner:hover .chat-banner-cta {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

[data-theme="light"] .chat-banner-cta {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.2);
}

/* Auto-dismiss animated progress bar */
.chat-banner-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    overflow: hidden;
}

.chat-banner-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transform-origin: left;
    animation: chatBannerProgress 5.5s linear forwards;
}

@keyframes chatBannerProgress {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}

@media (max-width: 480px) {
    .chat-in-app-banner {
        width: calc(100vw - 20px);
        max-width: none;
        padding: 10px 14px 12px 14px;
        border-radius: 16px;
    }
    .chat-in-app-banner.show {
        top: 10px;
    }
    .chat-banner-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 12px;
    }
    .chat-banner-name {
        font-size: 0.88rem;
    }
    .chat-banner-preview {
        font-size: 0.78rem;
    }
    .chat-banner-cta {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

#btnDeleteOptionEveryone:hover,
#btnDeleteOptionMe:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

#btnDeleteOptionEveryone:active,
#btnDeleteOptionMe:active {
    transform: scale(0.98);
}

/* =========================================================================
   ADVANCED CHAT STYLES (ATTACHMENTS, VOICE NOTES, PIN, SEARCH, FORWARD)
   ========================================================================= */

/* Tombol Alat Input (Attachment, Mic) */
.btn-chat-tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.btn-chat-tool-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    transform: translateY(-1px);
}

.btn-chat-tool-btn:active {
    transform: scale(0.95);
}

/* Bilah Perekaman Suara (Voice Recording Bar) */
.chat-voice-recording-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 14px;
    margin-top: 6px;
    animation: fadeInSlideUp 0.25s ease-out;
}

.voice-recording-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
    animation: recordPulse 1.2s infinite;
}

@keyframes recordPulse {
    0% { transform: scale(0.85); opacity: 0.6; }
    50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 16px #ef4444; }
    100% { transform: scale(0.85); opacity: 0.6; }
}

.voice-recording-time {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f87171;
    font-family: monospace;
}

.voice-recording-label {
    flex: 1;
    font-size: 0.82rem;
    color: #cbd5e1;
}

.btn-voice-cancel {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-voice-cancel:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
}

.btn-voice-send {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    border: none;
    color: #ffffff;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
    transition: all 0.2s;
}

.btn-voice-send:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.5);
}

/* Lampiran Gambar di Chat */
.chat-media-img {
    max-width: 280px;
    max-height: 240px;
    border-radius: 10px;
    margin-top: 6px;
    cursor: pointer;
    display: block;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s, filter 0.2s;
}

.chat-media-img:hover {
    transform: scale(1.02);
    filter: brightness(1.05);
}

/* Kartu Dokumen Pembelajaran di Chat */
.chat-doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    margin-top: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    max-width: 320px;
}

.chat-doc-card:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.chat-doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-doc-info {
    flex: 1;
    min-width: 0;
}

.chat-doc-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.chat-doc-size {
    font-size: 0.72rem;
    color: #94a3b8;
}

.chat-doc-download-btn {
    color: #38bdf8;
    font-size: 0.95rem;
    padding: 6px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.chat-doc-card:hover .chat-doc-download-btn {
    transform: translateY(2px);
}

/* Pemutar Audio Voice Note Kustom */
.chat-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    margin-top: 6px;
    min-width: 210px;
    max-width: 280px;
}

.chat-audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.chat-audio-btn:hover {
    transform: scale(1.08);
}

.chat-audio-progress-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-audio-scrubber {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

.chat-audio-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    box-shadow: 0 0 6px #38bdf8;
}

.chat-audio-time {
    font-size: 0.68rem;
    color: #94a3b8;
    font-family: monospace;
}

/* Banner Pesan Disematkan (Pinned Message Banner) */
.chat-pinned-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.94);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    border-left: 3px solid #38bdf8;
    cursor: pointer;
    transition: background 0.2s;
    animation: fadeInSlideDown 0.2s ease-out;
}

.chat-pinned-banner:hover {
    background: rgba(56, 189, 248, 0.12);
}

.chat-pinned-icon {
    color: #38bdf8;
    font-size: 0.95rem;
    transform: rotate(45deg);
    flex-shrink: 0;
}

.chat-pinned-info {
    flex: 1;
    min-width: 0;
}

.chat-pinned-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}

.chat-pinned-text {
    font-size: 0.82rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-chat-unpin {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    font-size: 0.88rem;
    border-radius: 4px;
    transition: color 0.15s;
}

.btn-chat-unpin:hover {
    color: #f87171;
}

/* Bilah Pencarian Pesan Dalam Obrolan (In-Chat Search Bar) */
.chat-in-search-bar {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    animation: fadeInSlideDown 0.2s ease-out;
}

.chat-in-search-bar input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 12px;
    color: #f8fafc;
    font-size: 0.84rem;
    outline: none;
}

.chat-in-search-bar input:focus {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

.btn-in-search-nav {
    background: none;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-in-search-nav:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-in-search-close {
    background: none;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    transition: all 0.15s;
}

.btn-in-search-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.chat-search-highlight {
    background: rgba(250, 204, 21, 0.4);
    color: #fef08a;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

.chat-search-highlight.current {
    background: #eab308;
    color: #000;
    box-shadow: 0 0 8px #eab308;
}

/* Tag Diteruskan (Forwarded Tag) */
.chat-forward-tag {
    font-size: 0.7rem;
    color: #94a3b8;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
}

/* Animasi Flash Highlight Pesan */
@keyframes msgFlash {
    0% { background: rgba(56, 189, 248, 0.4); transform: scale(1.02); }
    100% { background: transparent; transform: scale(1); }
}

.chat-msg-flash {
    animation: msgFlash 1.5s ease-out;
}

/* Animasi Titik Mengetik (Typing Dots) */
.chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.chat-typing-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #38bdf8;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes fadeInSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ==========================================================================
   FITUR MENTION ANGGOTA GRUP (@) & AUTOCOMPLETE
   ========================================================================== */

.chat-mention-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 12px;
    right: 12px;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px rgba(56, 189, 248, 0.15);
    z-index: 70;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-mention-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-mention-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
}

.chat-mention-hint {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-left: auto;
    margin-right: 8px;
}

.btn-mention-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
    transition: all 0.15s;
}

.btn-mention-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.chat-mention-list {
    overflow-y: auto;
    max-height: 220px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-mention-list::-webkit-scrollbar {
    width: 5px;
}

.chat-mention-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

.chat-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    border-left: 3px solid transparent;
}

.chat-mention-item:hover,
.chat-mention-item.active {
    background: rgba(56, 189, 248, 0.16);
    border-left-color: #38bdf8;
}

.chat-mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
}

.chat-mention-avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
}

.chat-mention-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.chat-mention-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-mention-role {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tag Mention di dalam Pesan Bubble */
.chat-mention-tag {
    background: rgba(56, 189, 248, 0.22);
    color: #38bdf8;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.38);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: all 0.15s ease;
    word-break: break-word;
}

.chat-mention-tag:hover {
    background: rgba(56, 189, 248, 0.32);
    border-color: rgba(56, 189, 248, 0.6);
}

.chat-mention-tag.mention-all {
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.45);
}

.chat-mention-tag.mention-all:hover {
    background: rgba(245, 158, 11, 0.32);
    border-color: rgba(245, 158, 11, 0.7);
}

/* Bubble yang menyebut pengguna aktif saat ini (Ambient Highlight) */
.chat-bubble.mentioned-me,
.chat-message-bubble.mentioned-me {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.32);
    border-left: 3.5px solid #f59e0b !important;
    animation: pulseMentionBubble 2s ease-in-out;
}

@keyframes pulseMentionBubble {
    0% { transform: scale(1); }
    30% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   WHATSAPP WEB STYLE ATTACHMENT POPOVER & INPUT BAR (IMAGE 2)
   ========================================================================== */

/* Menu Lampiran Vertikal WhatsApp Web (Image 2) */
.chat-attachment-popover {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 8px;
    z-index: 120;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 10px 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 210px;
    animation: fadeInSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom left;
}

.chat-attachment-popover[style*="display: none"] {
    display: none !important;
}

.chat-attachment-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.chat-attachment-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.chat-attach-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.chat-attach-icon.bg-purple {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.chat-attach-icon.bg-blue {
    background: linear-gradient(135deg, #0284c7, #0369a1);
}

.chat-attach-icon.bg-pink {
    background: linear-gradient(135deg, #e11d48, #be123c);
}

.chat-attach-icon.bg-orange {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

.chat-attach-icon.bg-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.chat-attach-icon.bg-yellow {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.chat-attach-icon.bg-emerald {
    background: linear-gradient(135deg, #10b981, #059669);
}

.chat-attach-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #f1f5f9;
    letter-spacing: 0.2px;
}

/* WhatsApp Web Style Input Bar */
.wa-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    position: relative;
    width: 100%;
}

.btn-wa-attach,
.btn-wa-emoji {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    flex-shrink: 0 !important;
}

.btn-wa-attach:hover,
.btn-wa-emoji:hover {
    color: #38bdf8 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: scale(1.06);
}

.btn-wa-attach.active {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.15) !important;
}

.chat-input-pill-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 2px 10px;
    transition: all 0.2s ease;
    min-height: 42px;
    box-sizing: border-box;
}

.chat-input-pill-wrap:focus-within {
    border-color: #06b6d4;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}

.wa-input-field {
    flex: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 8px 6px !important;
    color: #f8fafc !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    min-height: 36px !important;
    max-height: 120px !important;
    resize: none !important;
}

.btn-chat-action-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-wa-mic {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 1.15rem;
}

.btn-wa-mic:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    transform: scale(1.05);
}

.btn-wa-send {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    font-size: 1.05rem;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    animation: sendPop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-wa-send:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.55);
}

@keyframes sendPop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   FLOATING CONTEXT MENU BUBBLE CHAT (LONG PRESS & KLIK KANAN)
   ========================================================================== */

.chat-bubble-context-menu {
    position: fixed;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.15);
    padding: 8px 6px;
    min-width: 205px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: contextPop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top left;
}

@keyframes contextPop {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.chat-context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 0.86rem;
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.chat-context-menu-item:hover {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
}

.chat-context-icon {
    width: 20px;
    font-size: 0.95rem;
    text-align: center;
    flex-shrink: 0;
}

.chat-context-icon.text-cyan { color: #06b6d4; }
.chat-context-icon.text-amber { color: #f59e0b; }
.chat-context-icon.text-blue { color: #3b82f6; }
.chat-context-icon.text-purple { color: #a855f7; }
.chat-context-icon.text-emerald { color: #10b981; }
.chat-context-icon.text-sky { color: #38bdf8; }
.chat-context-icon.text-rose { color: #f87171; }

.chat-context-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 6px;
}

.chat-context-menu-item.item-danger {
    color: #f87171;
}

.chat-context-menu-item.item-danger:hover {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444;
}

/* Interactivity on chat message bubble */
.chat-message-bubble {
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-message-bubble:active {
    transform: scale(0.99);
}

.chat-bubble-content {
    -webkit-user-select: text;
    user-select: text;
}

/* =========================================================================
   WHATSAPP-STYLE CREATE POLL SCREEN (JAJAK PENDAPAT MODAL)
   ========================================================================= */
.wa-poll-screen-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(5, 10, 14, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100050 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    animation: waFadeIn 0.2s ease;
}

@keyframes waFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wa-poll-screen-container {
    width: 100%;
    max-width: 450px;
    height: 100vh;
    max-height: 100vh;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(14, 165, 233, 0.1);
    overflow: hidden;
    color: #f8fafc;
    font-family: inherit;
}

@media (min-width: 600px) {
    .wa-poll-screen-container {
        height: 660px;
        max-height: 90vh;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
}

.wa-poll-top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.wa-poll-back-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.wa-poll-back-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.wa-poll-header-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.2px;
}

.wa-poll-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 90px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wa-poll-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wa-poll-field-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.2px;
}

.wa-poll-input-box {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.wa-poll-input-box:focus-within,
.wa-poll-input-box.active-highlight:focus-within {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.wa-poll-field-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #f8fafc !important;
    font-size: 0.95rem !important;
    padding: 13px 14px !important;
    font-family: inherit !important;
    box-shadow: none !important;
}

.wa-poll-field-input::placeholder {
    color: #64748b;
    opacity: 0.85;
}

.wa-poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wa-poll-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0 10px 0 0;
    transition: all 0.2s ease;
}

.wa-poll-option-row:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.wa-poll-opt-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-size: 0.76rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    flex-shrink: 0;
}

.wa-poll-opt-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #f8fafc !important;
    font-size: 0.92rem !important;
    padding: 12px 10px !important;
    font-family: inherit !important;
    box-shadow: none !important;
}

.wa-poll-opt-input::placeholder {
    color: #64748b;
}

.wa-poll-opt-del {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.wa-poll-opt-del:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

.wa-poll-btn-add-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.08);
    border: 1.5px dashed rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.wa-poll-btn-add-opt:hover {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Switch Allow Multiple Answers */
.wa-poll-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 6px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wa-poll-switch-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #f8fafc;
}

.wa-poll-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    cursor: pointer;
}

.wa-poll-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wa-poll-toggle-slider {
    position: absolute;
    inset: 0;
    background: #334155;
    border-radius: 34px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
}

.wa-poll-toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wa-poll-check-icon {
    position: absolute;
    right: 8px;
    font-size: 0.72rem;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wa-poll-toggle-switch input:checked + .wa-poll-toggle-slider {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.wa-poll-toggle-switch input:checked + .wa-poll-toggle-slider::before {
    transform: translateX(20px);
}

.wa-poll-toggle-switch input:checked + .wa-poll-toggle-slider .wa-poll-check-icon {
    opacity: 1;
    left: 8px;
    right: auto;
}

/* Floating Action Send Button */
.wa-poll-fab-send {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.wa-poll-fab-send:hover {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.65);
}

.wa-poll-fab-send:active {
    transform: scale(0.95);
}

/* =========================================================================
   WHATSAPP-STYLE POLL IN CHAT BUBBLE
   ========================================================================= */
.chat-poll-bubble-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 250px;
    max-width: 360px;
    width: 100%;
    padding: 2px 0;
    box-sizing: border-box;
}

.chat-poll-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

.chat-poll-question {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #e9edef;
    line-height: 1.35;
    word-break: break-word;
}

.chat-poll-subtitle {
    font-size: 0.76rem;
    color: #8696a0;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.bubble-me .chat-poll-subtitle {
    color: #a7f3d0;
}

.chat-poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-poll-opt-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.chat-poll-opt-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.chat-poll-opt-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-poll-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #8696a0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.chat-poll-circle.checked {
    border-color: #0ea5e9;
    background: #0ea5e9;
    color: #ffffff;
    font-size: 0.65rem;
}

.chat-poll-opt-text {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 500;
    color: #e9edef;
    word-break: break-word;
}

.chat-poll-opt-count {
    font-size: 0.82rem;
    color: #8696a0;
    font-weight: 600;
    padding-left: 4px;
}

.bubble-me .chat-poll-opt-count {
    color: #cbd5e1;
}

.chat-poll-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.chat-poll-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    border-radius: 3px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 0;
}

.chat-poll-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0 2px 0;
}

.chat-poll-view-votes-action {
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: #38bdf8;
    cursor: pointer;
    padding: 6px 0;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.bubble-me .chat-poll-view-votes-action {
    color: #7dd3fc;
}

.chat-poll-view-votes-action:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* =========================================================================
   POLL DETAILS / VIEW VOTES MODAL
   ========================================================================= */
.wa-poll-details-container {
    max-width: 460px;
}

.poll-details-option-block {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poll-details-opt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-details-opt-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e9edef;
}

.poll-details-opt-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    padding: 3px 8px;
    border-radius: 999px;
}

.poll-details-voters-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.poll-voter-empty {
    font-size: 0.78rem;
    color: #8696a0;
    font-style: italic;
    padding: 4px 0;
}

.poll-voter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.poll-voter-item:last-child {
    border-bottom: none;
}

.poll-voter-info {
    flex: 1;
    min-width: 0;
}

.poll-voter-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #e9edef;
}

.poll-voter-meta {
    font-size: 0.72rem;
    color: #8696a0;
}

/* Group Info Member Management Actions */
.btn-group-action-coadmin,
.btn-group-action-kick {
    transition: all 0.18s ease !important;
}

.btn-group-action-coadmin:hover {
    filter: brightness(1.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
}

.btn-group-action-kick:hover {
    filter: brightness(1.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-group-action-coadmin:active,
.btn-group-action-kick:active {
    transform: translateY(0);
}

/* ==========================================================================
   LINK PREVIEW CARDS (YOUTUBE & WEB LINKS)
   ========================================================================== */
.chat-link-preview-card {
    margin-top: 8px;
    margin-bottom: 2px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    max-width: 330px;
    display: block;
    text-decoration: none !important;
}

.chat-link-preview-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.chat-link-preview-inner {
    text-decoration: none !important;
    display: block;
    color: inherit;
}

.chat-link-media-wrap {
    position: relative;
    width: 100%;
    height: 165px;
    background: #020617;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-link-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.chat-link-preview-card:hover .chat-link-thumb {
    transform: scale(1.05);
}

.chat-link-play-badge {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    padding-left: 3px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
    transition: all 0.25s ease;
    z-index: 2;
}

.chat-link-preview-card:hover .chat-link-play-badge {
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.chat-link-domain-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    z-index: 2;
}

.chat-link-content {
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-link-site-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-link-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chat-link-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Generic Web Link Preview (Compact Horizontal) */
.chat-link-generic-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 72px;
}

.chat-link-generic-thumb-wrap {
    width: 80px;
    min-width: 80px;
    background: #020617;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-link-generic-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-link-generic-content {
    padding: 8px 10px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Add Member Modal Checklist Items */
.add-member-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-member-check-item:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
}

.add-member-check-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #06b6d4;
    cursor: pointer;
}

/* ==========================================================================
   YOUTUBE FLOATING PICTURE-IN-PICTURE (PIP) PLAYER
   ========================================================================== */
.chat-youtube-pip-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: rgba(15, 23, 42, 0.96);
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999999;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    user-select: none;
}

.chat-youtube-pip-container.pip-large {
    width: 540px;
}

.chat-youtube-pip-container:hover {
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 25px rgba(6, 182, 212, 0.25);
}

.chat-pip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: grab;
    touch-action: none;
}

.chat-pip-header:active {
    cursor: grabbing;
}

.chat-pip-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.chat-pip-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-pip-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-pip-action {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none !important;
}

.btn-pip-action:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.1);
}

.btn-pip-action.btn-pip-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.chat-pip-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.chat-pip-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Link Preview Card Enhancements for PIP */
.chat-link-pip-hint {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    transition: all 0.2s ease;
    pointer-events: none;
}

.chat-link-preview-card:hover .chat-link-pip-hint {
    background: rgba(6, 182, 212, 0.95);
    color: #ffffff;
    border-color: #06b6d4;
    transform: scale(1.05);
}

.chat-link-ext-btn {
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none !important;
}

.chat-link-ext-btn:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

@media (max-width: 640px) {
    .chat-youtube-pip-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: auto !important;
        max-width: none;
    }
}

/* ==========================================================================
   MULTI-SELECTION & PIN CHAT SYSTEM (WHATSAPP STYLE)
   ========================================================================== */

.chat-sidebar-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0 6px;
    animation: fadeInSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-selection-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-selection-count {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.02em;
}

.chat-selection-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-chat-header-action.btn-action-danger:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

/* Checkbox Multi-selection di Kartu Obrolan */
.chat-conv-select-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #64748b;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    font-size: 0.72rem;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    margin-right: 8px;
}

.chat-conv-select-checkbox.checked {
    background: #06b6d4;
    border-color: #06b6d4;
    color: #042f2e;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.45);
}

.chat-conv-item.selection-mode {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.chat-conv-item.selection-mode.selected {
    background: rgba(6, 182, 212, 0.12) !important;
    border-left: 3px solid #06b6d4;
}

/* Indikator Pin Obrolan (📌 Sematkan Chat) */
.chat-pin-icon {
    color: #38bdf8;
    font-size: 0.75rem;
    transform: rotate(45deg);
    display: inline-block;
    margin-left: 4px;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.5));
}

.chat-conv-item.is-pinned {
    background: rgba(255, 255, 255, 0.018);
    border-bottom: 1px solid rgba(56, 189, 248, 0.08);
}

.chat-conv-item.is-pinned:hover {
    background: rgba(255, 255, 255, 0.045);
}

/* Context Menu Obrolan (Klik Kanan Desktop / Aksi Cepat) */
.chat-conv-context-menu {
    position: fixed;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 0, 0, 0.35);
    padding: 6px;
    min-width: 180px;
    animation: fadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-conv-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.chat-conv-context-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #38bdf8;
}

.chat-conv-context-item.danger {
    color: #f87171;
}

.chat-conv-context-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Header Dropdown Menu (Titik Tiga di Header Percakapan) */
.chat-header-menu-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.chat-header-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 0, 0, 0.35);
    padding: 6px;
    min-width: 175px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: fadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
    white-space: nowrap;
}

.chat-header-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #38bdf8;
}

.chat-header-dropdown-item.danger {
    color: #f87171;
}

.chat-header-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

[data-theme="light"] .chat-header-dropdown-menu,
body.light-mode .chat-header-dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .chat-header-dropdown-item,
body.light-mode .chat-header-dropdown-item {
    color: #1e293b;
}

[data-theme="light"] .chat-header-dropdown-item:hover,
body.light-mode .chat-header-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0284c7;
}

[data-theme="light"] .chat-header-dropdown-item.danger,
body.light-mode .chat-header-dropdown-item.danger {
    color: #dc2626;
}

[data-theme="light"] .chat-header-dropdown-item.danger:hover,
body.light-mode .chat-header-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}

/* =========================================================================
   MODE SELEKSI BANYAK PESAN (BULK SELECTION & DELETE CHAT BUBBLE)
   ========================================================================= */
.chat-active-header-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    gap: 8px;
    animation: fadeIn 0.15s ease;
}

.chat-message-row.chat-msg-selectable {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    border-radius: 12px;
    padding: 3px 6px;
    margin: 2px 0;
}

.chat-message-row.chat-msg-selectable:hover {
    background: rgba(56, 189, 248, 0.08);
}

.chat-message-row.chat-msg-selected {
    background: rgba(56, 189, 248, 0.14) !important;
}

.chat-message-row.chat-msg-selected .chat-message-bubble {
    box-shadow: 0 0 0 2px #38bdf8, 0 4px 15px rgba(56, 189, 248, 0.35) !important;
}

.chat-msg-select-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px 0 2px;
    flex-shrink: 0;
}

.chat-msg-select-checkbox {
    width: 19px;
    height: 19px;
    accent-color: #0284c7;
    cursor: pointer;
    border-radius: 6px;
}

/* ==========================================================================
   DARK MODE TEXT PROTECTIONS (PREVENT GLOBAL STYLESHEET OVERRIDES)
   ========================================================================== */
html:not([data-theme="light"]) .chat-conv-title,
body:not(.light-mode) .chat-conv-title {
    color: #f8fafc !important;
}

html:not([data-theme="light"]) .chat-active-name,
body:not(.light-mode) .chat-active-name {
    color: #f8fafc !important;
}

html:not([data-theme="light"]) .chat-sidebar-title,
body:not(.light-mode) .chat-sidebar-title {
    color: #f8fafc !important;
}

html:not([data-theme="light"]) .chat-search-input,
body:not(.light-mode) .chat-search-input {
    background: transparent !important;
    color: #f8fafc !important;
}

html:not([data-theme="light"]) .chat-input,
body:not(.light-mode) .chat-input {
    background: rgba(15, 23, 42, 0.6) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

html:not([data-theme="light"]) .chat-search-wrap,
body:not(.light-mode) .chat-search-wrap {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   LIGHT MODE OVERRIDES FOR CHAT & DISCUSSION MODULE
   ========================================================================== */
[data-theme="light"] .chat-panel-container,
body.light-mode .chat-panel-container {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .chat-sidebar-col,
body.light-mode .chat-sidebar-col {
    background: #ffffff !important;
    border-right-color: #e2e8f0 !important;
}

[data-theme="light"] .chat-sidebar-header,
body.light-mode .chat-sidebar-header {
    background: #ffffff !important;
    border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .chat-sidebar-title,
body.light-mode .chat-sidebar-title {
    color: #0f172a !important;
}

[data-theme="light"] .chat-search-wrap,
body.light-mode .chat-search-wrap {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .chat-search-input,
body.light-mode .chat-search-input {
    color: #0f172a !important;
    background: transparent !important;
}

[data-theme="light"] .chat-search-input::placeholder,
body.light-mode .chat-search-input::placeholder {
    color: #64748b !important;
}

[data-theme="light"] .chat-search-icon,
body.light-mode .chat-search-icon {
    color: #64748b !important;
}

[data-theme="light"] .chat-filter-pills,
body.light-mode .chat-filter-pills {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .chat-filter-pill,
body.light-mode .chat-filter-pill {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .chat-filter-pill:hover,
body.light-mode .chat-filter-pill:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

[data-theme="light"] .chat-filter-pill.active,
body.light-mode .chat-filter-pill.active {
    background: #0891b2 !important;
    color: #ffffff !important;
    border-color: #0891b2 !important;
}

[data-theme="light"] .chat-filter-pill-online.active,
body.light-mode .chat-filter-pill-online.active {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

[data-theme="light"] .chat-conv-item,
body.light-mode .chat-conv-item {
    border-bottom-color: #f1f5f9 !important;
}

[data-theme="light"] .chat-conv-item:hover,
body.light-mode .chat-conv-item:hover {
    background: #f8fafc !important;
}

[data-theme="light"] .chat-conv-item.active,
body.light-mode .chat-conv-item.active {
    background: #f0fdfa !important;
    border-left: 3px solid #06b6d4 !important;
}

[data-theme="light"] .chat-conv-title,
body.light-mode .chat-conv-title {
    color: #0f172a !important;
    font-weight: 700 !important;
}

[data-theme="light"] .chat-conv-time,
body.light-mode .chat-conv-time {
    color: #64748b !important;
}

[data-theme="light"] .chat-conv-last-msg,
body.light-mode .chat-conv-last-msg {
    color: #64748b !important;
}

[data-theme="light"] .chat-conv-item.unread .chat-conv-last-msg,
body.light-mode .chat-conv-item.unread .chat-conv-last-msg {
    color: #0f172a !important;
    font-weight: 600 !important;
}

[data-theme="light"] .chat-conv-item.unread .chat-conv-title,
body.light-mode .chat-conv-item.unread .chat-conv-title {
    color: #0891b2 !important;
}

[data-theme="light"] .chat-main-col,
body.light-mode .chat-main-col {
    background: #f8fafc !important;
}

[data-theme="light"] .chat-active-header,
body.light-mode .chat-active-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .chat-active-name,
body.light-mode .chat-active-name {
    color: #0f172a !important;
    font-weight: 700 !important;
}

[data-theme="light"] .chat-active-status,
body.light-mode .chat-active-status {
    color: #64748b !important;
}

[data-theme="light"] .chat-pinned-banner,
body.light-mode .chat-pinned-banner {
    background: #f0fdf4 !important;
    border-bottom: 1px solid #bbf7d0 !important;
    color: #166534 !important;
}

[data-theme="light"] .chat-pinned-banner .chat-pinned-text,
body.light-mode .chat-pinned-banner .chat-pinned-text {
    color: #15803d !important;
}

[data-theme="light"] .chat-pinned-banner .chat-pinned-title,
body.light-mode .chat-pinned-banner .chat-pinned-title {
    color: #14532d !important;
}

/* Chat Bubbles in Light Mode */
[data-theme="light"] .chat-msg-row.other .chat-bubble,
body.light-mode .chat-msg-row.other .chat-bubble {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .chat-msg-row.other .chat-bubble .chat-msg-text,
body.light-mode .chat-msg-row.other .chat-bubble .chat-msg-text {
    color: #1e293b !important;
}

[data-theme="light"] .chat-msg-row.other .chat-bubble .chat-msg-time,
body.light-mode .chat-msg-row.other .chat-bubble .chat-msg-time {
    color: #64748b !important;
}

[data-theme="light"] .chat-msg-row.me .chat-bubble,
body.light-mode .chat-msg-row.me .chat-bubble {
    background: #dbeafe !important;
    color: #1e3a8a !important;
    border: 1px solid #bfdbfe !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08) !important;
}

[data-theme="light"] .chat-msg-row.me .chat-bubble .chat-msg-text,
body.light-mode .chat-msg-row.me .chat-bubble .chat-msg-text {
    color: #1e3a8a !important;
}

[data-theme="light"] .chat-msg-row.me .chat-bubble .chat-msg-time,
body.light-mode .chat-msg-row.me .chat-bubble .chat-msg-time {
    color: #3b82f6 !important;
}

/* Voice Message in Light Mode */
[data-theme="light"] .chat-voice-msg-player,
body.light-mode .chat-voice-msg-player {
    background: rgba(241, 245, 249, 0.85) !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

[data-theme="light"] .chat-msg-row.me .chat-voice-msg-player,
body.light-mode .chat-msg-row.me .chat-voice-msg-player {
    background: rgba(219, 234, 254, 0.7) !important;
    border-color: #93c5fd !important;
    color: #1e3a8a !important;
}

[data-theme="light"] .chat-voice-title,
body.light-mode .chat-voice-title {
    color: #1e293b !important;
}

[data-theme="light"] .chat-voice-duration,
body.light-mode .chat-voice-duration {
    color: #64748b !important;
}

/* Date Separator in Light Mode */
[data-theme="light"] .chat-date-separator span,
body.light-mode .chat-date-separator span {
    background: #e2e8f0 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Chat Input Bar in Light Mode */
[data-theme="light"] .chat-input-bar,
body.light-mode .chat-input-bar {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .chat-input,
body.light-mode .chat-input {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .chat-input::placeholder,
body.light-mode .chat-input::placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] .btn-chat-input-action,
body.light-mode .btn-chat-input-action {
    color: #64748b !important;
}

[data-theme="light"] .btn-chat-input-action:hover,
body.light-mode .btn-chat-input-action:hover {
    color: #0284c7 !important;
    background: #f1f5f9 !important;
}

[data-theme="light"] .btn-chat-header-action,
body.light-mode .btn-chat-header-action {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

[data-theme="light"] .btn-chat-header-action:hover,
body.light-mode .btn-chat-header-action:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Multi-selection Bar in Light Mode */
[data-theme="light"] .chat-selection-count,
body.light-mode .chat-selection-count {
    color: #0f172a !important;
}

[data-theme="light"] .chat-conv-item.selection-mode.selected,
body.light-mode .chat-conv-item.selection-mode.selected {
    background: #ecfeff !important;
    border-left: 3px solid #0891b2 !important;
}

/* Context Menu in Light Mode */
[data-theme="light"] .chat-conv-context-menu,
body.light-mode .chat-conv-context-menu {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .chat-conv-context-item,
body.light-mode .chat-conv-context-item {
    color: #1e293b !important;
}

[data-theme="light"] .chat-conv-context-item:hover,
body.light-mode .chat-conv-context-item:hover {
    background: #f1f5f9 !important;
    color: #0284c7 !important;
}

/* Reaction & Attachment Popovers in Light Mode */
[data-theme="light"] .chat-attachment-popover,
body.light-mode .chat-attachment-popover {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 12px 35px rgba(0,0,0,0.12) !important;
}

[data-theme="light"] .chat-attachment-item-btn,
body.light-mode .chat-attachment-item-btn {
    color: #334155 !important;
}

[data-theme="light"] .chat-attachment-item-btn:hover,
body.light-mode .chat-attachment-item-btn:hover {
    background: #f1f5f9 !important;
    color: #0284c7 !important;
}

/* =========================================================================
   GELEMBUNG BUBBLE CHAT MENGETIK (TYPING INDICATOR BUBBLE DENGAN 3 TITIK ANIMASI)
   Sesuai gambar referensi: Bentuk oval dengan tail thought bubble & 3 bouncing dots
   ========================================================================= */
.chat-typing-bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 8px 0 12px 0;
    padding: 0 4px;
    width: 100%;
    box-sizing: border-box;
    animation: typingBubbleFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes typingBubbleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.92);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-typing-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-bottom: 2px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #38bdf8;
    overflow: hidden;
    user-select: none;
}

.chat-typing-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-typing-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    max-width: 80%;
}

.chat-typing-user-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #38bdf8;
    padding-left: 10px;
    margin-bottom: 1px;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Gelembung utama iMessage / WhatsApp style */
.chat-typing-speech-bubble {
    position: relative;
    background: #334155;
    border-radius: 20px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 36px;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    margin-left: 12px;
    margin-bottom: 4px;
}

/* Lingkaran sedang di sudut kiri bawah */
.chat-typing-speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -6px;
    width: 10px;
    height: 10px;
    background: #334155;
    border-radius: 50%;
}

/* Lingkaran kecil di ujung kiri bawah membentuk ekor bubble */
.chat-typing-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: -12px;
    width: 6px;
    height: 6px;
    background: #334155;
    border-radius: 50%;
}

/* 3 Titik Animasi Berkedip / Melenting Bouncing */
.chat-typing-dots-anim {
    display: flex;
    align-items: center;
    gap: 5.5px;
    height: 12px;
}

.chat-typing-dots-anim .typing-bubble-dot {
    width: 7.5px;
    height: 7.5px;
    border-radius: 50%;
    background-color: #94a3b8;
    display: inline-block;
    animation: typingBubbleDotWave 1.4s infinite ease-in-out both;
}

.chat-typing-dots-anim .typing-bubble-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-typing-dots-anim .typing-bubble-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.chat-typing-dots-anim .typing-bubble-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBubbleDotWave {
    0%, 80%, 100% {
        transform: translateY(0) scale(0.85);
        opacity: 0.45;
        background-color: #94a3b8;
    }
    40% {
        transform: translateY(-6px) scale(1.15);
        opacity: 1;
        background-color: #38bdf8;
    }
}

/* Penyesuaian Tampilan Mode Terang (Light Mode) Sesuai Gambar Referensi */
[data-theme="light"] .chat-typing-speech-bubble,
body.light-mode .chat-typing-speech-bubble {
    background: #e2e8f0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chat-typing-speech-bubble::before,
body.light-mode .chat-typing-speech-bubble::before {
    background: #e2e8f0;
}

[data-theme="light"] .chat-typing-speech-bubble::after,
body.light-mode .chat-typing-speech-bubble::after {
    background: #e2e8f0;
}

[data-theme="light"] .chat-typing-dots-anim .typing-bubble-dot,
body.light-mode .chat-typing-dots-anim .typing-bubble-dot {
    background-color: #94a3b8;
}

[data-theme="light"] .chat-typing-user-label,
body.light-mode .chat-typing-user-label {
    color: #0284c7;
    text-shadow: none;
}

/* ==========================================================================
   TAMPILAN PESAN DITARIK & AUTO-VANISH REAL-TIME
   ========================================================================== */

.chat-msg-retracted {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-style: italic;
    color: #94a3b8;
    font-size: 0.88rem;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px dashed rgba(239, 68, 68, 0.35);
    margin: 4px 0;
    transition: all 0.3s ease;
}

.chat-msg-retracted i {
    color: #ef4444;
    font-size: 0.88rem;
}

.chat-bubble-retracted {
    border-color: rgba(239, 68, 68, 0.35) !important;
    background: rgba(30, 41, 59, 0.75) !important;
    animation: pulseRetracted 0.6s ease-out;
}

@keyframes pulseRetracted {
    0% { transform: scale(1.03); opacity: 0.8; }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); opacity: 1; }
}

.chat-bubble-vanish {
    opacity: 0 !important;
    transform: scale(0.9) translateY(-10px) !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-theme="light"] .chat-msg-retracted,
body.light-mode .chat-msg-retracted {
    color: #64748b;
    background: #fef2f2;
    border-color: #fca5a5;
}

[data-theme="light"] .chat-bubble-retracted,
body.light-mode .chat-bubble-retracted {
    background: #f8fafc !important;
    border-color: #fca5a5 !important;
}

/* ==========================================================================
   FITUR PANGGILAN SUARA & VIDEO (WEBRTC P2P CALL)
   ========================================================================== */

@keyframes pulseCallGlow {
    0%, 100% { box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(56, 189, 248, 0.2); }
    50% { box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 45px rgba(56, 189, 248, 0.45); }
}

.call-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
    animation: ringPulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
    pointer-events: none;
}

.call-pulse-ring.ring-2 {
    animation-delay: 0.7s;
}

@keyframes ringPulse {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

.btn-call-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 600;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-call-action i {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.btn-call-reject i {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-call-accept i {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
    animation: bounceAccept 1s infinite alternate;
}

@keyframes bounceAccept {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

.btn-call-action:hover {
    transform: translateY(-3px);
}

.btn-call-action:active {
    transform: scale(0.95);
}

.call-timer-badge {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.call-timer-badge.active {
    display: inline-flex !important;
    animation: fadeInTimer 0.35s ease forwards;
}

.call-timer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: callPulse 1.6s infinite ease-in-out;
}

@keyframes fadeInTimer {
    from { opacity: 0; transform: translateY(-4px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes callPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.active-call-controls-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10;
}

.call-ctrl-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.call-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.08);
}

.call-ctrl-btn.active {
    background: #f87171;
    color: #ffffff;
}

.call-ctrl-btn.btn-end-call {
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
    font-size: 1.4rem;
}

.call-ctrl-btn.btn-end-call:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: scale(1.1);
}

.audio-wave-bars {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.audio-wave-bars.active {
    opacity: 1;
}

.audio-wave-bars .wave-bar {
    width: 5px;
    height: 12px;
    border-radius: 4px;
    background: #38bdf8;
    animation: waveBounce 1.2s ease-in-out infinite;
}

.audio-wave-bars.active .wave-bar {
    background: linear-gradient(to top, #10b981, #38bdf8);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.wave-bar.bar-1 { animation-delay: 0s; height: 12px; }
.wave-bar.bar-2 { animation-delay: 0.2s; height: 22px; }
.wave-bar.bar-3 { animation-delay: 0.4s; height: 28px; }
.wave-bar.bar-4 { animation-delay: 0.15s; height: 18px; }
.wave-bar.bar-5 { animation-delay: 0.35s; height: 10px; }

@keyframes waveBounce {
    0%, 100% { transform: scaleY(0.4); opacity: 0.6; }
    50% { transform: scaleY(1.2); opacity: 1; }
}

.chat-call-log-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
}

.chat-call-log-bubble i {
    color: #38bdf8;
    font-size: 0.95rem;
}

