/* ---------------------- CONTAINER PREVIEW ẢNH ---------------------- */
.previewContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-wrapper {
    position: relative;          /* Để nút xóa chồng lên ảnh */
    width: 100px;
    height: 100px;
    flex-shrink: 0;              /* Không co lại */
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;            /* Ẩn phần thừa */
    cursor: pointer;
    transition: transform 0.2s;
}

.preview-wrapper:hover {
    transform: scale(1.1);       /* Phóng to nhẹ khi hover */
    z-index: 10;
}

.preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;           /* Cắt ảnh vừa div */
    transition: transform 0.3s;  /* Hiệu ứng phóng to/thu nhỏ */
}

.btn-remove-img {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255,0,0,0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
}

/* ---------------------- IMAGE VIEWER FULL SCREEN ---------------------- */
#imageViewer {
    display: none;               /* Mặc định ẩn */
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

#viewerImg {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s;
}

/* Nút zoom/rotate trong viewer */
.viewer-controls {
    position: absolute;
    bottom: 20px;
    display: flex;
    gap: 8px;
}

.viewer-controls button {
    background: rgba(255,255,255,0.8);
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* ---------------------- ẢNH TRONG TIN NHẮN ---------------------- */
.chat-message img {
    max-width: 150px;
    margin-top: 4px;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.3s;
}

.chat-message img:hover {
    transform: scale(1.5);
    z-index: 20;
    position: relative;
}
