/* Chat Sidebar */

div.position-fixed {
    z-index: 99999999;
}

.btn-primary {
    background: #05264e !important;
    border: 1px solid #05264e !important;
    transition: 0.4s;
    box-shadow: 5px 10px 20px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
    transition: 0.4s;
    background: #fff !important;
    box-shadow: 5px 10px 20px rgb(0 0 0 / 75%);
}

.btn-primary:hover .text-white {
    transition: 0.4s;
    color: #05264e !important;
}

.chat-sidebar {
    position: fixed;
    top: 70px;
    right: -400px;
    width: 350px;
    height: 80%;
    background: #fff;
    border-radius: 20px;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.chat-sidebar.open {
    right: 20px;
}

.chat-sidebar-header {
    background: #123a5d;
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-user {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
    cursor: pointer;
    position: relative;
}

.chat-user:hover {
    background: #f4f6f9;
}

.chat-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.chat-user .name {
    font-weight: 600;
}

.chat-user .last-message {
    font-size: 13px;
    color: #666;
}


/* Chat Box */

.chat-box {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 380px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999999;
}

.chat-header {
    background: #05264e;
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    height: 380px;
    overflow-y: auto;
    padding: 15px;
    background: #f9fafc;
    scroll-behavior: smooth;
}

.chat-sidebar-body {
    height: 380px;
}

.chat-message {
    padding: 10px 14px;
    border-radius: 18px;
    margin: 8px 0;
    max-width: 90%;
    word-wrap: break-word;
    font-size: 14px;
}

.chat-message small {
    display: block;
    text-align: right;
    width: 100%;
}

.sent {
    background: #05264e;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.received {
    background: #e9ecef;
    color: #222;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.chat-footer {
    display: flex;
    align-items: center;
    border-top: 1px solid #ddd;
    padding: 10px;
    background: #fff;
}

.chat-footer input {
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    background: #f1f3f6;
    outline: none;
    font-size: 14px;
}

.chat-footer button {
    background: #05264e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.chat-footer button:hover {
    background: #0062d1;
}

.btn .badge {
    position: absolute !important;
    top: 0px !important;
    right: -5px;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
}

.btn .badge:hover {
    background-color: #ededed !important;
}

.chat-user .badge.bg-danger {
    position: absolute !important;
    top: 5px !important;
    left: 5px;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
}

@media (max-width: 576px) {
    .chat-sidebar {
        width: 300px;
        height: 400px;
    }
    .chat-box {
        width: 300px;
        bottom: 100px;
    }
    .chat-body {
        height: 325px;
    }
    .chat-sidebar-body {
        height: 325px;
    }
}