.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #cbd8f6, #b1dbf9);
    padding: 15px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: bold;
    color: #000;

}

.icon-down {
    transition: transform 0.3s ease;
}

.dropdown-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 160px;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    perspective: 600px;
}

.dropdown-menu a {
    opacity: 0;
    transform: rotateX(-90deg);
    animation: dropdown3D 1s forwards;
    animation-delay: calc(var(--i) * 0.1s);
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #0f038d8e;
    font-size: 16px;
    transition: background 0.3s, transform 0.3s;
    border-radius: 6px;
    transform-origin: top center;
    font-weight: bold;
}

.dropdown-menu a:hover {
    background: rgba(134, 155, 249, 0.2);
    transform: translateX(6px) rotateX(0deg);
    color: #000;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown:hover .icon-down {
    transform: rotate(180deg);
}

@keyframes dropdown3D {
    to {
        opacity: 1;
        transform: rotateX(0deg);
    }
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 20px;
}

.header-right a {
    font-weight: bold;
    text-decoration: none;
    color: #000;
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateY(-20px) rotateX(45deg);
    animation: fadeDrop 1s forwards;
    padding: 10px 20px;
    border-radius: 5px;
}

.header-right a:not(.login-btn):hover {
    background: rgba(238, 238, 238, 0.5);
    color: #000;
}


.header-right a:nth-child(1) {
    animation-delay: 0.2s;
}

.header-right a:nth-child(2) {
    animation-delay: 0.3s;
}

.header-right .flag {
    width: 20px;
    height: 20px;
    animation: fadeZoom 1s forwards;
    animation-delay: 0.4s;
    opacity: 0;
    transform: scale(0.8);
}

.login-btn {
    background-color: #ff7b7b;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.login-btn:hover {
    background: linear-gradient(135deg, #ff7b7b, #ffb88c);
    color: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* Keyframes */
@keyframes fadeDrop {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

@keyframes fadeZoom {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media screen and (max-width: 500px) {
    .header {
        padding: 6px 12px;
    }

    .header-left, .header-right {
        gap: 4px;
    }

    .logo {
        width: 32px;
        height: 32px;
    }

    .dropdown-label {
        font-size: 13px;
        padding: 2px 4px;
    }

    .header-right a {
        font-size: 11px;
        padding: 4px 8px;
    }

    .login-btn {
        font-size: 11px;
        padding: 4px 8px;
    }

    .flag {
        width: 16px;
        height: auto;
    }

    /* Dropdown menu không làm phình nền, vẫn giữ hover hiệu ứng */
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        padding: 6px 0;
        min-width: 140px;
        z-index: 1000;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    }

    .dropdown-menu a {
        font-size: 12px;
        padding: 6px 10px;
        animation-delay: calc(var(--i) * 0.1s);
    }
}
.box {
    margin-top: 70px;
    
}

.chat-list {
    height: 71vh;

}
.chat-item {
    cursor: pointer;
    transition: background 0.2s;
}
.chat-item.active, .chat-item:hover {
   background: linear-gradient(90deg, #cbd8f6, #b1dbf9);
  
}
.avatar {
    width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
   background: linear-gradient(90deg, #cbd8f6, #b1dbf9); display: inline-block;
}
.msg-snippet {
    color: #888; font-size: 0.96em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; display: inline-block;
}
.img-product {
    width: 60px; height: 60px; border-radius: 8px; object-fit: cover; border:1px solid #eee;
}



.chat-box { background: linear-gradient(90deg, #cbd8f6, #b1dbf9); border-radius: 16px; padding: 16px; min-height: 420px; }
.input-message { border-radius: 20px; padding: 12px 18px; }

.tao {
    position: relative;
    padding: 10px;
    font-weight: 500;
    opacity: 1;
    color: #000;
}
.taodeptrai {
    background-color: #F4F4F4;
    width: fit-content;
    height: 100%;
    
}
.bgcmess {
background: linear-gradient(90deg, #cbd8f6, #b1dbf9);
    width: fit-content;
    height: 100%;
}

.moreitem {
    width: 20px;
    height: 20px;
    position: absolute;
    transform: translateY(-50%);
    top: 50%;

    opacity: 0.1;
}
.moreitem:hover {
   opacity: 1;
}

.tao:hover .moreitem {

 opacity: 1;
}

.text-end .moreitem {
 left: -25px;
}

.text-start .moreitem {
       right: -25px;
   
}

.dropdown-menu-custom {
    display: none;
    position: absolute;
    background: white;
    color: #000;
    transform: translateY(-50%);
    top: 50%;
    border: 1px solid #ccc;
    padding: 4px 0;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 120px;
  
}

.dropdown-item {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 6px 12px;
    font-size: 16px;
    cursor: pointer;
   
}

.dropdown-item:hover {
    background: #f0f0f0;
}
.text-end .dropdown-menu-custom {
    left: -150px;
}

.text-start .dropdown-menu-custom {
   
    right: -150px;
}

.dropdown-item img {
    margin-right: 8px; 
}
.select-to-hide {
    width: 18px;
    height: 18px;
    accent-color: #0d6efd; 
}

