/* ============================================
   CHAT LIST (Minimalist Redesign)
   Desain premium, desktop-focused, clean.
   ============================================ */

:root {
    --chat-border: #e2e8f0;
    --chat-bg-subtle: #f8fafc;
    --chat-text-main: #0f172a;
    --chat-text-muted: #64748b;
    --chat-primary: #0d9488;
    --chat-unread-dot: #3b82f6;
    --chat-radius: 12px;
}

.chat-list-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Toolbar */
.chat-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.chat-filters {
    display: flex;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 10px;
    gap: 0.25rem;
}

.chat-filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--chat-text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.chat-filter-btn:hover {
    color: var(--chat-text-main);
}

.chat-filter-btn.active {
    background: #fff;
    color: var(--chat-text-main);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chat-settings-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #fff;
    border: 1px solid var(--chat-border);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--chat-text-main);
    text-decoration: none;
    transition: all 0.2s;
}

.chat-settings-btn:hover {
    background: var(--chat-bg-subtle);
    border-color: #cbd5e1;
}

/* Stats */
.chat-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chat-stat-card {
    background: #fff;
    padding: 1.25rem;
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius);
    text-align: left;
}

.chat-stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--chat-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.chat-stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--chat-text-main);
}

/* Chat List Table-like */
.chat-list-card {
    background: #fff;
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius);
    overflow: hidden;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--chat-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    position: relative;
}

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

.chat-item:hover {
    background: var(--chat-bg-subtle);
}

/* Unread Indicator (The Minimalist Blue Dot) */
.chat-item.unread {
    background: #fffbeb; /* Soft Yellow background for new/pending */
    border-left: 5px solid #ef4444; /* Bright Red left border */
}



.chat-item.unread::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--chat-unread-dot);
    border-radius: 50%;
}

.chat-item-avatar {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    color: #94a3b8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.25rem;
}

.chat-item-body {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 200px 1fr 120px;
    align-items: center;
    gap: 1.5rem;
}

.chat-item-sender {
    min-width: 0;
}

.chat-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--chat-text-main);
    margin-bottom: 0.125rem;
}

.chat-item.unread .chat-name {
    color: var(--chat-text-main);
}

.chat-email {
    display: block;
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-message-preview {
    font-size: 0.875rem;
    color: var(--chat-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item.unread .chat-message-preview {
    font-weight: 500;
    color: var(--chat-text-main);
}

.chat-time {
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
    text-align: right;
}

/* Badge 'Butuh Bantuan' Minimalist */
.chat-badge-req {
    background: #fee2e2;
    color: #ef4444;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid #fecaca;
}

/* Indicators */
.chat-realtime-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #0f172a;
    color: #fff;
    padding: 0.625rem 1rem;
    border-radius: 30px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Live Indicator Badge */
.chat-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--chat-text-muted);
}

.chat-live-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.chat-update-time {
    font-size: 0.7rem;
    color: var(--chat-text-muted);
    font-weight: 500;
}

/* Empty State */

.chat-list-empty {
    padding: 5rem 2rem;
    text-align: center;
    color: var(--chat-text-muted);
}

.chat-list-empty .material-icons {
    font-size: 3.5rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .chat-item-body {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .chat-time {
        text-align: left;
        margin-top: 0.25rem;
    }
}
/* Bulk Actions */
.chat-bulk-actions {
    display: none; /* Hidden by default */
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.25rem;
    background: #fff;
    border: 1px solid #fee2e2;
    border-radius: 10px;
    animation: slideDown 0.2s ease-out;
}

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

.btn-bulk-delete {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-bulk-delete:hover {
    background: #dc2626;
}

.bulk-count {
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
    font-weight: 500;
}

/* Checkbox Style */
.chat-item-select {
    padding-right: 1.5rem;
    display: flex;
    align-items: center;
}

.chat-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--chat-primary);
}

/* Adjustments for item hover */
.chat-item:hover .chat-checkbox {
    border-color: var(--chat-primary);
}
/* Select All Control */
.select-all-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--chat-text-main);
    cursor: pointer;
    user-select: none;
}

.chat-checkbox-all {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--chat-primary);
}

.filter-divider {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 0.5rem;
}


