﻿.chat-container {
    display: flex;
     height: 100vh; /* fill parent container */
    max-height: 100%; /* prevent overflow beyond parent */
    overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

/* Chat main */

.chat-window {
    flex: 1;
    padding: 15px;
    overflow-y: auto; /* ✅ makes it scrollable */
    display: flex;
    flex-direction: column;
}

.sidebar-search {
    width: 100%;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

.chat-user b {
    color: black;
}

.chat-user {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
}

    .chat-user:hover {
        background: #f0f0f0;
    }

    .chat-user.active {
        background: #e4e6eb;
    }

    .chat-user img.chat-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 8px;
    }

.chat-lastmsg {
    font-size: 12px;
    color: #666;
}

/* Chat main */
.chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #f4f4f4;
    height: 100%;
    max-height: 100%;
}

.chat-header {
    flex-shrink: 0;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

    .chat-header img.chat-avatar-lg {
        width: 45px;
        height: 45px;
        border-radius: 50%;
        margin-right: 10px;
    }

.chat-status {
    font-size: 12px;
    color: gray;
}

/* Messages */
.chat-window {
    flex: 1; /* take available space */
    overflow-y: auto; /* only messages scroll */
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble {
    max-width: 60%;
    padding: 10px;
    margin: 5px 0;
    border-radius: 18px;
    position: relative;
}

    .chat-bubble.sent {
        align-self: flex-end;
        background: #0084ff;
        color: white;
    }

    .chat-bubble.received {
        align-self: flex-start;
        background: #e4e6eb;
    }

.chat-time {
    font-size: 10px;
    margin-top: 3px;
    opacity: 0.7;
}

/* Input bar */
.chat-input-bar {
    flex-shrink: 0;
    display: flex;
    padding: 8px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.chat-input {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 20px;
    background: #f0f2f5;
    margin-right: 10px;
}

.sidebar-toggle {
    display: none;
    margin-right: 10px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}
.chat-send {
    background: #0084ff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 18px;
}
@media (max-width: 768px) {
    .chat-container {
        display: flex;
        height: 77vh;
        max-height: 100%;
        overflow: hidden;
        flex-direction: column;
    }
    .chat-send {
        margin-right: 15px;
    }
    .chat-main {
        height: 100%;
    }
        .chat-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1000;
    }

        .chat-sidebar.open {
            transform: translateX(0);
        }

    .sidebar-toggle {
        display: inline-block;
    }
}
@media (max-width: 768px) {
    .chat-header .desktop-header {
        display: none;
    }
    .chat-main {
        height: 80%;
    }
    .chat-header .mobile-dropdown {
        display: block;
    }
}

@media (min-width: 769px) {
    .chat-header .desktop-header {
        display: flex;
    }

    .chat-header .mobile-dropdown {
        display: none;
    }
}
.chat-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.mobile-dropdown-list {
    z-index: 1000;
}

.mobile-dropdown-item:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}
.typing-indicator,
.typing-indicator-mobile {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 4px 0;
}

    .typing-indicator span,
    .typing-indicator-mobile span {
        width: 6px;
        height: 6px;
        background-color: #aaa;
        border-radius: 50%;
        display: inline-block;
        opacity: 0.4;
        animation: typingBounce 1.2s infinite ease-in-out;
    }

        .typing-indicator span:nth-child(1),
        .typing-indicator-mobile span:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-indicator span:nth-child(2),
        .typing-indicator-mobile span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3),
        .typing-indicator-mobile span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}
.client-dropdown
{
    margin-bottom:15px;
}
.client-dropdown select {
    width: 100%;
    padding: 6px;
    border-radius: 8px;
}

.client-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.client-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.client-name {
    max-width: 180px; /* adjust depending on sidebar width */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.client-dropdown .btn {
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 500;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.client-dropdown .dropdown-menu {
    border-radius: 12px;
    background: #ffffff;
    max-height: 250px;
    overflow-y: auto;
}

.client-option {
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

    .client-option:hover {
        background: #f1f3f5;
    }
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid #ddd;
    background: #f8f9fa;
}

.chat-input {
    flex-grow: 1;
    border-radius: 20px;
    padding: 0.5rem 1rem;
}

.chat-send {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-outline-warning,
.btn-outline-secondary {
    border: none !important; /* removes the entire border */
    box-shadow: none !important; /* optional: removes Bootstrap's focus outline shadow */
}
.ticket-link {
    font-weight: 500;
    color: #ffffff;
    text-decoration: underline;
    background: rgb(0 0 0 / 50%);
    padding: 2px 6px;
    border-radius: 5px;
}

    .ticket-link:hover {
        color: #ffeb3b; /* yellow on hover for visibility */
        background: rgb(2 31 249 / 100%);
    }
.bg-modal {
    --bs-bg-opacity: 1;
    background-color: #1a2d58;
}
.modal-title {
    color: #ffffff;
}
.warning-dialog {
    margin: 0 !important;
    top: 20px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.chat-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin: 4px 0;
}
/*.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;*/ /* ring around the dot */
/*}

    .status-indicator.online {
        background-color: #28a745;*/ /* green */
    /*}

    .status-indicator.offline {
        background-color: #6c757d;*/ /* gray */
    /*}*/
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
}

    .status-dot.online {
        background-color: var(--bs-primary);
        box-shadow: 0 0 4px rgba(13, 110, 253, 0.7);
    }

    .status-dot.offline {
        background-color: #ccc;
    }

.chat-user.active {
    background-color: rgba(13, 110, 253, 0.05);
}